From 9844d400ff46ea26b152027df931cef5b4ff7243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Sun, 25 Feb 2024 20:34:11 +0000 Subject: [PATCH] fix: issues with tests --- src/dma.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/dma.rs b/src/dma.rs index 532e0c23..9f7971a2 100644 --- a/src/dma.rs +++ b/src/dma.rs @@ -184,7 +184,9 @@ mod tests { #[test] fn test_dma_default() { let dma = Dma::default(); - assert!(!dma.active); + assert!(!dma.active_dma); + assert!(!dma.active_hdma); + assert!(!dma.active()); } #[test] @@ -195,7 +197,10 @@ mod tests { dma.length = 0x9abc; dma.pending = 0x9abc; dma.mode = DmaMode::HBlank; - dma.active = true; + dma.cycles_dma = 0x0012; + dma.value_dma = 0xff; + dma.active_dma = true; + dma.active_hdma = true; dma.reset(); @@ -204,13 +209,17 @@ mod tests { assert_eq!(dma.length, 0x0); assert_eq!(dma.pending, 0x0); assert_eq!(dma.mode, DmaMode::General); - assert!(!dma.active); + assert_eq!(dma.cycles_dma, 0x0); + assert_eq!(dma.value_dma, 0x0); + assert!(!dma.active_dma); + assert!(!dma.active_hdma); } #[test] fn test_dma_set_active() { let mut dma = Dma::new(); - dma.set_active(true); - assert!(dma.active); + dma.set_active_dma(true); + assert!(dma.active_dma); + assert!(dma.active()); } } -- GitLab