1
+ use uefi:: CStr16 ;
1
2
use uefi:: boot;
2
3
use uefi:: proto:: shell:: Shell ;
3
- use uefi:: CStr16 ;
4
4
use uefi_raw:: Status ;
5
5
6
6
pub fn test ( ) {
@@ -68,7 +68,9 @@ pub fn test() {
68
68
let status = shell. set_cur_dir ( Some ( fs_var) , Some ( dir_var) ) ;
69
69
assert_eq ! ( status, Status :: SUCCESS ) ;
70
70
71
- let cur_fs_str = shell. get_cur_dir ( Some ( fs_var) ) . expect ( "Could not get the current file system mapping" ) ;
71
+ let cur_fs_str = shell
72
+ . get_cur_dir ( Some ( fs_var) )
73
+ . expect ( "Could not get the current file system mapping" ) ;
72
74
let expected_fs_str = CStr16 :: from_str_with_buf ( "FS0:\\ " , & mut test_buf) . unwrap ( ) ;
73
75
assert_eq ! ( cur_fs_str, expected_fs_str) ;
74
76
@@ -77,7 +79,9 @@ pub fn test() {
77
79
let status = shell. set_cur_dir ( Some ( fs_var) , Some ( dir_var) ) ;
78
80
assert_eq ! ( status, Status :: SUCCESS ) ;
79
81
80
- let cur_fs_str = shell. get_cur_dir ( Some ( fs_var) ) . expect ( "Could not get the current file system mapping" ) ;
82
+ let cur_fs_str = shell
83
+ . get_cur_dir ( Some ( fs_var) )
84
+ . expect ( "Could not get the current file system mapping" ) ;
81
85
assert_ne ! ( cur_fs_str, expected_fs_str) ;
82
86
let expected_fs_str = CStr16 :: from_str_with_buf ( "FS1:\\ " , & mut test_buf) . unwrap ( ) ;
83
87
assert_eq ! ( cur_fs_str, expected_fs_str) ;
@@ -87,7 +91,9 @@ pub fn test() {
87
91
let status = shell. set_cur_dir ( Some ( fs_var) , Some ( dir_var) ) ;
88
92
assert_eq ! ( status, Status :: SUCCESS ) ;
89
93
90
- let cur_fs_str = shell. get_cur_dir ( Some ( fs_var) ) . expect ( "Could not get the current file system mapping" ) ;
94
+ let cur_fs_str = shell
95
+ . get_cur_dir ( Some ( fs_var) )
96
+ . expect ( "Could not get the current file system mapping" ) ;
91
97
assert_ne ! ( cur_fs_str, expected_fs_str) ;
92
98
let expected_fs_str = CStr16 :: from_str_with_buf ( "FS0:\\ efi" , & mut test_buf) . unwrap ( ) ;
93
99
assert_eq ! ( cur_fs_str, expected_fs_str) ;
@@ -96,17 +102,23 @@ pub fn test() {
96
102
let dir_var = CStr16 :: from_str_with_buf ( "fs0:/" , & mut dir_buf) . unwrap ( ) ;
97
103
let status = shell. set_cur_dir ( None , Some ( dir_var) ) ;
98
104
assert_eq ! ( status, Status :: SUCCESS ) ;
99
- let cur_fs_str = shell. get_cur_dir ( Some ( fs_var) ) . expect ( "Could not get the current file system mapping" ) ;
105
+ let cur_fs_str = shell
106
+ . get_cur_dir ( Some ( fs_var) )
107
+ . expect ( "Could not get the current file system mapping" ) ;
100
108
let expected_fs_str = CStr16 :: from_str_with_buf ( "FS0:" , & mut test_buf) . unwrap ( ) ;
101
109
assert_eq ! ( cur_fs_str, expected_fs_str) ;
102
110
103
- let cur_fs_str = shell. get_cur_dir ( None ) . expect ( "Could not get the current file system mapping" ) ;
111
+ let cur_fs_str = shell
112
+ . get_cur_dir ( None )
113
+ . expect ( "Could not get the current file system mapping" ) ;
104
114
assert_eq ! ( cur_fs_str, expected_fs_str) ;
105
115
106
116
let dir_var = CStr16 :: from_str_with_buf ( "/efi" , & mut dir_buf) . unwrap ( ) ;
107
117
let status = shell. set_cur_dir ( None , Some ( dir_var) ) ;
108
118
assert_eq ! ( status, Status :: SUCCESS ) ;
109
- let cur_fs_str = shell. get_cur_dir ( Some ( fs_var) ) . expect ( "Could not get the current file system mapping" ) ;
119
+ let cur_fs_str = shell
120
+ . get_cur_dir ( Some ( fs_var) )
121
+ . expect ( "Could not get the current file system mapping" ) ;
110
122
let expected_fs_str = CStr16 :: from_str_with_buf ( "FS0:\\ efi" , & mut test_buf) . unwrap ( ) ;
111
123
assert_eq ! ( cur_fs_str, expected_fs_str) ;
112
124
0 commit comments