88
99#![ forbid( unsafe_code) ]
1010
11- use anyhow:: { anyhow , bail , Result } ;
11+ use anyhow:: { Result , anyhow , bail } ;
1212use authenticode:: {
1313 AttributeCertificateIterator , AuthenticodeSignature , PeTrait ,
1414} ;
@@ -162,10 +162,12 @@ mod tests {
162162 #[ test]
163163 fn test_action_info ( ) {
164164 // Error: bad path.
165- assert ! ( run_action( & Action :: Info {
166- pe_path: "../authenticode/tests/testdata/bad.efi" . into( ) ,
167- } )
168- . is_err( ) ) ;
165+ assert ! (
166+ run_action( & Action :: Info {
167+ pe_path: "../authenticode/tests/testdata/bad.efi" . into( ) ,
168+ } )
169+ . is_err( )
170+ ) ;
169171
170172 // Success, no signatures.
171173 run_action ( & Action :: Info {
@@ -189,36 +191,46 @@ mod tests {
189191 #[ test]
190192 fn test_action_get_cert ( ) {
191193 // Error: bad path.
192- assert ! ( run_action( & Action :: GetCert ( GetCertAction {
193- pe_path: "../authenticode/tests/testdata/bad.efi" . into( ) ,
194- sig_index: 0 ,
195- cert_index: 0 ,
196- } ) )
197- . is_err( ) ) ;
194+ assert ! (
195+ run_action( & Action :: GetCert ( GetCertAction {
196+ pe_path: "../authenticode/tests/testdata/bad.efi" . into( ) ,
197+ sig_index: 0 ,
198+ cert_index: 0 ,
199+ } ) )
200+ . is_err( )
201+ ) ;
198202
199203 // Error: no signatures.
200- assert ! ( run_action( & Action :: GetCert ( GetCertAction {
201- pe_path: "../authenticode/tests/testdata/tiny64.efi" . into( ) ,
202- sig_index: 0 ,
203- cert_index: 0 ,
204- } ) )
205- . is_err( ) ) ;
204+ assert ! (
205+ run_action( & Action :: GetCert ( GetCertAction {
206+ pe_path: "../authenticode/tests/testdata/tiny64.efi" . into( ) ,
207+ sig_index: 0 ,
208+ cert_index: 0 ,
209+ } ) )
210+ . is_err( )
211+ ) ;
206212
207213 // Error: invalid signature index.
208- assert ! ( run_action( & Action :: GetCert ( GetCertAction {
209- pe_path: "../authenticode/tests/testdata/tiny64.signed.efi" . into( ) ,
210- sig_index: 1 ,
211- cert_index: 0 ,
212- } ) )
213- . is_err( ) ) ;
214+ assert ! (
215+ run_action( & Action :: GetCert ( GetCertAction {
216+ pe_path: "../authenticode/tests/testdata/tiny64.signed.efi"
217+ . into( ) ,
218+ sig_index: 1 ,
219+ cert_index: 0 ,
220+ } ) )
221+ . is_err( )
222+ ) ;
214223
215224 // Error: invalid certificate index.
216- assert ! ( run_action( & Action :: GetCert ( GetCertAction {
217- pe_path: "../authenticode/tests/testdata/tiny64.signed.efi" . into( ) ,
218- sig_index: 0 ,
219- cert_index: 1 ,
220- } ) )
221- . is_err( ) ) ;
225+ assert ! (
226+ run_action( & Action :: GetCert ( GetCertAction {
227+ pe_path: "../authenticode/tests/testdata/tiny64.signed.efi"
228+ . into( ) ,
229+ sig_index: 0 ,
230+ cert_index: 1 ,
231+ } ) )
232+ . is_err( )
233+ ) ;
222234
223235 // Success, 32-bit.
224236 run_action ( & Action :: GetCert ( GetCertAction {
0 commit comments