File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
uefi-test-runner/src/boot Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ pub fn test(st: &SystemTable<Boot>) {
1818 test_timer ( bt) ;
1919 info ! ( "Testing events..." ) ;
2020 test_check_event_freestanding ( ) ;
21+ test_timer_freestanding ( ) ;
2122 test_event_callback ( bt) ;
2223 test_callback_with_ctx ( bt) ;
2324 info ! ( "Testing watchdog..." ) ;
@@ -48,6 +49,14 @@ fn test_check_event_freestanding() {
4849 assert ! ( !is_signaled) ;
4950}
5051
52+ fn test_timer_freestanding ( ) {
53+ let timer_event =
54+ unsafe { boot:: create_event ( EventType :: TIMER , Tpl :: CALLBACK , None , None ) } . unwrap ( ) ;
55+ let mut events = unsafe { [ timer_event. unsafe_clone ( ) ] } ;
56+ boot:: set_timer ( & timer_event, TimerTrigger :: Relative ( 5_0 /*00 ns */ ) ) . unwrap ( ) ;
57+ assert_eq ! ( boot:: wait_for_event( & mut events) . unwrap( ) , 0 ) ;
58+ }
59+
5160fn test_timer ( bt : & BootServices ) {
5261 let timer_event = unsafe { bt. create_event ( EventType :: TIMER , Tpl :: APPLICATION , None , None ) }
5362 . expect ( "Failed to create TIMER event" ) ;
You can’t perform that action at this time.
0 commit comments