From 0d15b88fe607449f9e83ee8eea2add6d2a40190b Mon Sep 17 00:00:00 2001 From: NikVolf Date: Mon, 5 Jun 2017 16:33:12 +0300 Subject: [PATCH] endianness tests integrated --- spec/src/fixtures.rs | 1 + spec/src/run.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/spec/src/fixtures.rs b/spec/src/fixtures.rs index 41164bf..b8648da 100644 --- a/spec/src/fixtures.rs +++ b/spec/src/fixtures.rs @@ -8,3 +8,4 @@ macro_rules! run_test { } run_test!("i32", wasm_i32); +run_test!("endianness", wasm_endianness); \ No newline at end of file diff --git a/spec/src/run.rs b/spec/src/run.rs index 5bc5b55..d39c12f 100644 --- a/spec/src/run.rs +++ b/spec/src/run.rs @@ -30,6 +30,18 @@ fn runtime_value(test_val: &test::RuntimeValue) -> parity_wasm::RuntimeValue { let unsigned: u32 = test_val.value.parse().expect("Literal parse error"); parity_wasm::RuntimeValue::I32(unsigned as i32) }, + "i64" => { + let unsigned: u64 = test_val.value.parse().expect("Literal parse error"); + parity_wasm::RuntimeValue::I64(unsigned as i64) + }, + "f32" => { + let unsigned: u32 = test_val.value.parse().expect("Literal parse error"); + parity_wasm::RuntimeValue::decode_f32(unsigned) + }, + "f64" => { + let unsigned: u64 = test_val.value.parse().expect("Literal parse error"); + parity_wasm::RuntimeValue::decode_f64(unsigned) + }, _ => panic!("Unknwon runtime value type"), } }