| 49 | } |
| 50 | |
| 51 | void check_call(wasm_func_t* func, int32_t arg1, int32_t arg2, int32_t expected) { |
| 52 | wasm_val_t vs[2] = { WASM_I32_VAL(arg1), WASM_I32_VAL(arg2) }; |
| 53 | wasm_val_t r[1] = { WASM_INIT_VAL }; |
| 54 | wasm_val_vec_t args = WASM_ARRAY_VEC(vs); |
| 55 | wasm_val_vec_t results = WASM_ARRAY_VEC(r); |
| 56 | if (wasm_func_call(func, &args, &results) || r[0].of.i32 != expected) { |
| 57 | printf("> Error on result\n"); |
| 58 | exit(1); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | void check_trap(wasm_func_t* func, int32_t arg1, int32_t arg2) { |
| 63 | wasm_val_t vs[2] = { WASM_I32_VAL(arg1), WASM_I32_VAL(arg2) }; |
no test coverage detected