Browse Source

Fix tests

Isaac Woods 3 years ago
parent
commit
e39bf68355
2 changed files with 14 additions and 5 deletions
  1. 14 0
      aml/src/test_utils.rs
  2. 0 5
      aml/src/value.rs

+ 14 - 0
aml/src/test_utils.rs

@@ -148,6 +148,10 @@ pub(crate) fn crudely_cmp_values(a: &AmlValue, b: &AmlValue) -> bool {
             }
             _ => false,
         },
+        AmlValue::Device => match b {
+            AmlValue::Device => true,
+            _ => false,
+        },
         AmlValue::Method { flags, code } => match b {
             AmlValue::Method { flags: b_flags, code: b_code } => {
                 if flags != b_flags {
@@ -189,5 +193,15 @@ pub(crate) fn crudely_cmp_values(a: &AmlValue, b: &AmlValue) -> bool {
             }
             _ => false,
         },
+        AmlValue::PowerResource { system_level, resource_order } => match b {
+            AmlValue::PowerResource { system_level: b_system_level, resource_order: b_resource_order } => {
+                system_level == b_system_level && resource_order == b_resource_order
+            }
+            _ => false,
+        },
+        AmlValue::ThermalZone => match b {
+            AmlValue::ThermalZone => true,
+            _ => false,
+        },
     }
 }

+ 0 - 5
aml/src/value.rs

@@ -569,11 +569,6 @@ mod tests {
         assert_eq!(AmlValue::Integer(11).cmp(AmlValue::Integer(11), &mut context), Ok(Ordering::Equal));
         assert_eq!(AmlValue::Integer(8362836690).cmp(AmlValue::Integer(1), &mut context), Ok(Ordering::Greater));
 
-        assert_eq!(
-            AmlValue::Integer(4).cmp(AmlValue::Boolean(true), &mut context),
-            Err(AmlError::IncompatibleValueConversion { current: AmlType::Integer, target: AmlType::Integer })
-        );
-
         // TODO: test the other combinations too, as well as conversions to the correct types for the second operand
     }
 }