From 6dbc3d5cf01149316ce7f6630e6af6220906320e Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Sun, 19 Jan 2020 00:30:50 +0200 Subject: [PATCH] tests: Add test for the bug fixed in cca16c52fd838b34c759913a41ff28c4e04735d0 [formerly 453e7c03ab48f1bcf72cd9d4b1aae012eb08c697] Updated gba-suite submodule Former-commit-id: 97bccebd0a9bf60ed6da1cf3f853b98d114631af --- .gitmodules | 2 +- external/gba-suite | 2 +- src/core/gba.rs | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 67fe5ea..3f4a141 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "external/gba-suite"] path = external/gba-suite - url = https://github.com/jsmolka/gba-suite.git + url = https://github.com/michelhe/gba-suite.git diff --git a/external/gba-suite b/external/gba-suite index 854c1fb..0fdc3ad 160000 --- a/external/gba-suite +++ b/external/gba-suite @@ -1 +1 @@ -Subproject commit 854c1fb3a02fc8d94d04041b2948826708d81011 +Subproject commit 0fdc3ada312fcc9180fed8ef96d5ce039321ba5a diff --git a/src/core/gba.rs b/src/core/gba.rs index a92a288..7e474d6 100644 --- a/src/core/gba.rs +++ b/src/core/gba.rs @@ -189,9 +189,11 @@ mod tests { use std::cell::RefCell; use std::rc::Rc; + use super::super::bus::Bus; use super::super::arm7tdmi; use super::super::cartridge::Cartridge; + struct DummyInterface {} impl DummyInterface { @@ -230,7 +232,8 @@ mod tests { gba.frame(); } - assert_eq!(0x080019e0, gba.cpu.pc); + let insn = gba.sysbus.read_32(gba.cpu.pc); + assert_eq!(insn, 0xeafffffe); // loop assert_eq!(0, gba.cpu.gpr[12]); } @@ -242,7 +245,8 @@ mod tests { gba.frame(); } - assert_eq!(0x800091a, gba.cpu.pc); + let insn = gba.sysbus.read_16(gba.cpu.pc); + assert_eq!(insn, 0xe7fe); // loop assert_eq!(0, gba.cpu.gpr[7]); } }