Skip to content

Commit df262ab

Browse files
test-runner: Assert that the firmware is EDK II
1 parent 15f10d3 commit df262ab

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

uefi-test-runner/src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate log;
88
#[macro_use]
99
extern crate alloc;
1010

11-
use alloc::string::String;
11+
use alloc::string::ToString;
1212
use uefi::prelude::*;
1313
use uefi::proto::console::serial::Serial;
1414
use uefi_services::{print, println};
@@ -24,10 +24,9 @@ fn efi_main(image: Handle, mut st: SystemTable<Boot>) -> Status {
2424

2525
// unit tests here
2626

27-
// output firmware-vendor (CStr16 to Rust string)
28-
let mut buf = String::new();
29-
st.firmware_vendor().as_str_in_buf(&mut buf).unwrap();
30-
info!("Firmware Vendor: {}", buf.as_str());
27+
let firmware_vendor = st.firmware_vendor();
28+
info!("Firmware Vendor: {}", firmware_vendor);
29+
assert_eq!(firmware_vendor.to_string(), "EDK II");
3130

3231
// Test print! and println! macros.
3332
let (print, println) = ("print!", "println!"); // necessary for clippy to ignore

0 commit comments

Comments
 (0)