mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-03-03 01:51:32 +00:00
fix: update shared_heap_test to use os_getpagesize for memory size calculations
This commit is contained in:
parent
9bc75ca1fd
commit
68ea3a9719
|
|
@ -263,7 +263,7 @@ TEST_F(shared_heap_test, test_preallocated_shared_runtime_api)
|
|||
}
|
||||
|
||||
size = (uint64_t)UINT32_MAX + 0x2000;
|
||||
printf("offset %lx size: %lx\n", offset, size);
|
||||
printf("offset %llx size: %llx\n", offset, size);
|
||||
ASSERT_EQ(false, wasm_runtime_validate_app_addr(
|
||||
tmp_module_env.wasm_module_inst, offset, size));
|
||||
|
||||
|
|
@ -1337,7 +1337,7 @@ TEST_F(shared_heap_test, test_shared_heap_chain_addr_conv_oob)
|
|||
FAIL() << "Failed to register natives";
|
||||
}
|
||||
|
||||
args.size = 4096;
|
||||
args.size = os_getpagesize();
|
||||
shared_heap = wasm_runtime_create_shared_heap(&args);
|
||||
if (!shared_heap) {
|
||||
FAIL() << "Failed to create shared heap";
|
||||
|
|
@ -1359,14 +1359,14 @@ TEST_F(shared_heap_test, test_shared_heap_chain_addr_conv_oob)
|
|||
}
|
||||
|
||||
/* test wasm */
|
||||
argv[0] = 0xFFFFFFFF - BUF_SIZE - 4096;
|
||||
argv[0] = 0xFFFFFFFF - BUF_SIZE - os_getpagesize();
|
||||
EXPECT_NONFATAL_FAILURE(test_shared_heap(shared_heap_chain,
|
||||
"test_addr_conv.wasm",
|
||||
"test_preallocated", 1, argv),
|
||||
"Exception: out of bounds memory access");
|
||||
|
||||
/* test aot */
|
||||
argv[0] = 0xFFFFFFFF - BUF_SIZE - 4096;
|
||||
argv[0] = 0xFFFFFFFF - BUF_SIZE - os_getpagesize();
|
||||
EXPECT_NONFATAL_FAILURE(test_shared_heap(shared_heap_chain,
|
||||
"test_addr_conv_chain.aot",
|
||||
"test_preallocated", 1, argv),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user