Skip to content

Commit b9a3be8

Browse files
committed
Separating env tests into their own function
1 parent 572382e commit b9a3be8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use uefi::proto::shell::Shell;
55
use uefi::{CStr16, boot};
66
use uefi_raw::Status;
77

8-
/// Test ``get_cur_dir()`` and ``set_cur_dir()``
9-
pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
8+
/// Test ``get_env()`` and ``set_env()``
9+
pub fn test_env(shell: &ScopedProtocol<Shell>) {
1010
let mut test_buf = [0u16; 128];
1111

1212
/* Test retrieving list of environment variable names (null input) */
@@ -51,6 +51,11 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
5151
let status = shell.set_env(test_var, test_val, false);
5252
assert_eq!(status, Status::SUCCESS);
5353
assert!(shell.get_env(Some(test_var)).is_none());
54+
}
55+
56+
/// Test ``get_cur_dir()`` and ``set_cur_dir()``
57+
pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
58+
let mut test_buf = [0u16; 128];
5459

5560
/* Test setting and getting current file system and current directory */
5661
let mut fs_buf = [0u16; 16];
@@ -152,6 +157,7 @@ pub fn test() {
152157
let shell =
153158
boot::open_protocol_exclusive::<Shell>(handle).expect("Failed to open Shell protocol");
154159

160+
test_env(&shell);
155161
test_cur_dir(&shell);
156162

157163
// create some files

0 commit comments

Comments
 (0)