| 275 | 0x09, 0x01, 0x07, 0x00, 0x03, 0x40, 0x0c, 0x00, 0x0b, 0x0b}; |
| 276 | |
| 277 | TEST(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 | |
| 294 | TEST(AsyncExecute, InterruptTest) { |
| 295 | WasmEdge_VMContext *VM = WasmEdge_VMCreate(nullptr, nullptr); |
nothing calls this directly
no test coverage detected