* test coverage: make sure aliases to builtins get tested

* trivial support for handles

* add tests for handles
This commit is contained in:
Pat Hickey
2020-02-27 03:57:36 -07:00
committed by GitHub
parent 10dcaeeab4
commit 90182bc5da
6 changed files with 166 additions and 5 deletions

View File

@@ -14,7 +14,10 @@ impl atoms::Atoms for WasiCtx {
println!("INT FLOAT ARGS: {} {}", an_int, an_float);
Ok(())
}
fn double_int_return_float(&mut self, an_int: u32) -> Result<f32, types::Errno> {
fn double_int_return_float(
&mut self,
an_int: u32,
) -> Result<types::AliasToFloat, types::Errno> {
Ok((an_int as f32) * 2.0)
}
}
@@ -75,7 +78,7 @@ impl DoubleIntExercise {
self.return_loc.ptr as i32,
);
let return_val: GuestRef<f32> = guest_memory
let return_val: GuestRef<types::AliasToFloat> = guest_memory
.ptr(self.return_loc.ptr)
.expect("return loc ptr")
.as_ref()