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

Function unwrap

crates/c-api/tests/types.cc:6–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace wasmtime;
5
6template <typename T, typename E> T unwrap(Result<T, E> result) {
7 if (result) {
8 return result.ok();
9 }
10 std::cerr << "error: " << result.err().message() << "\n";
11 std::abort();
12}
13
14TEST(ValType, Smoke) {
15 EXPECT_EQ(ValType::i32(), ValType::i32());

Callers 1

TESTFunction · 0.70

Calls 4

abortFunction · 0.85
okMethod · 0.45
messageMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected