mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Add test for reading code which is too large
This commit is contained in:
parent
f2c903cfb6
commit
92913ab478
5 changed files with 36 additions and 1 deletions
|
|
@ -4,7 +4,8 @@ TESTS = \
|
|||
custom_syscall \
|
||||
syscall_args \
|
||||
meter \
|
||||
extram
|
||||
extram \
|
||||
badcode
|
||||
|
||||
RUNCMD = $(foreach TEST,${TESTS},make -C ${TEST} &&)
|
||||
CLEANCMD = $(foreach TEST,${TESTS},make -C ${TEST} clean &&)
|
||||
|
|
|
|||
2
test/badcode/Makefile
Normal file
2
test/badcode/Makefile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
TOPDIR=../..
|
||||
include ${TOPDIR}/test/common/makefile.common
|
||||
2
test/badcode/rom/Makefile
Normal file
2
test/badcode/rom/Makefile
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
TOPDIR=../../..
|
||||
include ${TOPDIR}/test/common/makefile-rom.common
|
||||
7
test/badcode/rom/rom.c
Normal file
7
test/badcode/rom/rom.c
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include "uvm32_target.h"
|
||||
|
||||
void main(void) {
|
||||
void *p = NULL;
|
||||
println(p);
|
||||
}
|
||||
|
||||
23
test/badcode/test/tests.c
Normal file
23
test/badcode/test/tests.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#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) {
|
||||
}
|
||||
|
||||
void tearDown(void) {
|
||||
}
|
||||
|
||||
void test_giant_rom(void) {
|
||||
// try to load a ROM bigger than we have space for
|
||||
uvm32_init(&vmst);
|
||||
TEST_ASSERT_EQUAL(false, uvm32_load(&vmst, rom_bin, UVM32_MEMORY_SIZE+1)); // if it reads off end of rom_bin, will crash
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue