@@ -17,7 +17,7 @@ pub fn test(st: &SystemTable<Boot>) {
17
17
memory:: test ( bt) ;
18
18
misc:: test ( st) ;
19
19
test_locate_handles ( bt) ;
20
- test_load_image ( bt ) ;
20
+ test_load_image ( ) ;
21
21
}
22
22
23
23
fn test_locate_handles ( bt : & BootServices ) {
@@ -65,15 +65,15 @@ fn test_locate_handles(bt: &BootServices) {
65
65
///
66
66
/// It transitively tests the protocol [`LoadedImageDevicePath`] which is
67
67
/// required as helper.
68
- fn test_load_image ( bt : & BootServices ) {
68
+ fn test_load_image ( ) {
69
69
/// The path of the loaded image executing this integration test.
70
70
const LOADED_IMAGE_PATH : & str = r"\EFI\BOOT\TEST_RUNNER.EFI" ;
71
71
72
72
info ! ( "Testing the `load_image` function" ) ;
73
73
74
- let image_device_path_protocol = bt
75
- . open_protocol_exclusive :: < LoadedImageDevicePath > ( bt . image_handle ( ) )
76
- . expect ( "should open LoadedImage protocol" ) ;
74
+ let image_device_path_protocol =
75
+ boot :: open_protocol_exclusive :: < LoadedImageDevicePath > ( boot :: image_handle ( ) )
76
+ . expect ( "should open LoadedImage protocol" ) ;
77
77
78
78
// Note: This is the full device path. The LoadedImage protocol would only
79
79
// provide us with the file-path portion of the device path.
@@ -95,7 +95,8 @@ fn test_load_image(bt: &BootServices) {
95
95
96
96
// Variant A: FromBuffer
97
97
{
98
- let fs = boot:: get_image_file_system ( bt. image_handle ( ) ) . expect ( "should open file system" ) ;
98
+ let fs =
99
+ boot:: get_image_file_system ( boot:: image_handle ( ) ) . expect ( "should open file system" ) ;
99
100
let path = CString16 :: try_from ( image_device_path_file_path. as_str ( ) ) . unwrap ( ) ;
100
101
let image_data = FileSystem :: new ( fs)
101
102
. read ( & * path)
@@ -104,17 +105,17 @@ fn test_load_image(bt: &BootServices) {
104
105
buffer : image_data. as_slice ( ) ,
105
106
file_path : None ,
106
107
} ;
107
- let loaded_image = bt
108
- . load_image ( bt. image_handle ( ) , load_source)
109
- . expect ( "should load image" ) ;
108
+ let loaded_image =
109
+ boot:: load_image ( boot:: image_handle ( ) , load_source) . expect ( "should load image" ) ;
110
110
111
111
log:: debug!( "load_image with FromBuffer strategy works" ) ;
112
112
113
113
// Check that the `LoadedImageDevicePath` protocol can be opened and
114
114
// that the interface data is `None`.
115
- let loaded_image_device_path = bt
116
- . open_protocol_exclusive :: < LoadedImageDevicePath > ( loaded_image)
117
- . expect ( "should open LoadedImageDevicePath protocol" ) ;
115
+ let loaded_image_device_path =
116
+ boot:: open_protocol_exclusive :: < LoadedImageDevicePath > ( loaded_image)
117
+ . expect ( "should open LoadedImageDevicePath protocol" ) ;
118
+ log:: info!( "bish 1" ) ;
118
119
assert ! ( loaded_image_device_path. get( ) . is_none( ) ) ;
119
120
}
120
121
// Variant B: FromDevicePath
@@ -123,9 +124,7 @@ fn test_load_image(bt: &BootServices) {
123
124
device_path : image_device_path,
124
125
boot_policy : BootPolicy :: ExactMatch ,
125
126
} ;
126
- let _ = bt
127
- . load_image ( bt. image_handle ( ) , load_source)
128
- . expect ( "should load image" ) ;
127
+ let _ = boot:: load_image ( boot:: image_handle ( ) , load_source) . expect ( "should load image" ) ;
129
128
130
129
log:: debug!( "load_image with FromFilePath strategy works" ) ;
131
130
}
0 commit comments