diff --git a/agb/src/display/example_logo.rs b/agb/src/display/example_logo.rs index 42e2c47b..de199d4b 100644 --- a/agb/src/display/example_logo.rs +++ b/agb/src/display/example_logo.rs @@ -19,13 +19,5 @@ fn logo_display(gba: &mut crate::Gba) { back.set_position(0, 0); back.show(); - let vblank = gba.display.vblank.get(); - vblank.wait_for_VBlank(); - let mut mgba = crate::mgba::Mgba::new().unwrap(); - mgba.print( - format_args!("image:gfx/test_logo.png"), - crate::mgba::DebugLevel::Info, - ) - .unwrap(); - vblank.wait_for_VBlank(); + crate::assert_image_output("gfx/test_logo.png"); } diff --git a/agb/src/lib.rs b/agb/src/lib.rs index 658b99b2..413aba5a 100644 --- a/agb/src/lib.rs +++ b/agb/src/lib.rs @@ -133,6 +133,17 @@ pub extern "C" fn main() -> ! { loop {} } +#[cfg(test)] +fn assert_image_output(image: &str) { + let mut mgba = crate::mgba::Mgba::new().unwrap(); + mgba.print( + format_args!("image:{}", image), + crate::mgba::DebugLevel::Info, + ) + .unwrap(); + display::busy_wait_for_VBlank(); +} + #[cfg(test)] mod test { use super::Gba;