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

Function iloop_aborts

tests/all/fuel.rs:452–461  ·  view source on GitHub ↗
(config: &Config, wat: &str)

Source from the content-addressed store, hash-verified

450 )?;
451
452 fn iloop_aborts(config: &Config, wat: &str) -> Result<()> {
453 log::debug!("Testing infinite loop:\n{wat}");
454 let engine = Engine::new(&config)?;
455 let module = Module::new(&engine, wat)?;
456 let mut store = Store::new(&engine, ());
457 store.set_fuel(10_000)?;
458 let error = Instance::new(&mut store, &module, &[]).err().unwrap();
459 assert_eq!(error.downcast::<Trap>().unwrap(), Trap::OutOfFuel);
460 Ok(())
461 }
462
463 Ok(())
464}

Callers 1

iloopFunction · 0.85

Calls 5

OkFunction · 0.85
newFunction · 0.50
set_fuelMethod · 0.45
unwrapMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected