mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Test getslice_fixed when a buffer is requests which exceeds memory
This commit is contained in:
parent
a7b480fd11
commit
aae4eacfb8
1 changed files with 21 additions and 0 deletions
|
|
@ -190,3 +190,24 @@ void test_syscall_args_string_never_terminates(void) {
|
||||||
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_MEM_RD);
|
TEST_ASSERT_EQUAL(evt.data.err.errcode, UVM32_ERR_MEM_RD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_syscall_args_bufrd_toolarge(void) {
|
||||||
|
// run the vm
|
||||||
|
uvm32_run(&vmst, &evt, 1000);
|
||||||
|
// check for picktest syscall
|
||||||
|
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_SYSCALL);
|
||||||
|
TEST_ASSERT_EQUAL(evt.data.syscall.code, SYSCALL_PICKTEST);
|
||||||
|
uvm32_arg_setval(&vmst, &evt, RET, SYSCALL_C);
|
||||||
|
|
||||||
|
uvm32_run(&vmst, &evt, 1000);
|
||||||
|
TEST_ASSERT_EQUAL(evt.typ, UVM32_EVT_SYSCALL);
|
||||||
|
TEST_ASSERT_EQUAL(evt.data.syscall.code, SYSCALL_C);
|
||||||
|
|
||||||
|
// get buffer described by ptr=ARG0,len=ARG1
|
||||||
|
uvm32_slice_t buf = uvm32_arg_getslice_fixed(&vmst, &evt, ARG0, 256);
|
||||||
|
TEST_ASSERT_EQUAL(0, buf.len);
|
||||||
|
// 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_MEM_RD);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue