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

Function makeCompWithLocalResource

test/component/ComponentValidatorTest.cpp:1073–1082  ·  view source on GitHub ↗

Helper: build a Component with a single ResourceType in type index 0.

Source from the content-addressed store, hash-verified

1071
1072// Helper: build a Component with a single ResourceType in type index 0.
1073inline AST::Component::Component makeCompWithLocalResource() {
1074 AST::Component::Component Comp;
1075 Comp.getSections().emplace_back();
1076 Comp.getSections().back().emplace<AST::Component::TypeSection>();
1077 auto &TypeSec =
1078 std::get<AST::Component::TypeSection>(Comp.getSections().back());
1079 TypeSec.getContent().emplace_back();
1080 TypeSec.getContent().back().setResourceType(AST::Component::ResourceType{});
1081 return Comp;
1082}
1083
1084// Helper: append a CanonSection with a single canonical to the component.
1085inline AST::Component::CanonSection &

Callers 1

TESTFunction · 0.85

Calls 4

getSectionsMethod · 0.80
backMethod · 0.80
setResourceTypeMethod · 0.80
getContentMethod · 0.45

Tested by

no test coverage detected