Переглянути джерело

Fix existing tests AmlContext creation

Isaac Woods 4 роки тому
батько
коміт
b9f5726807
5 змінених файлів з 17 додано та 17 видалено
  1. 4 4
      aml/src/name_object.rs
  2. 4 4
      aml/src/opcode.rs
  3. 3 3
      aml/src/parser.rs
  4. 4 4
      aml/src/pkg_length.rs
  5. 2 2
      aml/src/term_object.rs

+ 4 - 4
aml/src/name_object.rs

@@ -228,11 +228,11 @@ fn is_name_char(byte: u8) -> bool {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::{parser::Parser, test_utils::*, AmlContext, AmlError};
+    use crate::{parser::Parser, test_utils::*, AmlContext, AmlError, DebugVerbosity};
 
     #[test]
     fn test_name_seg() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
 
         check_ok!(
             name_seg().parse(&[b'A', b'F', b'3', b'Z'], &mut context),
@@ -254,7 +254,7 @@ mod tests {
 
     #[test]
     fn test_name_path() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
 
         check_err!(name_path().parse(&[], &mut context), AmlError::UnexpectedEndOfStream, &[]);
         check_ok!(name_path().parse(&[0x00], &mut context), alloc::vec![], &[]);
@@ -272,7 +272,7 @@ mod tests {
 
     #[test]
     fn test_prefix_path() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
 
         check_ok!(
             name_string().parse(&[b'^', b'A', b'B', b'C', b'D'], &mut context),

+ 4 - 4
aml/src/opcode.rs

@@ -88,18 +88,18 @@ where
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::{test_utils::*, AmlError};
+    use crate::{test_utils::*, AmlError, DebugVerbosity};
 
     #[test]
     fn empty() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_err!(opcode(NULL_NAME).parse(&[], &mut context), AmlError::UnexpectedEndOfStream, &[]);
         check_err!(ext_opcode(EXT_DEF_FIELD_OP).parse(&[], &mut context), AmlError::UnexpectedEndOfStream, &[]);
     }
 
     #[test]
     fn simple_opcodes() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_ok!(opcode(DEF_SCOPE_OP).parse(&[DEF_SCOPE_OP], &mut context), (), &[]);
         check_ok!(
             opcode(DEF_NAME_OP).parse(&[DEF_NAME_OP, 0x31, 0x55, 0xf3], &mut context),
@@ -110,7 +110,7 @@ mod tests {
 
     #[test]
     fn extended_opcodes() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_err!(
             ext_opcode(EXT_DEF_FIELD_OP).parse(&[EXT_DEF_FIELD_OP, EXT_DEF_FIELD_OP], &mut context),
             AmlError::WrongParser,

+ 3 - 3
aml/src/parser.rs

@@ -472,11 +472,11 @@ pub(crate) macro try_with_context($context: expr, $expr: expr) {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::test_utils::*;
+    use crate::{test_utils::*, DebugVerbosity};
 
     #[test]
     fn test_take_n() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_err!(take_n(1).parse(&[], &mut context), AmlError::UnexpectedEndOfStream, &[]);
         check_err!(take_n(2).parse(&[0xf5], &mut context), AmlError::UnexpectedEndOfStream, &[0xf5]);
 
@@ -487,7 +487,7 @@ mod tests {
 
     #[test]
     fn test_take_ux() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_err!(take_u16().parse(&[0x34], &mut context), AmlError::UnexpectedEndOfStream, &[0x34]);
         check_ok!(take_u16().parse(&[0x34, 0x12], &mut context), 0x1234, &[]);
 

+ 4 - 4
aml/src/pkg_length.rs

@@ -91,10 +91,10 @@ where
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::{test_utils::*, AmlError};
+    use crate::{test_utils::*, AmlError, DebugVerbosity};
 
     fn test_correct_pkglength(stream: &[u8], expected_raw_length: u32, expected_leftover: &[u8]) {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_ok!(
             pkg_length().parse(stream, &mut context),
             PkgLength::from_raw_length(stream, expected_raw_length),
@@ -104,7 +104,7 @@ mod tests {
 
     #[test]
     fn test_raw_pkg_length() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_ok!(raw_pkg_length().parse(&[0b01000101, 0x14], &mut context), 325, &[]);
         check_ok!(raw_pkg_length().parse(&[0b01000111, 0x14, 0x46], &mut context), 327, &[0x46]);
         check_ok!(raw_pkg_length().parse(&[0b10000111, 0x14, 0x46], &mut context), 287047, &[]);
@@ -112,7 +112,7 @@ mod tests {
 
     #[test]
     fn test_pkg_length() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_err!(pkg_length().parse(&[], &mut context), AmlError::UnexpectedEndOfStream, &[]);
         test_correct_pkglength(&[0x00], 0, &[]);
         test_correct_pkglength(&[0x05, 0xf5, 0x7f, 0x3e, 0x54, 0x03], 5, &[0xf5, 0x7f, 0x3e, 0x54, 0x03]);

+ 2 - 2
aml/src/term_object.rs

@@ -576,11 +576,11 @@ where
 #[cfg(test)]
 mod test {
     use super::*;
-    use crate::test_utils::*;
+    use crate::{test_utils::*, AmlContext, DebugVerbosity};
 
     #[test]
     fn test_computational_data() {
-        let mut context = AmlContext::new();
+        let mut context = AmlContext::new(DebugVerbosity::None);
         check_ok!(
             computational_data().parse(&[0x00, 0x34, 0x12], &mut context),
             AmlValue::Integer(0),