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

Function check_trap

example/table.cc:63–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void check_trap(const wasm::Func* func, wasm::Val&& arg1, wasm::Val&& arg2) {
64 auto args = wasm::vec<wasm::Val>::make(std::move(arg1), std::move(arg2));
65 auto results = wasm::vec<wasm::Val>::make_uninitialized(1);
66 if (! func->call(args, results)) {
67 std::cout << "> Error on result, expected trap" << std::endl;
68 exit(1);
69 }
70}
71
72void run() {
73 // Initialize.

Callers 1

runFunction · 0.70

Calls 1

callMethod · 0.80

Tested by

no test coverage detected