Skip to content

Commit 265de54

Browse files
committed
Add precompiled section test on runtime
Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent d749021 commit 265de54

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/runtime_test.cc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,26 @@ TEST_P(TestVM, Trap) {
173173
ASSERT_TRUE(integration_->error_message_.find(exp_message) != std::string::npos);
174174
}
175175

176+
TEST_P(TestVM, WithPrecompiledSection) {
177+
// Verify that stripping precompile_* custom section works.
178+
initialize("abi_export.wasm");
179+
// Append precompiled_test section
180+
std::vector<char> custom_section = {// custom section id
181+
0x00,
182+
// section length
183+
0x13,
184+
// name length
185+
0x10,
186+
// name = precompiled_test
187+
0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,
188+
0x64, 0x5f, 0x74, 0x65, 0x73, 0x74,
189+
// content
190+
0x01, 0x01};
191+
192+
source_.append(custom_section.data(), custom_section.size());
193+
ASSERT_TRUE(vm_->load(source_, false));
194+
ASSERT_EQ(vm_->getAbiVersion(), AbiVersion::ProxyWasm_0_2_0);
195+
}
196+
176197
} // namespace
177198
} // namespace proxy_wasm

0 commit comments

Comments
 (0)