mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-06 06:53:39 +00:00
Remove stackoverflow error, have one CORE_INTERNAL error for catastrophic crash
This commit is contained in:
parent
59f5d6449b
commit
508d41c8c5
10 changed files with 163 additions and 57 deletions
34
test/stackoverflow/test/tests.c
Normal file
34
test/stackoverflow/test/tests.c
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <string.h>
|
||||
#include "unity.h"
|
||||
#include "uvm32.h"
|
||||
#include "../common/uvm32_common_custom.h"
|
||||
|
||||
#include "rom-header.h"
|
||||
|
||||
static uvm32_state_t vmst;
|
||||
static uvm32_evt_t evt;
|
||||
|
||||
void setUp(void) {
|
||||
// runs before each test
|
||||
uvm32_init(&vmst);
|
||||
uvm32_load(&vmst, rom_bin, rom_bin_len);
|
||||
}
|
||||
|
||||
void tearDown(void) {
|
||||
}
|
||||
|
||||
void test_stackoverflow(void) {
|
||||
// run the vm
|
||||
while(1) {
|
||||
uvm32_run(&vmst, &evt, 100);
|
||||
if (evt.typ == UVM32_EVT_SYSCALL) {
|
||||
// ignore syscalls
|
||||
} else {
|
||||
TEST_ASSERT_EQUAL(UVM32_EVT_ERR, evt.typ);
|
||||
TEST_ASSERT_EQUAL(UVM32_ERR_INTERNAL_CORE, evt.data.err.errcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue