Skip to content

Commit 308c6f6

Browse files
author
Vincent Rouillé
committed
Fix api_ub test on API <610
1 parent c53f7f6 commit 308c6f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

foundationdb/tests/api_ub.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ use std::panic;
22

33
#[test]
44
fn test_run() {
5+
let old = panic::take_hook();
56
panic::set_hook(Box::new(|_| {}));
67
let mut db = None;
78
let result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
89
// Run the foundationdb client API
910
let _drop_me = unsafe { foundationdb::boot() };
10-
db = Some(foundationdb::Database::default().unwrap());
11+
db = Some(futures::executor::block_on(foundationdb::Database::new_compat(None)).unwrap());
1112
// Try to escape via unwind
1213
panic!("UNWIND!")
1314
}));
1415
assert!(result.is_err());
1516
let trx = db.unwrap().create_trx().unwrap();
1617
let _err = futures::executor::block_on(trx.get_read_version()).unwrap_err();
18+
panic::set_hook(old);
1719
}

0 commit comments

Comments
 (0)