mirror of
https://github.com/rust-osdev/uefi-rs
synced 2026-08-26 18:26:05 -04:00
test: extend coverage for str_to_fat()
Test for the recently fixed issue.
This commit is contained in:
parent
b91ec569ba
commit
8b051cae03
1 changed files with 9 additions and 0 deletions
|
|
@ -92,5 +92,14 @@ pub fn test() {
|
|||
uc.str_to_fat(s, &mut buf).unwrap(),
|
||||
CStr8::from_bytes_with_nul(b"HELLOWORLD!\0").unwrap()
|
||||
);
|
||||
|
||||
// The protocol writes only the converted characters (the space is
|
||||
// skipped) and no NUL terminator. Ensure stale buffer content
|
||||
// neither ends up in the result nor breaks its termination.
|
||||
let mut buf = [0xff; 13];
|
||||
assert_eq!(
|
||||
uc.str_to_fat(s, &mut buf).unwrap(),
|
||||
CStr8::from_bytes_with_nul(b"HELLOWORLD!\0").unwrap()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue