Skip to content

Commit 15b7418

Browse files
test-runner: Test find_handles
This implicitly tests `locate_handle` as well.
1 parent 23a8525 commit 15b7418

File tree

1 file changed

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

1 file changed

+8
-3
lines changed

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

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ pub fn test(st: &SystemTable<Boot>) {
1515
info!("Testing boot services");
1616
memory::test(bt);
1717
misc::test(st);
18-
test_locate_handle_buffer(bt);
18+
test_locate_handles(bt);
1919
test_load_image(bt);
2020
}
2121

22-
fn test_locate_handle_buffer(bt: &BootServices) {
23-
info!("Testing the `locate_handle_buffer` function");
22+
fn test_locate_handles(bt: &BootServices) {
23+
info!("Testing the `locate_handle_buffer`/`find_handles` functions");
2424

2525
{
2626
// search all handles
@@ -51,6 +51,11 @@ fn test_locate_handle_buffer(bt: &BootServices) {
5151
*handles,
5252
*boot::locate_handle_buffer(SearchType::ByProtocol(&Output::GUID)).unwrap()
5353
);
54+
55+
// Compare with `boot::find_handles`. This implicitly tests
56+
// `boot::locate_handle` as well.
57+
let handles_vec = boot::find_handles::<Output>().unwrap();
58+
assert_eq!(*handles, handles_vec);
5459
}
5560
}
5661

0 commit comments

Comments
 (0)