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

Function array_get_wrong_store

tests/all/arrays.rs:297–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295#[test]
296#[should_panic = "wrong store"]
297fn array_get_wrong_store() {
298 let mut store1 = gc_store().unwrap();
299 let mut store2 = gc_store().unwrap();
300
301 let array_ty = ArrayType::new(
302 store1.engine(),
303 FieldType::new(Mutability::Const, ValType::I32.into()),
304 );
305 let pre = ArrayRefPre::new(&mut store1, array_ty);
306
307 let array = ArrayRef::new_fixed(&mut store1, &pre, &[Val::I32(11)]).unwrap();
308
309 // Should panic.
310 let _ = array.get(&mut store2, 0);
311}
312
313#[test]
314fn array_set_in_bounds() -> Result<()> {

Callers

nothing calls this directly

Calls 5

gc_storeFunction · 0.85
newFunction · 0.50
unwrapMethod · 0.45
engineMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected