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

Function check_trap

example/memory.cc:45–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44template<class... Args>
45void check_trap(const wasm::Func* func, Args... xs) {
46 auto args = wasm::vec<wasm::Val>::make(wasm::Val::i32(xs)...);
47 auto results = wasm::vec<wasm::Val>::make();
48 if (! func->call(args, results)) {
49 std::cout << "> Error on result, expected trap" << std::endl;
50 exit(1);
51 }
52}
53
54template<class... Args>
55auto call(const wasm::Func* func, Args... xs) -> int32_t {

Callers 1

runFunction · 0.70

Calls 1

callMethod · 0.80

Tested by

no test coverage detected