| 31 | } |
| 32 | |
| 33 | void check_call(wasmtime_context_t *store, wasmtime_func_t *func, |
| 34 | const wasmtime_val_t *args, size_t nargs, int32_t expected) { |
| 35 | wasmtime_val_t results[1]; |
| 36 | wasm_trap_t *trap = NULL; |
| 37 | wasmtime_error_t *error = |
| 38 | wasmtime_func_call(store, func, args, nargs, results, 1, &trap); |
| 39 | if (error != NULL || trap != NULL) |
| 40 | exit_with_error("failed to call function", error, trap); |
| 41 | if (results[0].of.i32 != expected) { |
| 42 | printf("> Error on result\n"); |
| 43 | exit(1); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | void check_call0(wasmtime_context_t *store, wasmtime_func_t *func, |
| 48 | int32_t expected) { |
no test coverage detected