| 13 | WasmEdge::Loader::Serializer Ser(Conf); |
| 14 | |
| 15 | TEST(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 | |
| 32 | TEST(SerializeSectionTest, SerializeTypeSection) { |
| 33 | WasmEdge::AST::TypeSection TypeSec; |
nothing calls this directly
no test coverage detected