From 8e152f05c90411368de65d8cfb6951df9068877c Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 25 Apr 2023 20:06:52 +0100 Subject: [PATCH] Ensure mod tests is at the end --- agb-image-converter/src/lib.rs | 30 +++++++++++++++--------------- agb/src/lib.rs | 16 ++++++++-------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/agb-image-converter/src/lib.rs b/agb-image-converter/src/lib.rs index c8d9c9f3..c63c4656 100644 --- a/agb-image-converter/src/lib.rs +++ b/agb-image-converter/src/lib.rs @@ -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); + } +} diff --git a/agb/src/lib.rs b/agb/src/lib.rs index c4d3bd80..effd589f 100644 --- a/agb/src/lib.rs +++ b/agb/src/lib.rs @@ -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 } -}