(
wat: &str,
c: C,
f: F,
)
| 47 | } |
| 48 | |
| 49 | fn test_stack_values< |
| 50 | C: Fn(&mut Config), |
| 51 | F: Fn(Caller<'_, ()>) -> wasmtime::Result<()> + Send + Sync + 'static, |
| 52 | >( |
| 53 | wat: &str, |
| 54 | c: C, |
| 55 | f: F, |
| 56 | ) -> wasmtime::Result<()> { |
| 57 | let (module, mut store) = get_module_and_store(c, wat)?; |
| 58 | let func = Func::wrap(&mut store, move |caller: Caller<'_, ()>| { |
| 59 | f(caller)?; |
| 60 | Ok(()) |
| 61 | }); |
| 62 | let instance = Instance::new(&mut store, &module, &[Extern::Func(func)])?; |
| 63 | let mut results = []; |
| 64 | instance |
| 65 | .get_func(&mut store, "main") |
| 66 | .unwrap() |
| 67 | .call(&mut store, &[], &mut results)?; |
| 68 | |
| 69 | Ok(()) |
| 70 | } |
| 71 | |
| 72 | #[test] |
| 73 | #[cfg_attr(miri, ignore)] |
no test coverage detected