MCPcopy Create free account
hub / github.com/WebAssembly/wasm-c-api / check_call

Function check_call

example/memory.c:35–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void check_call(wasm_func_t* func, int i, wasm_val_t args[], int32_t expected) {
36 wasm_val_t r = WASM_INIT_VAL;
37 wasm_val_vec_t args_ = {i, args};
38 wasm_val_vec_t results = {1, &r};
39 if (wasm_func_call(func, &args_, &results) || r.of.i32 != expected) {
40 printf("> Error on result\n");
41 exit(1);
42 }
43}
44
45void check_call0(wasm_func_t* func, int32_t expected) {
46 check_call(func, 0, NULL, expected);

Callers 3

check_call0Function · 0.70
check_call1Function · 0.70
check_call2Function · 0.70

Calls 1

wasm_func_callFunction · 0.85

Tested by

no test coverage detected