Skip to content

Commit

Permalink
test-runner: Test LoadedImageDevicePath with null interface pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Scholz authored and nicholasbishop committed Jun 17, 2023
1 parent 6a334c9 commit bef210b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion uefi-test-runner/src/boot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@ fn test_load_image(bt: &BootServices) {
buffer: image_data.as_slice(),
file_path: None,
};
let _ = bt
let loaded_image = bt
.load_image(bt.image_handle(), load_source)
.expect("should load image");

log::debug!("load_image with FromBuffer strategy works");

// Check that the `LoadedImageDevicePath` protocol can be opened and
// that the interface data is `None`.
let loaded_image_device_path = bt
.open_protocol_exclusive::<LoadedImageDevicePath>(loaded_image)
.expect("should open LoadedImageDevicePath protocol");
assert!(loaded_image_device_path.get().is_none());
}
// Variant B: FromDevicePath
{
Expand Down

0 comments on commit bef210b

Please sign in to comment.