Ensure mod tests is at the end

This commit is contained in:
Gwilym Inzani 2023-04-25 20:06:52 +01:00
parent 6355ac0df7
commit 8e152f05c9
2 changed files with 23 additions and 23 deletions

View file

@ -569,21 +569,6 @@ pub fn include_font(input: TokenStream) -> TokenStream {
.into()
}
#[cfg(test)]
mod tests {
use asefile::AnimationDirection;
#[test]
// These directions defined in agb and have these values. This is important
// when outputting code for agb. If more animation directions are added then
// we will have to support them there.
fn directions_to_agb() {
assert_eq!(AnimationDirection::Forward as usize, 0);
assert_eq!(AnimationDirection::Reverse as usize, 1);
assert_eq!(AnimationDirection::PingPong as usize, 2);
}
}
fn valid_sprite_size(width: u32, height: u32) -> bool {
match (width, height) {
(8, 8) => true,
@ -601,3 +586,18 @@ fn valid_sprite_size(width: u32, height: u32) -> bool {
(_, _) => false,
}
}
#[cfg(test)]
mod tests {
use asefile::AnimationDirection;
#[test]
// These directions defined in agb and have these values. This is important
// when outputting code for agb. If more animation directions are added then
// we will have to support them there.
fn directions_to_agb() {
assert_eq!(AnimationDirection::Forward as usize, 0);
assert_eq!(AnimationDirection::Reverse as usize, 1);
assert_eq!(AnimationDirection::PingPong as usize, 2);
}
}

View file

@ -360,6 +360,14 @@ pub mod test_runner {
}
}
#[inline(never)]
pub(crate) fn program_counter_before_interrupt() -> u32 {
extern "C" {
static mut agb_rs__program_counter: u32;
}
unsafe { agb_rs__program_counter }
}
#[cfg(test)]
mod test {
use super::Gba;
@ -444,11 +452,3 @@ mod test {
}
}
}
#[inline(never)]
pub(crate) fn program_counter_before_interrupt() -> u32 {
extern "C" {
static mut agb_rs__program_counter: u32;
}
unsafe { agb_rs__program_counter }
}