()
| 40 | |
| 41 | #[test] |
| 42 | fn functions_interruptible() -> wasmtime::Result<()> { |
| 43 | let mut store = interruptible_store(); |
| 44 | let module = hugely_recursive_module(store.engine())?; |
| 45 | let func = Func::wrap(&mut store, || {}); |
| 46 | let instance = Instance::new(&mut store, &module, &[func.into()])?; |
| 47 | let iloop = instance.get_typed_func::<(), ()>(&mut store, "loop")?; |
| 48 | store.engine().increment_epoch(); |
| 49 | let trap = iloop.call(&mut store, ()).unwrap_err().downcast::<Trap>()?; |
| 50 | assert_eq!(trap, Trap::Interrupt); |
| 51 | Ok(()) |
| 52 | } |
| 53 | |
| 54 | const NUM_HITS: usize = 100_000; |
| 55 |
nothing calls this directly
no test coverage detected