mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +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);
|
mgba::number_of_cycles_tagged(785);
|
||||||
self(gba);
|
self(gba);
|
||||||
mgba::number_of_cycles_tagged(785);
|
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)
|
mgba.print(format_args!("[ok]"), mgba::DebugLevel::Info)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
@ -274,10 +281,10 @@ pub fn test_runner(tests: &[&dyn Testable]) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut gba = unsafe { TEST_GBA.as_mut() }.unwrap();
|
let gba = unsafe { TEST_GBA.as_mut() }.unwrap();
|
||||||
|
|
||||||
for test in tests {
|
for test in tests {
|
||||||
test.run(&mut gba);
|
test.run(gba);
|
||||||
}
|
}
|
||||||
|
|
||||||
mgba.print(
|
mgba.print(
|
||||||
|
|
Loading…
Reference in a new issue