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

Function assert_trap_code

tests/all/cli_tests.rs:160–170  ·  view source on GitHub ↗
(status: &ExitStatus)

Source from the content-addressed store, hash-verified

158}
159
160fn assert_trap_code(status: &ExitStatus) {
161 let code = status
162 .code()
163 .expect("wasmtime process should exit normally");
164
165 // Test for the specific error code Wasmtime uses to indicate a trap return.
166 #[cfg(unix)]
167 assert_eq!(code, 128 + libc::SIGABRT);
168 #[cfg(windows)]
169 assert_eq!(code, 3);
170}
171
172// Run a simple WASI hello world, snapshot0 edition.
173#[test]

Callers 2

unreachable_without_wasiFunction · 0.70

Calls 2

expectMethod · 0.45
codeMethod · 0.45

Tested by

no test coverage detected