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

Function TEST

test/executor/ExecutorTest.cpp:203–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 0x09, 0x01, 0x07, 0x00, 0x03, 0x40, 0x0c, 0x00, 0x0b, 0x0b};
202
203TEST(AsyncRunWsmFile, InterruptTest) {
204 WasmEdge::Configure Conf;
205 WasmEdge::VM::VM VM(Conf);
206 {
207 auto Timeout =
208 std::chrono::system_clock::now() + std::chrono::milliseconds(1);
209 auto AsyncResult = VM.asyncRunWasmFile(AsyncWasm, "_start");
210 EXPECT_FALSE(AsyncResult.waitUntil(Timeout));
211 AsyncResult.cancel();
212 auto Result = AsyncResult.get();
213 EXPECT_FALSE(Result);
214 EXPECT_EQ(Result.error(), WasmEdge::ErrCode::Value::Interrupted);
215 }
216 {
217 auto Timeout = std::chrono::milliseconds(1);
218 auto AsyncResult = VM.asyncRunWasmFile(AsyncWasm, "_start");
219 EXPECT_FALSE(AsyncResult.waitFor(Timeout));
220 AsyncResult.cancel();
221 auto Result = AsyncResult.get();
222 EXPECT_FALSE(Result);
223 EXPECT_EQ(Result.error(), WasmEdge::ErrCode::Value::Interrupted);
224 }
225}
226
227TEST(AsyncExecute, InterruptTest) {
228 WasmEdge::Configure Conf;

Callers

nothing calls this directly

Calls 15

nowClass · 0.85
waitUntilMethod · 0.80
cancelMethod · 0.80
waitForMethod · 0.80
loadWasmMethod · 0.80
parseModuleMethod · 0.80
instantiateModuleMethod · 0.80
findFuncExportsMethod · 0.80
setEnableCoredumpMethod · 0.80
setCoredumpWasmgdbMethod · 0.80
pathMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected