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

Function createModuleCPP

test/plugins/unittest/unittest_c.cpp:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30WasmEdge_ModuleInstanceContext *createModuleCPP() {
31 WasmEdge_PluginLoadFromPath(
32 "./" WASMEDGE_LIB_PREFIX
33 "wasmedgePluginTestModuleCPP" WASMEDGE_LIB_EXTENSION);
34 WasmEdge_String Str =
35 WasmEdge_StringCreateByCString("wasmedge_plugintest_cpp");
36 const WasmEdge_PluginContext *PluginCxt = WasmEdge_PluginFind(Str);
37 WasmEdge_StringDelete(Str);
38 if (!PluginCxt) {
39 return nullptr;
40 }
41
42 Str = WasmEdge_StringCreateByCString("wasmedge_plugintest_cpp_module");
43 WasmEdge_ModuleInstanceContext *ModCxt =
44 WasmEdge_PluginCreateModule(PluginCxt, Str);
45 WasmEdge_StringDelete(Str);
46 return ModCxt;
47}
48} // namespace
49
50TEST(wasmedgePluginTests, C_Run) {

Callers 1

TESTFunction · 0.70

Calls 4

WasmEdge_PluginFindFunction · 0.85
WasmEdge_StringDeleteFunction · 0.85

Tested by

no test coverage detected