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

Function prefixedVec

test/loader/expressionTest.cpp:25–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23WasmEdge::Configure Conf;
24WasmEdge::Loader::Loader Ldr(Conf);
25std::vector<uint8_t> prefixedVec(const std::vector<uint8_t> &Vec) {
26 std::vector<uint8_t> PrefixVec = {
27 0x00U, 0x61U, 0x73U, 0x6DU, // Magic
28 0x01U, 0x00U, 0x00U, 0x00U, // Version
29 0x03U, // Function section
30 0x02U, // Content size = 2
31 0x01U, // Vector length = 1
32 0x00U, // vec[0]
33 };
34 PrefixVec.reserve(PrefixVec.size() + Vec.size());
35 PrefixVec.insert(PrefixVec.end(), Vec.begin(), Vec.end());
36 return PrefixVec;
37}
38
39TEST(ExpressionTest, LoadExpression) {
40 std::vector<uint8_t> Vec;

Callers 1

TESTFunction · 0.70

Calls 4

insertMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected