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

Function caches_across_engines

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

Source from the content-addressed store, hash-verified

46
47#[test]
48fn caches_across_engines() {
49 let c = Config::new();
50
51 let bytes = Module::new(&Engine::new(&c).unwrap(), "(module)")
52 .unwrap()
53 .serialize()
54 .unwrap();
55
56 unsafe {
57 let res = Module::deserialize(&Engine::default(), &bytes);
58 assert!(res.is_ok());
59
60 // differ in runtime settings
61 let res = Module::deserialize(
62 &Engine::new(Config::new().memory_reservation(0)).unwrap(),
63 &bytes,
64 );
65 assert!(res.is_err());
66
67 // differ in wasm features enabled (which can affect
68 // runtime/compilation settings)
69 let res = Module::deserialize(
70 &Engine::new(Config::new().wasm_relaxed_simd(false)).unwrap(),
71 &bytes,
72 );
73 assert!(res.is_err());
74 }
75}
76
77#[test]
78#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 6

newFunction · 0.50
deserializeFunction · 0.50
unwrapMethod · 0.45
serializeMethod · 0.45
memory_reservationMethod · 0.45
wasm_relaxed_simdMethod · 0.45

Tested by

no test coverage detected