mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 01:21:34 +11:00
add helper function for asserting output
This commit is contained in:
parent
12406fc952
commit
91bb5c0774
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue