Skip to content

Commit

Permalink
test showing boolector failure when function returns null slice
Browse files Browse the repository at this point in the history
  • Loading branch information
hudson-ayers committed Aug 28, 2020
1 parent d66be5b commit 1150cbd
Show file tree
Hide file tree
Showing 4 changed files with 2,194 additions and 81 deletions.
22 changes: 22 additions & 0 deletions tests/basic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,25 @@ fn basic_rust_32bit() {
PossibleSolutions::exactly_two(ReturnValue::Return(2), ReturnValue::Abort)
);
}

#[test]
fn rust_null_slice() {
let funcname = "basic_rust::Foo::ez3";
init_logging();
let proj = get_basic_rust_project();
let mut config: Config<backend::DefaultBackend> = Config::default();
config.null_pointer_checking = config::NullPointerChecking::None; // In the Tock kernel, we trust that Rust safety mechanisms prevent null pointer dereferences.
config.loop_bound = 20; // default is 10, go higher to detect unbounded loops
let ret = get_possible_return_values_of_func(
funcname,
vec![Some(1)],
&proj,
Config::default(),
None,
10,
);
assert_eq!(
ret,
PossibleSolutions::exactly_two(ReturnValue::Return(1), ReturnValue::Abort)
);
}
Binary file modified tests/bcfiles/basic_rust.bc
Binary file not shown.
Loading

0 comments on commit 1150cbd

Please sign in to comment.