diff --git a/src/lib.rs b/src/lib.rs index 114e5f7..d8940ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,30 +67,3 @@ pub mod audio; pub mod constants; -#[cfg(test)] -mod tests { - use crate::memory::{io::*, Cart}; - const TEST_ROMS: &[&str] = &[ - // "roms/Legend of Zelda, The - Link's Awakening DX (USA, Europe) (Rev B) (SGB Enhanced).gbc", - // "roms/Pokemon - Crystal Version (USA, Europe) (Rev A).gbc", - // "roms/Pokemon Pinball (USA) (Rumble Version) (SGB Enhanced).gbc", - // "roms/Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb", - "roms/Super Mario Land 2 - 6 Golden Coins (USA, Europe) (Rev B).gb", - "roms/Super Mario Land (World) (Rev A).gb", - "roms/Tetris (World) (Rev A).gb", - ]; - #[test] - /// Checksums the cart headers of every cart defined in [TEST_ROMS], - /// and compares them against the checksum stored in the header - fn cart_header_checksum() { - for rom in TEST_ROMS { - let rom = std::fs::read(rom).unwrap(); - let cart = Cart::from(rom); - let mut cksum = 0u8; - for index in 0x134..0x14d { - cksum = cksum.wrapping_sub(cart.read(index).unwrap()).wrapping_sub(1) - } - assert_eq!(cksum, cart.headercksum().unwrap()) - } - } -}