MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / TEST

Function TEST

test/loader/serializeSectionTest.cpp:15–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13WasmEdge::Loader::Serializer Ser(Conf);
14
15TEST(SerializeSectionTest, SerializeCustomSection) {
16 WasmEdge::AST::CustomSection CustomSec;
17 CustomSec.setName("name");
18 CustomSec.getContent() = {0x01U, 0x02U, 0x03U, 0x04U, 0x05U};
19
20 std::vector<uint8_t> Output;
21 EXPECT_TRUE(Ser.serializeSection(CustomSec, Output));
22 std::vector<uint8_t> Expected = {
23 0x00U, // Section ID
24 0x0AU, // Content size = 10
25 0x04U, // Name length = 4
26 0x6EU, 0x61U, 0x6DU, 0x65U, // Name
27 0x01U, 0x02U, 0x03U, 0x04U, 0x05U // Content
28 };
29 EXPECT_EQ(Output, Expected);
30}
31
32TEST(SerializeSectionTest, SerializeTypeSection) {
33 WasmEdge::AST::TypeSection TypeSec;

Callers

nothing calls this directly

Calls 15

InstructionClass · 0.85
setNameMethod · 0.80
serializeSectionMethod · 0.80
setModuleNameMethod · 0.80
setExternalNameMethod · 0.80
setExternalTypeMethod · 0.80
setMinMethod · 0.80
setMaxMethod · 0.80
addProposalMethod · 0.80
removeProposalMethod · 0.80
setExternalIndexMethod · 0.80

Tested by

no test coverage detected