change test to always go through Gba::new

This commit is contained in:
Corwin Kuiper 2021-04-13 01:26:48 +01:00 committed by Corwin
parent ea8be33d3c
commit 3905c3e13a

View file

@ -33,12 +33,8 @@ fn panic_implementation(info: &core::panic::PanicInfo) -> ! {
loop {} loop {}
} }
#[cfg(not(test))]
static mut GBASINGLE: single::Singleton<Gba> = single::Singleton::new(unsafe { Gba::single_new() }); static mut GBASINGLE: single::Singleton<Gba> = single::Singleton::new(unsafe { Gba::single_new() });
#[cfg(test)]
static mut GBASINGLE: single::Singleton<Gba> = single::Singleton::empty();
pub struct Gba { pub struct Gba {
pub display: display::Display, pub display: display::Display,
} }
@ -103,7 +99,7 @@ pub fn test_runner(tests: &[&dyn Testable]) {
) )
.unwrap(); .unwrap();
let mut gba = unsafe { Gba::single_new() }; let mut gba = Gba::new();
for test in tests { for test in tests {
test.run(&mut gba); test.run(&mut gba);