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

Function memory64_maximum_minimum

tests/all/memory.rs:514–568  ·  view source on GitHub ↗
(config: &mut Config)

Source from the content-addressed store, hash-verified

512#[wasmtime_test]
513#[cfg_attr(miri, ignore)]
514fn memory64_maximum_minimum(config: &mut Config) -> Result<()> {
515 config.wasm_memory64(true);
516 let engine = Engine::new(&config)?;
517 let mut store = Store::new(&engine, ());
518
519 assert!(
520 MemoryTypeBuilder::default()
521 .memory64(true)
522 .min(1 << 48)
523 .build()
524 .is_err()
525 );
526
527 let module = Module::new(
528 &engine,
529 format!(r#"(module (import "" "" (memory i64 {})))"#, 1u64 << 48),
530 )?;
531 let mem_ty = module
532 .imports()
533 .next()
534 .unwrap()
535 .ty()
536 .unwrap_memory()
537 .clone();
538 assert!(Memory::new(&mut store, mem_ty).is_err());
539
540 let module = Module::new(
541 &engine,
542 &format!(
543 r#"
544 (module
545 (memory i64 {})
546 )
547 "#,
548 1u64 << 48,
549 ),
550 )?;
551 assert!(Instance::new(&mut store, &module, &[]).is_err());
552
553 let module = Module::new(
554 &engine,
555 &format!(
556 r#"
557 (module
558 (memory i64 {})
559 (data (i64.const 0) "")
560 )
561 "#,
562 1u64 << 48,
563 ),
564 )?;
565 assert!(Instance::new(&mut store, &module, &[]).is_err());
566
567 Ok(())
568}
569
570#[test]
571fn shared_memory_basics() -> Result<()> {

Callers

nothing calls this directly

Calls 9

OkFunction · 0.85
newFunction · 0.50
wasm_memory64Method · 0.45
cloneMethod · 0.45
unwrap_memoryMethod · 0.45
tyMethod · 0.45
unwrapMethod · 0.45
nextMethod · 0.45
importsMethod · 0.45

Tested by

no test coverage detected