MCPcopy Create free account
hub / github.com/Windfisch/rust-assert-no-alloc / unwind_nested

Function unwind_nested

tests/test.rs:110–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108
109#[test]
110fn unwind_nested() {
111 assert_eq!(check_and_reset(), false);
112 assert_no_alloc(|| {
113 let r = catch_unwind(|| {
114 assert_no_alloc(|| {
115 panic!();
116 });
117 });
118 assert!(r.is_err());
119
120 check_and_reset(); // unwinding might have allocated memory; we don't care about that.
121 do_alloc();
122 assert_eq!(check_and_reset(), true);
123 });
124}
125
126#[test]
127fn unwind_nested2() {

Callers

nothing calls this directly

Calls 3

assert_no_allocFunction · 0.85
check_and_resetFunction · 0.85
do_allocFunction · 0.85

Tested by

no test coverage detected