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

Function test_module_serialize_simple

tests/all/module_serialize.rs:48–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46#[test]
47#[cfg_attr(miri, ignore)]
48fn test_module_serialize_simple() -> Result<()> {
49 let buffer = serialize(
50 &Engine::default(),
51 "(module (func (export \"run\") (result i32) i32.const 42))",
52 )?;
53
54 let mut store = Store::default();
55 let instance = unsafe { deserialize_and_instantiate(&mut store, &buffer)? };
56 let run = instance.get_typed_func::<(), i32>(&mut store, "run")?;
57 let result = run.call(&mut store, ())?;
58
59 assert_eq!(42, result);
60 Ok(())
61}
62
63#[test]
64#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 4

OkFunction · 0.85
serializeFunction · 0.70
callMethod · 0.45

Tested by

no test coverage detected