File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
uefi-test-runner/src/proto Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ pub fn test(image: Handle, st: &mut SystemTable<Boot>) {
20
20
network:: test ( bt) ;
21
21
pi:: test ( bt) ;
22
22
rng:: test ( bt) ;
23
+ shell_params:: test ( bt) ;
23
24
string:: test ( bt) ;
24
25
25
26
#[ cfg( any(
@@ -63,6 +64,7 @@ mod media;
63
64
mod network;
64
65
mod pi;
65
66
mod rng;
67
+ mod shell_params;
66
68
#[ cfg( any(
67
69
target_arch = "x86" ,
68
70
target_arch = "x86_64" ,
Original file line number Diff line number Diff line change
1
+ use uefi:: proto:: shell_params:: ShellParameters ;
2
+ use uefi:: table:: boot:: BootServices ;
3
+ use uefi:: CStr16 ;
4
+
5
+ pub fn test ( bt : & BootServices ) {
6
+ info ! ( "Running loaded image protocol test" ) ;
7
+
8
+ let image = bt
9
+ . get_handle_for_protocol :: < ShellParameters > ( )
10
+ . expect ( "No ShellParameters handles" ) ;
11
+ let shell_params = bt
12
+ . open_protocol_exclusive :: < ShellParameters > ( image)
13
+ . expect ( "Failed to open ShellParameters protocol" ) ;
14
+
15
+ info ! ( "Argc: {}" , shell_params. argc) ;
16
+ info ! ( "Args:" ) ;
17
+ for arg in shell_params. get_args_slice ( ) {
18
+ let arg_str = unsafe { CStr16 :: from_ptr ( * arg) } ;
19
+ info ! ( " '{}'" , arg_str) ;
20
+ }
21
+
22
+ assert_eq ! ( shell_params. argc, shell_params. get_args_slice( ) . len( ) ) ;
23
+
24
+ // Was run as: shell.efi test_runner.efi
25
+ assert_eq ! ( shell_params. argc, 2 ) ;
26
+ }
You can’t perform that action at this time.
0 commit comments