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

Function test_module_serialize_fail

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

Source from the content-addressed store, hash-verified

63#[test]
64#[cfg_attr(miri, ignore)]
65fn test_module_serialize_fail() -> Result<()> {
66 let buffer = serialize(
67 &Engine::default(),
68 "(module (func (export \"run\") (result i32) i32.const 42))",
69 )?;
70
71 let mut config = Config::new();
72 config.memory_reservation(0);
73 let mut store = Store::new(&Engine::new(&config)?, ());
74 match unsafe { deserialize_and_instantiate(&mut store, &buffer) } {
75 Ok(_) => bail!("expected failure at deserialization"),
76 Err(_) => (),
77 }
78 Ok(())
79}
80
81#[test]
82#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 5

OkFunction · 0.85
serializeFunction · 0.70
newFunction · 0.50
memory_reservationMethod · 0.45

Tested by

no test coverage detected