Skip to content

Commit 3afc0b8

Browse files
test-runner: Add test for boot::test_protocol
1 parent a7afe82 commit 3afc0b8

File tree

1 file changed

+12
-1
lines changed
  • uefi-test-runner/src/proto

1 file changed

+12
-1
lines changed

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use uefi::boot::{self, OpenProtocolParams};
12
use uefi::prelude::*;
23
use uefi::proto::loaded_image::LoadedImage;
3-
use uefi::{boot, proto, Identify};
4+
use uefi::{proto, Identify};
45

56
pub fn test(st: &mut SystemTable<Boot>) {
67
info!("Testing various protocols");
@@ -11,6 +12,7 @@ pub fn test(st: &mut SystemTable<Boot>) {
1112
find_protocol(bt);
1213
test_protocols_per_handle(bt);
1314
test_protocols_per_handle_freestanding();
15+
test_test_protocol_freestanding();
1416

1517
debug::test(bt);
1618
device_path::test(bt);
@@ -63,6 +65,15 @@ fn test_protocols_per_handle_freestanding() {
6365
assert!(pph.iter().any(|guid| **guid == LoadedImage::GUID));
6466
}
6567

68+
fn test_test_protocol_freestanding() {
69+
assert!(boot::test_protocol::<LoadedImage>(OpenProtocolParams {
70+
handle: boot::image_handle(),
71+
agent: boot::image_handle(),
72+
controller: None,
73+
})
74+
.unwrap());
75+
}
76+
6677
mod console;
6778
mod debug;
6879
mod device_path;

0 commit comments

Comments
 (0)