Fix wiggle tests

This commit is contained in:
Alex Crichton
2021-02-17 13:42:41 -08:00
committed by Andrew Brown
parent df9c725fa0
commit fa98f0bc91
31 changed files with 236 additions and 239 deletions

View File

@@ -118,7 +118,7 @@ impl SumOfPairExercise {
self.return_loc.ptr as i32,
);
assert_eq!(sum_err, Ok(types::Errno::Ok.into()), "sum errno");
assert_eq!(sum_err, Ok(types::Errno::Ok as i32), "sum errno");
let return_val: i64 = host_memory
.ptr(self.return_loc.ptr)
@@ -218,7 +218,7 @@ impl SumPairPtrsExercise {
assert_eq!(
res,
Ok(types::Errno::Ok.into()),
Ok(types::Errno::Ok as i32),
"sum of pair of ptrs errno"
);
@@ -299,7 +299,7 @@ impl SumIntAndPtrExercise {
self.return_loc.ptr as i32,
);
assert_eq!(res, Ok(types::Errno::Ok.into()), "sum of int and ptr errno");
assert_eq!(res, Ok(types::Errno::Ok as i32), "sum of int and ptr errno");
let doubled: i64 = host_memory
.ptr(self.return_loc.ptr)
@@ -338,7 +338,7 @@ impl ReturnPairInts {
let err = structs::return_pair_ints(&ctx, &host_memory, self.return_loc.ptr as i32);
assert_eq!(err, Ok(types::Errno::Ok.into()), "return struct errno");
assert_eq!(err, Ok(types::Errno::Ok as i32), "return struct errno");
let return_struct: types::PairInts = host_memory
.ptr(self.return_loc.ptr)
@@ -420,7 +420,7 @@ impl ReturnPairPtrsExercise {
assert_eq!(
res,
Ok(types::Errno::Ok.into()),
Ok(types::Errno::Ok as i32),
"return pair of ptrs errno"
);
@@ -530,7 +530,7 @@ impl SumArrayExercise {
);
// should be no error - if hostcall did a GuestError it should eprintln it.
assert_eq!(res, Ok(types::Errno::Ok.into()), "reduce excuses errno");
assert_eq!(res, Ok(types::Errno::Ok as i32), "reduce excuses errno");
// Sum is inputs upcasted to u16
let expected: u16 = self.inputs.iter().map(|v| *v as u16).sum();