We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c53f7f6 commit 308c6f6Copy full SHA for 308c6f6
foundationdb/tests/api_ub.rs
@@ -2,16 +2,18 @@ use std::panic;
2
3
#[test]
4
fn test_run() {
5
+ let old = panic::take_hook();
6
panic::set_hook(Box::new(|_| {}));
7
let mut db = None;
8
let result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
9
// Run the foundationdb client API
10
let _drop_me = unsafe { foundationdb::boot() };
- db = Some(foundationdb::Database::default().unwrap());
11
+ db = Some(futures::executor::block_on(foundationdb::Database::new_compat(None)).unwrap());
12
// Try to escape via unwind
13
panic!("UNWIND!")
14
}));
15
assert!(result.is_err());
16
let trx = db.unwrap().create_trx().unwrap();
17
let _err = futures::executor::block_on(trx.get_read_version()).unwrap_err();
18
+ panic::set_hook(old);
19
}
0 commit comments