Macro sgx_tunittest::should_panic [−][src]
macro_rules! should_panic { ($fmt:expr) => { ... }; }
This macro implements the fail test.
For example, in traditional Rust testing, we write
#[test] #[should_panic] fn foo () { assert!(false); }
This test would pass because it would panic and is expected to panic
(#[should_panic]
).
An equivalent version of Rust SGX unit test is:
fn foo() { should_panic!(assert!(false)); }
This requires developer to identify the line which triggers panic exactly.