diff --git a/uefi-test-runner/src/proto/mod.rs b/uefi-test-runner/src/proto/mod.rs index d40a11453..6348aac73 100644 --- a/uefi-test-runner/src/proto/mod.rs +++ b/uefi-test-runner/src/proto/mod.rs @@ -1,6 +1,6 @@ use uefi::prelude::*; use uefi::proto::loaded_image::LoadedImage; -use uefi::{proto, Identify}; +use uefi::{boot, proto, Identify}; pub fn test(st: &mut SystemTable) { info!("Testing various protocols"); @@ -10,6 +10,7 @@ pub fn test(st: &mut SystemTable) { let bt = st.boot_services(); find_protocol(bt); test_protocols_per_handle(bt); + test_protocols_per_handle_freestanding(); debug::test(bt); device_path::test(bt); @@ -55,6 +56,13 @@ fn test_protocols_per_handle(bt: &BootServices) { assert!(pph.iter().any(|guid| **guid == LoadedImage::GUID)); } +fn test_protocols_per_handle_freestanding() { + let pph = boot::protocols_per_handle(boot::image_handle()).unwrap(); + info!("Image handle has {} protocols", pph.len()); + // Check that one of the image's protocols is `LoadedImage`. + assert!(pph.iter().any(|guid| **guid == LoadedImage::GUID)); +} + mod console; mod debug; mod device_path;