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

Function createModuleC

test/plugins/unittest/unittest_c.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11namespace {
12WasmEdge_ModuleInstanceContext *createModuleC() {
13 WasmEdge_PluginLoadFromPath(
14 "./" WASMEDGE_LIB_PREFIX
15 "wasmedgePluginTestModuleC" WASMEDGE_LIB_EXTENSION);
16 WasmEdge_String Str = WasmEdge_StringCreateByCString("wasmedge_plugintest_c");
17 const WasmEdge_PluginContext *PluginCxt = WasmEdge_PluginFind(Str);
18 WasmEdge_StringDelete(Str);
19 if (!PluginCxt) {
20 return nullptr;
21 }
22
23 Str = WasmEdge_StringCreateByCString("wasmedge_plugintest_c_module");
24 WasmEdge_ModuleInstanceContext *ModCxt =
25 WasmEdge_PluginCreateModule(PluginCxt, Str);
26 WasmEdge_StringDelete(Str);
27 return ModCxt;
28}
29
30WasmEdge_ModuleInstanceContext *createModuleCPP() {
31 WasmEdge_PluginLoadFromPath(

Callers 1

TESTFunction · 0.70

Calls 4

WasmEdge_PluginFindFunction · 0.85
WasmEdge_StringDeleteFunction · 0.85

Tested by

no test coverage detected