mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-06 06:53:39 +00:00
Test for invalid uvm32_arg_t
This commit is contained in:
parent
59ade881c3
commit
99c0925db5
1 changed files with 15 additions and 0 deletions
|
|
@ -59,4 +59,19 @@ void test_custom_syscall_badval(void) {
|
|||
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_END);
|
||||
}
|
||||
|
||||
void test_custom_syscall_badarg(void) {
|
||||
// run the vm
|
||||
uvm32_run(&vmst, &evt, 100);
|
||||
// check for custom syscall
|
||||
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_SYSCALL);
|
||||
TEST_ASSERT_EQUAL(evt.data.syscall.code, 0xDEADBEEF);
|
||||
TEST_ASSERT_EQUAL(0, uvm32_arg_getval(&vmst, &evt, (uvm32_arg_t)123)); // not ARG0, ARG1 or RET
|
||||
|
||||
// check for error state
|
||||
uvm32_run(&vmst, &evt, 100);
|
||||
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_ERR);
|
||||
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_ARGS);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue