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

Function TEST

test/api/APIVMCoreTest.cpp:277–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275 0x09, 0x01, 0x07, 0x00, 0x03, 0x40, 0x0c, 0x00, 0x0b, 0x0b};
276
277TEST(AsyncRunWsmFile, InterruptTest) {
278 WasmEdge_VMContext *VM = WasmEdge_VMCreate(nullptr, nullptr);
279 {
280 WasmEdge_Async *AsyncCxt = WasmEdge_VMAsyncRunWasmFromBuffer(
281 VM, AsyncWasm.data(), static_cast<uint32_t>(AsyncWasm.size()),
282 WasmEdge_StringWrap("_start", 6), nullptr, 0);
283 EXPECT_NE(AsyncCxt, nullptr);
284 EXPECT_FALSE(WasmEdge_AsyncWaitFor(AsyncCxt, 1));
285 WasmEdge_AsyncCancel(AsyncCxt);
286 WasmEdge_Result Res = WasmEdge_AsyncGet(AsyncCxt, nullptr, 0);
287 EXPECT_FALSE(WasmEdge_ResultOK(Res));
288 EXPECT_EQ(WasmEdge_ResultGetCode(Res), WasmEdge_ErrCode_Interrupted);
289 WasmEdge_AsyncDelete(AsyncCxt);
290 }
291 WasmEdge_VMDelete(VM);
292}
293
294TEST(AsyncExecute, InterruptTest) {
295 WasmEdge_VMContext *VM = WasmEdge_VMCreate(nullptr, nullptr);

Callers

nothing calls this directly

Calls 15

WasmEdge_VMCreateFunction · 0.85
WasmEdge_AsyncWaitForFunction · 0.85
WasmEdge_AsyncCancelFunction · 0.85
WasmEdge_ResultOKFunction · 0.85
WasmEdge_ResultGetCodeFunction · 0.85
WasmEdge_AsyncDeleteFunction · 0.85
WasmEdge_VMDeleteFunction · 0.85
WasmEdge_VMAsyncExecuteFunction · 0.85
WasmEdge_ConfigureCreateFunction · 0.85

Tested by

no test coverage detected