Skip to content

Commit 2988b71

Browse files
scholzpnicholasbishop
authored andcommitted
test-runner: Test LoadedImageDevicePath with null interface pointer
1 parent 911a049 commit 2988b71

File tree

1 file changed

+8
-1
lines changed
  • uefi-test-runner/src/boot

1 file changed

+8
-1
lines changed

uefi-test-runner/src/boot/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,18 @@ fn test_load_image(bt: &BootServices) {
8585
buffer: image_data.as_slice(),
8686
file_path: None,
8787
};
88-
let _ = bt
88+
let loaded_image = bt
8989
.load_image(bt.image_handle(), load_source)
9090
.expect("should load image");
9191

9292
log::debug!("load_image with FromBuffer strategy works");
93+
94+
// Check that the `LoadedImageDevicePath` protocol can be opened and
95+
// that the interface data is `None`.
96+
let loaded_image_device_path = bt
97+
.open_protocol_exclusive::<LoadedImageDevicePath>(loaded_image)
98+
.expect("should open LoadedImageDevicePath protocol");
99+
assert!(loaded_image_device_path.get().is_none());
93100
}
94101
// Variant B: FromDevicePath
95102
{

0 commit comments

Comments
 (0)