Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/c-api/tests/memory.cc
1692 views
1
#include <wasmtime/memory.hh>
2
3
#include <gtest/gtest.h>
4
#include <wasmtime.hh>
5
6
using namespace wasmtime;
7
8
TEST(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
}
17
18