Ensure mod tests is at the end (#419)

Fixes build failure

- [x] Changelog updated / no changelog update needed
This commit is contained in:
Gwilym Inzani 2023-04-25 20:17:13 +01:00 committed by GitHub
commit 3747d6192a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 23 deletions

View file

@ -569,21 +569,6 @@ pub fn include_font(input: TokenStream) -> TokenStream {
.into() .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 { fn valid_sprite_size(width: u32, height: u32) -> bool {
match (width, height) { match (width, height) {
(8, 8) => true, (8, 8) => true,
@ -601,3 +586,18 @@ fn valid_sprite_size(width: u32, height: u32) -> bool {
(_, _) => false, (_, _) => 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)] #[cfg(test)]
mod test { mod test {
use super::Gba; 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 }
}