File tree 1 file changed +9
-0
lines changed
uefi-test-runner/src/boot
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>) {
18
18
test_timer ( bt) ;
19
19
info ! ( "Testing events..." ) ;
20
20
test_check_event_freestanding ( ) ;
21
+ test_timer_freestanding ( ) ;
21
22
test_event_callback ( bt) ;
22
23
test_callback_with_ctx ( bt) ;
23
24
info ! ( "Testing watchdog..." ) ;
@@ -48,6 +49,14 @@ fn test_check_event_freestanding() {
48
49
assert ! ( !is_signaled) ;
49
50
}
50
51
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
+
51
60
fn test_timer ( bt : & BootServices ) {
52
61
let timer_event = unsafe { bt. create_event ( EventType :: TIMER , Tpl :: APPLICATION , None , None ) }
53
62
. expect ( "Failed to create TIMER event" ) ;
You can’t perform that action at this time.
0 commit comments