Skip to content

Commit

Permalink
Fix failures on test compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Feb 10, 2020
1 parent e17d8f2 commit b40edd4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 7 additions & 3 deletions lib/clif-backend/src/signal/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,17 @@ pub fn call_protected(
TrapCode::HeapOutOfBounds => ExceptionCode::MemoryOutOfBounds,
TrapCode::TableOutOfBounds => ExceptionCode::CallIndirectOOB,
TrapCode::UnreachableCodeReached => ExceptionCode::Unreachable,
_ => ExceptionCode::Unknown,
_ => return Err(CallProtError(Box::new("unknown trap code".to_string()))),
},
EXCEPTION_STACK_OVERFLOW => ExceptionCode::Unknown,
EXCEPTION_STACK_OVERFLOW => ExceptionCode::MemoryOutOfBounds,
EXCEPTION_INT_DIVIDE_BY_ZERO | EXCEPTION_INT_OVERFLOW => {
ExceptionCode::IllegalArithmetic
}
_ => ExceptionCode::Unknown,
_ => {
return Err(CallProtError(Box::new(
"unknown exception code".to_string(),
)))
}
})))
} else {
let signal = match code as DWORD {
Expand Down
4 changes: 1 addition & 3 deletions lib/spectests/tests/semantics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ mod tests {
match result {
Err(err) => match err {
CallError::Runtime(RuntimeError(e)) => {
let exc_code = e
.downcast::<ExceptionCode>()
e.downcast::<ExceptionCode>()
.expect("expecting exception code");
assert!(exc_code != ExceptionCode::Unknown);
}
_ => unimplemented!(),
},
Expand Down
5 changes: 2 additions & 3 deletions lib/spectests/tests/spectest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ mod tests {
}
CallError::Runtime(RuntimeError(e)) => {
use wasmer_runtime::ExceptionCode;
if let Some(_) = data.downcast_ref::<ExceptionCode>() {
if let Some(_) = e.downcast_ref::<ExceptionCode>() {
test_report.count_passed();
} else {
test_report.add_failure(
Expand All @@ -699,8 +699,7 @@ mod tests {
line,
kind: format!("{}", "AssertTrap"),
message: format!(
"expected trap, got Runtime:Error {:?}",
r
"expected trap, got RuntimeError"
),
},
&test_key,
Expand Down

0 comments on commit b40edd4

Please sign in to comment.