mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
check no blocks are leaked during testing
This commit is contained in:
parent
49c8720c8c
commit
e75adf9e67
|
@ -243,6 +243,13 @@ where
|
|||
mgba::number_of_cycles_tagged(785);
|
||||
self(gba);
|
||||
mgba::number_of_cycles_tagged(785);
|
||||
|
||||
assert!(
|
||||
unsafe { agb_alloc::number_of_blocks() } < 2,
|
||||
"memory is being leaked, there are {} blocks",
|
||||
unsafe { agb_alloc::number_of_blocks() }
|
||||
);
|
||||
|
||||
mgba.print(format_args!("[ok]"), mgba::DebugLevel::Info)
|
||||
.unwrap();
|
||||
}
|
||||
|
@ -274,10 +281,10 @@ pub fn test_runner(tests: &[&dyn Testable]) {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
let mut gba = unsafe { TEST_GBA.as_mut() }.unwrap();
|
||||
let gba = unsafe { TEST_GBA.as_mut() }.unwrap();
|
||||
|
||||
for test in tests {
|
||||
test.run(&mut gba);
|
||||
test.run(gba);
|
||||
}
|
||||
|
||||
mgba.print(
|
||||
|
|
Loading…
Reference in a new issue