@@ -25,9 +25,9 @@ pub fn test_env(shell: &ScopedProtocol<Shell>) {
25
25
/* Test setting and getting a specific environment variable */
26
26
let cur_env_vec = shell. get_envs ( ) ;
27
27
let mut test_env_buf = [ 0u16 ; 32 ] ;
28
- let test_var = CStr16 :: from_str_with_buf ( "test_var" , & mut test_env_buf ) . unwrap ( ) ;
28
+ let test_var = cstr16 ! ( "test_var" ) ;
29
29
let mut test_val_buf = [ 0u16 ; 32 ] ;
30
- let test_val = CStr16 :: from_str_with_buf ( "test_val" , & mut test_val_buf ) . unwrap ( ) ;
30
+ let test_val = cstr16 ! ( "test_val" ) ;
31
31
assert ! ( shell. get_env( test_var) . is_none( ) ) ;
32
32
let status = shell. set_env ( test_var, test_val, false ) ;
33
33
assert_eq ! ( status, Status :: SUCCESS ) ;
@@ -56,7 +56,7 @@ pub fn test_env(shell: &ScopedProtocol<Shell>) {
56
56
assert_eq ! ( cur_env_vec. count( ) , default_len + 1 ) ;
57
57
58
58
/* Test deleting environment variable */
59
- let test_val = CStr16 :: from_str_with_buf ( "" , & mut test_val_buf ) . unwrap ( ) ;
59
+ let test_val = cstr16 ! ( "" ) ;
60
60
let status = shell. set_env ( test_var, test_val, false ) ;
61
61
assert_eq ! ( status, Status :: SUCCESS ) ;
62
62
assert ! ( shell. get_env( test_var) . is_none( ) ) ;
@@ -73,13 +73,13 @@ pub fn test_env(shell: &ScopedProtocol<Shell>) {
73
73
assert_eq ! ( cur_env_vec. count( ) , default_len) ;
74
74
}
75
75
76
- /// Test `` get_cur_dir()`` and `` set_cur_dir()` `
76
+ /// Test `get_cur_dir()` and `set_cur_dir()`
77
77
pub fn test_cur_dir( shell : & ScopedProtocol < Shell > ) {
78
78
let mut test_buf = [ 0u16 ; 128 ] ;
79
79
80
80
/* Test setting and getting current file system and current directory */
81
81
let mut fs_buf = [ 0u16 ; 16 ] ;
82
- let fs_var = CStr16 :: from_str_with_buf ( "fs0:" , & mut fs_buf ) . unwrap ( ) ;
82
+ let fs_var = cstr16! ( "fs0:" )
83
83
let mut dir_buf = [ 0u16 ; 32 ] ;
84
84
let dir_var = CStr16 :: from_str_with_buf( "/" , & mut dir_buf) . unwrap( ) ;
85
85
let status = shell. set_cur_dir( Some ( fs_var) , Some ( dir_var) ) ;
0 commit comments