From 0ccbb927abb31a7807792ce114d7fd92dd129a2f Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 12 Oct 2020 20:39:03 -0700 Subject: [PATCH] change immediate test values to be less redundant --- src/main.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 167d759..bf421d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,14 @@ const TEST_VALUES: &[u64] = &[ 0x1234_5678_8000_0000, 0x1234_5678_8000_0001, 0x1234_5678_FFFF_FFFF, + 0x7FFE, + 0x7FFF, + 0x8000, + 0x8001, +]; + +const IMMED16_TEST_VALUES: &[u16] = &[ + 0x0, 0x1, 0x2, 0xFFFF, 0xFFFE, 0x7FFE, 0x7FFF, 0x8000, 0x8001, ]; const BOOL_VALUES: &[bool] = &[false, true]; @@ -52,14 +60,14 @@ fn call_with_inputs( } } InstructionInputRegister::ImmediateS16 => { - for &i in TEST_VALUES { + for &i in IMMED16_TEST_VALUES { inputs.immediate = Some(i as i16 as u64); call_with_inputs(inputs, input_registers, f)?; } } InstructionInputRegister::ImmediateU16 => { - for &i in TEST_VALUES { - inputs.immediate = Some(i as u16 as u64); + for &i in IMMED16_TEST_VALUES { + inputs.immediate = Some(i as u64); call_with_inputs(inputs, input_registers, f)?; } } -- 2.30.2