| 87 | } |
| 88 | |
| 89 | void check_trap(wasmtime_context_t *store, wasmtime_func_t *func, |
| 90 | const wasmtime_val_t *args, size_t nargs, size_t num_results) { |
| 91 | assert(num_results <= 1); |
| 92 | wasmtime_val_t results[1]; |
| 93 | wasm_trap_t *trap = NULL; |
| 94 | wasmtime_error_t *error = |
| 95 | wasmtime_func_call(store, func, args, nargs, results, num_results, &trap); |
| 96 | if (error != NULL) |
| 97 | exit_with_error("failed to call function", error, NULL); |
| 98 | if (trap == NULL) { |
| 99 | printf("> Error on result, expected trap\n"); |
| 100 | exit(1); |
| 101 | } |
| 102 | wasm_trap_delete(trap); |
| 103 | } |
| 104 | |
| 105 | void check_trap1(wasmtime_context_t *store, wasmtime_func_t *func, |
| 106 | int32_t arg) { |
no test coverage detected