()
| 1302 | #[test] |
| 1303 | #[cfg_attr(miri, ignore)] |
| 1304 | fn shared_memory_unsupported() -> Result<()> { |
| 1305 | // Skip this test on platforms that don't support threads. |
| 1306 | if crate::threads::engine().is_none() { |
| 1307 | return Ok(()); |
| 1308 | } |
| 1309 | let mut config = Config::new(); |
| 1310 | let mut cfg = PoolingAllocationConfig::default(); |
| 1311 | // shrink the size of this allocator |
| 1312 | cfg.total_memories(1); |
| 1313 | config.allocation_strategy(InstanceAllocationStrategy::Pooling(cfg)); |
| 1314 | let engine = Engine::new(&config)?; |
| 1315 | |
| 1316 | let err = Module::new( |
| 1317 | &engine, |
| 1318 | r#" |
| 1319 | (module |
| 1320 | (memory 5 5 shared) |
| 1321 | ) |
| 1322 | "#, |
| 1323 | ) |
| 1324 | .unwrap_err(); |
| 1325 | err.assert_contains( |
| 1326 | "memory is shared which is not supported \ |
| 1327 | in the pooling allocator", |
| 1328 | ); |
| 1329 | err.assert_contains("memory index 0"); |
| 1330 | Ok(()) |
| 1331 | } |
| 1332 | |
| 1333 | #[test] |
| 1334 | #[cfg_attr(miri, ignore)] |
nothing calls this directly
no test coverage detected