File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
uefi-test-runner/src/proto Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11use uefi:: prelude:: * ;
22use uefi:: proto:: loaded_image:: LoadedImage ;
3- use uefi:: { proto, Identify } ;
3+ use uefi:: { boot , proto, Identify } ;
44
55pub fn test ( st : & mut SystemTable < Boot > ) {
66 info ! ( "Testing various protocols" ) ;
@@ -10,6 +10,7 @@ pub fn test(st: &mut SystemTable<Boot>) {
1010 let bt = st. boot_services ( ) ;
1111 find_protocol ( bt) ;
1212 test_protocols_per_handle ( bt) ;
13+ test_protocols_per_handle_freestanding ( ) ;
1314
1415 debug:: test ( bt) ;
1516 device_path:: test ( bt) ;
@@ -55,6 +56,13 @@ fn test_protocols_per_handle(bt: &BootServices) {
5556 assert ! ( pph. iter( ) . any( |guid| * * guid == LoadedImage :: GUID ) ) ;
5657}
5758
59+ fn test_protocols_per_handle_freestanding ( ) {
60+ let pph = boot:: protocols_per_handle ( boot:: image_handle ( ) ) . unwrap ( ) ;
61+ info ! ( "Image handle has {} protocols" , pph. len( ) ) ;
62+ // Check that one of the image's protocols is `LoadedImage`.
63+ assert ! ( pph. iter( ) . any( |guid| * * guid == LoadedImage :: GUID ) ) ;
64+ }
65+
5866mod console;
5967mod debug;
6068mod device_path;
You can’t perform that action at this time.
0 commit comments