change immediate test values to be less redundant
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 13 Oct 2020 03:39:03 +0000 (20:39 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Tue, 13 Oct 2020 03:39:03 +0000 (20:39 -0700)
src/main.rs

index 167d759e83d937bce60c742048c64abe4a20aff6..bf421d6ddb872a534d47cb0668657f5a3a644bec 100644 (file)
@@ -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)?;
                 }
             }