()
| 269 | |
| 270 | #[tokio::test] |
| 271 | async 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 |
nothing calls this directly
no test coverage detected