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

Function TEST

test/loader/sectionTest.cpp:35–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35TEST(SectionTest, LoadCustomSection) {
36 std::vector<uint8_t> Vec;
37
38 // 1. Test load custom section.
39 //
40 // 1. Load invalid empty section.
41 // 2. Load invalid custom section without contents.
42 // 3. Load custom section with 0-length name.
43 // 4. Load custom section with contents.
44
45 Vec = {0x00U};
46 EXPECT_FALSE(Ldr.parseModule(prefixedVec(Vec)));
47
48 Vec = {
49 0x00U, // Custom section
50 0x00U // Content size = 0
51 };
52 EXPECT_FALSE(Ldr.parseModule(prefixedVec(Vec)));
53
54 Vec = {
55 0x00U, // Custom section
56 0x01U, // Content size = 1
57 0x00U // Name length = 0
58 };
59 EXPECT_TRUE(Ldr.parseModule(prefixedVec(Vec)));
60
61 Vec = {
62 0x00U, // Custom section
63 0x07U, // Content size = 7
64 0x00U, // Name length = 0
65 0xFFU, 0xEEU, 0xDDU, 0xCCU, 0xBBU, 0xAAU // Content
66 };
67 EXPECT_TRUE(Ldr.parseModule(prefixedVec(Vec)));
68}
69
70TEST(SectionTest, LoadTypeSection) {
71 std::vector<uint8_t> Vec;

Callers

nothing calls this directly

Calls 3

parseModuleMethod · 0.80
setWASMStandardMethod · 0.80
prefixedVecFunction · 0.70

Tested by

no test coverage detected