File tree 1 file changed +9
-1
lines changed
uefi-test-runner/src/proto
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
use uefi:: prelude:: * ;
2
2
use uefi:: proto:: loaded_image:: LoadedImage ;
3
- use uefi:: { proto, Identify } ;
3
+ use uefi:: { boot , proto, Identify } ;
4
4
5
5
pub fn test ( st : & mut SystemTable < Boot > ) {
6
6
info ! ( "Testing various protocols" ) ;
@@ -10,6 +10,7 @@ pub fn test(st: &mut SystemTable<Boot>) {
10
10
let bt = st. boot_services ( ) ;
11
11
find_protocol ( bt) ;
12
12
test_protocols_per_handle ( bt) ;
13
+ test_protocols_per_handle_freestanding ( ) ;
13
14
14
15
debug:: test ( bt) ;
15
16
device_path:: test ( bt) ;
@@ -55,6 +56,13 @@ fn test_protocols_per_handle(bt: &BootServices) {
55
56
assert ! ( pph. iter( ) . any( |guid| * * guid == LoadedImage :: GUID ) ) ;
56
57
}
57
58
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
+
58
66
mod console;
59
67
mod debug;
60
68
mod device_path;
You can’t perform that action at this time.
0 commit comments