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

Function trap_smoke

tests/all/host_funcs.rs:467–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

465#[test]
466#[cfg_attr(miri, ignore)]
467fn trap_smoke() -> Result<()> {
468 let engine = Engine::default();
469 let mut linker = Linker::<()>::new(&engine);
470 linker.func_wrap("", "", || -> Result<()> { bail!("test") })?;
471
472 let mut store = Store::new(&engine, ());
473
474 let f = linker.get(&mut store, "", "").unwrap().into_func().unwrap();
475
476 let err = f.call(&mut store, &[], &mut []).unwrap_err();
477
478 assert!(err.to_string().contains("test"));
479
480 Ok(())
481}
482
483#[test]
484#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
newFunction · 0.50
func_wrapMethod · 0.45
unwrapMethod · 0.45
into_funcMethod · 0.45
getMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected