| 201 | 0x09, 0x01, 0x07, 0x00, 0x03, 0x40, 0x0c, 0x00, 0x0b, 0x0b}; |
| 202 | |
| 203 | TEST(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 | |
| 227 | TEST(AsyncExecute, InterruptTest) { |
| 228 | WasmEdge::Configure Conf; |
nothing calls this directly
no test coverage detected