()
| 124 | |
| 125 | #[test] |
| 126 | fn instance_exports() -> Result<()> { |
| 127 | let module_bytes = { |
| 128 | let mut config = Config::new(); |
| 129 | config.concurrency_support(false); |
| 130 | let engine = Engine::new(&config)?; |
| 131 | Module::new( |
| 132 | &engine, |
| 133 | "(module (func (export \"f\")) (memory (export \"m\") 1) (global (export \"g\") i32 (i32.const 0)))", |
| 134 | )? |
| 135 | .serialize()? |
| 136 | }; |
| 137 | let mut config = Config::new(); |
| 138 | config.enable_compiler(false); |
| 139 | config.concurrency_support(false); |
| 140 | let engine = Engine::new(&config)?; |
| 141 | let module = unsafe { Module::deserialize(&engine, &module_bytes)? }; |
| 142 | let linker = Linker::<()>::new(&engine); |
| 143 | let instance_pre = linker.instantiate_pre(&module)?; |
| 144 | |
| 145 | OomTest::new().test(|| { |
| 146 | let mut store = Store::try_new(&engine, ())?; |
| 147 | let instance = instance_pre.instantiate(&mut store)?; |
| 148 | let count = instance.exports(&mut store).count(); |
| 149 | assert_eq!(count, 3); |
| 150 | Ok(()) |
| 151 | }) |
| 152 | } |
| 153 | |
| 154 | #[test] |
| 155 | fn instance_get_func() -> Result<()> { |
nothing calls this directly
no test coverage detected