mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-26 00:56:38 +11:00
add helper function for asserting output
This commit is contained in:
parent
12406fc952
commit
91bb5c0774
2 changed files with 12 additions and 9 deletions
|
@ -19,13 +19,5 @@ fn logo_display(gba: &mut crate::Gba) {
|
||||||
back.set_position(0, 0);
|
back.set_position(0, 0);
|
||||||
back.show();
|
back.show();
|
||||||
|
|
||||||
let vblank = gba.display.vblank.get();
|
crate::assert_image_output("gfx/test_logo.png");
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,6 +133,17 @@ pub extern "C" fn main() -> ! {
|
||||||
loop {}
|
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)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::Gba;
|
use super::Gba;
|
||||||
|
|
Loading…
Add table
Reference in a new issue