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

Function linker_module_async

crates/fuzzing/tests/oom/linker.rs:271–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269
270#[tokio::test]
271async fn linker_module_async() -> Result<()> {
272 let module_bytes = {
273 let mut config = Config::new();
274 config.concurrency_support(false);
275 let engine = Engine::new(&config)?;
276 Module::new(
277 &engine,
278 r#"(module (func (export "f")) (memory (export "m") 1))"#,
279 )?
280 .serialize()?
281 };
282 let mut config = Config::new();
283 config.enable_compiler(false);
284 config.concurrency_support(false);
285 let engine = Engine::new(&config)?;
286 let module = unsafe { Module::deserialize(&engine, &module_bytes)? };
287
288 OomTest::new()
289 .test_async(|| async {
290 let mut store = Store::try_new(&engine, ())?;
291 let mut linker = Linker::<()>::new(&engine);
292 linker.module_async(&mut store, "m", &module).await?;
293 Ok(())
294 })
295 .await
296}
297
298// Note: linker_define_unknown_imports_as_traps and
299// linker_define_unknown_imports_as_default_values are not tested under OOM

Callers

nothing calls this directly

Calls 9

OkFunction · 0.85
enable_compilerMethod · 0.80
test_asyncMethod · 0.80
module_asyncMethod · 0.80
newFunction · 0.50
deserializeFunction · 0.50
try_newFunction · 0.50
concurrency_supportMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected