MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / check_call

Function check_call

examples/multimemory.c:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

check_call0Function · 0.70
check_call1Function · 0.70
check_call2Function · 0.70

Calls 2

wasmtime_func_callFunction · 0.85
exit_with_errorFunction · 0.70

Tested by

no test coverage detected