Remove stackoverflow error, have one CORE_INTERNAL error for catastrophic crash

This commit is contained in:
Toby Jaffey 2025-12-10 18:42:34 +00:00
parent 59f5d6449b
commit 508d41c8c5
10 changed files with 163 additions and 57 deletions

View 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;
}
}
}