use super::helpers::{MooneyeResult, run_and_detect_cgb};
use crate::gb::model::CgbModel;
const BASE: &str = "roms/gb/automated_tests/SameSuite/dma";
const SAMESUITE_CYCLE_LIMIT: u64 = 15_000_000;
macro_rules! assert_samesuite_pass {
($path:expr) => {{
let result = run_and_detect_cgb($path, CgbModel::default(), SAMESUITE_CYCLE_LIMIT);
assert_eq!(
result,
MooneyeResult::Pass,
"SameSuite DMA test failed: {:?}",
result
);
}};
}
#[test]
fn test_samesuite_gdma_addr_mask() {
assert_samesuite_pass!(&format!("{}/gdma_addr_mask.gb", BASE));
}
#[test]
fn test_samesuite_gbc_dma_cont() {
assert_samesuite_pass!(&format!("{}/gbc_dma_cont.gb", BASE));
}
#[test]
fn test_samesuite_hdma_lcd_off() {
assert_samesuite_pass!(&format!("{}/hdma_lcd_off.gb", BASE));
}
#[test]
fn test_samesuite_hdma_mode0() {
assert_samesuite_pass!(&format!("{}/hdma_mode0.gb", BASE));
}