MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / test_unload_engine

Function test_unload_engine

crates/wasmtime/tests/unload-engine.rs:12–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11#[test]
12fn test_unload_engine() {
13 for _ in 0..3 {
14 std::thread::spawn(|| {
15 let engine = Engine::default();
16 {
17 let module =
18 Module::new(&engine, r#"(module (func (export "x") unreachable))"#).unwrap();
19 let mut store = Store::new(&engine, ());
20 let instance = Instance::new(&mut store, &module, &[]).unwrap();
21 let func = instance.get_typed_func::<(), ()>(&mut store, "x").unwrap();
22 assert!(func.call(&mut store, ()).unwrap_err().is::<Trap>());
23 }
24 unsafe {
25 engine.unload_process_handlers();
26 }
27 })
28 .join()
29 .unwrap();
30 }
31}

Callers

nothing calls this directly

Calls 5

spawnFunction · 0.85
newFunction · 0.50
unwrapMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected