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

Function TEST

crates/c-api/tests/memory.cc:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace wasmtime;
7
8TEST(Memory, Smoke) {
9 Engine engine;
10 Store store(engine);
11 Memory m = Memory::create(store, MemoryType(1)).unwrap();
12 EXPECT_EQ(m.size(store), 1);
13 EXPECT_EQ(m.grow(store, 1).unwrap(), 1);
14 EXPECT_EQ(m.data(store).size(), 2 << 16);
15 EXPECT_EQ(m.type(store)->min(), 1);
16 EXPECT_EQ(m.page_size_log2(store), 16);
17 EXPECT_EQ(m.page_size(store), 1 << 16);
18}
19
20TEST(Memory, OneBytePageSize) {
21 Engine engine;

Callers

nothing calls this directly

Calls 13

createFunction · 0.50
MemoryTypeClass · 0.50
BuilderClass · 0.50
unwrapMethod · 0.45
sizeMethod · 0.45
growMethod · 0.45
dataMethod · 0.45
minMethod · 0.45
typeMethod · 0.45
page_size_log2Method · 0.45
page_sizeMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected