3
3
use uefi:: boot:: ScopedProtocol ;
4
4
use uefi:: proto:: shell:: Shell ;
5
5
use uefi:: { boot, cstr16} ;
6
- use uefi_raw:: Status ;
7
6
8
7
/// Test `var()`, `vars()`, and `set_var()`
9
8
pub fn test_env ( shell : & ScopedProtocol < Shell > ) {
@@ -21,7 +20,7 @@ pub fn test_env(shell: &ScopedProtocol<Shell>) {
21
20
let test_val = cstr16 ! ( "test_val" ) ;
22
21
assert ! ( shell. var( test_var) . is_none( ) ) ;
23
22
let status = shell. set_var ( test_var, test_val, false ) ;
24
- assert_eq ! ( status, Status :: SUCCESS ) ;
23
+ assert ! ( status. is_ok ( ) ) ;
25
24
let cur_env_str = shell
26
25
. var ( test_var)
27
26
. expect ( "Could not get environment variable" ) ;
@@ -49,7 +48,7 @@ pub fn test_env(shell: &ScopedProtocol<Shell>) {
49
48
/* Test deleting environment variable */
50
49
let test_val = cstr16 ! ( "" ) ;
51
50
let status = shell. set_var ( test_var, test_val, false ) ;
52
- assert_eq ! ( status, Status :: SUCCESS ) ;
51
+ assert ! ( status. is_ok ( ) ) ;
53
52
assert ! ( shell. var( test_var) . is_none( ) ) ;
54
53
55
54
let cur_env_vec = shell. vars ( ) ;
@@ -70,7 +69,7 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
70
69
let fs_var = cstr16 ! ( "fs0:" ) ;
71
70
let dir_var = cstr16 ! ( "/" ) ;
72
71
let status = shell. set_current_dir ( Some ( fs_var) , Some ( dir_var) ) ;
73
- assert_eq ! ( status, Status :: SUCCESS ) ;
72
+ assert ! ( status. is_ok ( ) ) ;
74
73
75
74
let cur_fs_str = shell
76
75
. current_dir ( Some ( fs_var) )
@@ -82,7 +81,7 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
82
81
let fs_var = cstr16 ! ( "fs1:" ) ;
83
82
let dir_var = cstr16 ! ( "/" ) ;
84
83
let status = shell. set_current_dir ( Some ( fs_var) , Some ( dir_var) ) ;
85
- assert_eq ! ( status, Status :: SUCCESS ) ;
84
+ assert ! ( status. is_ok ( ) ) ;
86
85
87
86
let cur_fs_str = shell
88
87
. current_dir ( Some ( fs_var) )
@@ -95,7 +94,7 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
95
94
let fs_var = cstr16 ! ( "fs0:" ) ;
96
95
let dir_var = cstr16 ! ( "efi/" ) ;
97
96
let status = shell. set_current_dir ( Some ( fs_var) , Some ( dir_var) ) ;
98
- assert_eq ! ( status, Status :: SUCCESS ) ;
97
+ assert ! ( status. is_ok ( ) ) ;
99
98
100
99
let cur_fs_str = shell
101
100
. current_dir ( Some ( fs_var) )
@@ -113,7 +112,7 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
113
112
// Setting the current working file system and current working directory
114
113
let dir_var = cstr16 ! ( "fs0:/" ) ;
115
114
let status = shell. set_current_dir ( None , Some ( dir_var) ) ;
116
- assert_eq ! ( status, Status :: SUCCESS ) ;
115
+ assert ! ( status. is_ok ( ) ) ;
117
116
let cur_fs_str = shell
118
117
. current_dir ( Some ( fs_var) )
119
118
. expect ( "Could not get the current file system mapping" ) ;
@@ -128,7 +127,7 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
128
127
// Changing current working directory
129
128
let dir_var = cstr16 ! ( "/efi" ) ;
130
129
let status = shell. set_current_dir ( None , Some ( dir_var) ) ;
131
- assert_eq ! ( status, Status :: SUCCESS ) ;
130
+ assert ! ( status. is_ok ( ) ) ;
132
131
let cur_fs_str = shell
133
132
. current_dir ( Some ( fs_var) )
134
133
. expect ( "Could not get the current file system mapping" ) ;
@@ -143,7 +142,7 @@ pub fn test_cur_dir(shell: &ScopedProtocol<Shell>) {
143
142
let fs_var = cstr16 ! ( "fs0:" ) ;
144
143
let dir_var = cstr16 ! ( "efi/tools" ) ;
145
144
let status = shell. set_current_dir ( Some ( fs_var) , Some ( dir_var) ) ;
146
- assert_eq ! ( status, Status :: SUCCESS ) ;
145
+ assert ! ( status. is_ok ( ) ) ;
147
146
let cur_fs_str = shell
148
147
. current_dir ( None )
149
148
. expect ( "Could not get the current file system mapping" ) ;
0 commit comments