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

Function check_call

examples/memory.c:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void 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
47void check_call0(wasmtime_context_t *store, wasmtime_func_t *func,
48 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