From ac5fd06106db84f601b65a8b230a6dca5e62b6d3 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Thu, 24 Jun 2021 19:52:45 +0100 Subject: [PATCH] add test for length of interrupt table --- agb/src/interrupt.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index 8811b817..60d15704 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -222,6 +222,15 @@ fn test_vblank_interrupt_handler(gba: &mut crate::Gba) { ); } +#[test_case] +fn test_interrupt_table_length(_gba: &mut crate::Gba) { + assert_eq!( + unsafe { INTERRUPT_TABLE.len() }, + Interrupt::Gamepak as usize + 1, + "interrupt table should be able to store gamepak interrupt" + ); +} + #[derive(Clone, Copy, PartialEq, Eq, Debug)] enum MutexState { Unlocked,