@@ -49,11 +49,7 @@ static const ByteSpan kExpectedPaiPublicKey = DevelopmentCerts::kPaiPublicKey;
49
49
50
50
struct TestDeviceAttestationCredentials : public ::testing::Test
51
51
{
52
- static void SetUpTestSuite ()
53
- {
54
- CHIP_ERROR error = chip::Platform::MemoryInit ();
55
- EXPECT_EQ (error, CHIP_NO_ERROR);
56
- }
52
+ static void SetUpTestSuite () { ASSERT_EQ ([error](chip::Platform::MemoryInit ()), CHIP_NO_ERROR); }
57
53
static void TearDownTestSuite () { chip::Platform::MemoryShutdown (); }
58
54
};
59
55
@@ -71,7 +67,7 @@ TEST_F(TestDeviceAttestationCredentials, TestDACProvidersExample_Providers)
71
67
72
68
// Replace default provider with example provider
73
69
DeviceAttestationCredentialsProvider * example_dac_provider = Examples::GetExampleDACProvider ();
74
- EXPECT_NE (example_dac_provider, nullptr );
70
+ ASSERT_NE (example_dac_provider, nullptr );
75
71
EXPECT_NE (default_provider, example_dac_provider);
76
72
77
73
SetDeviceAttestationCredentialsProvider (example_dac_provider);
@@ -127,7 +123,7 @@ TEST_F(TestDeviceAttestationCredentials, TestDACProvidersExample_Signature)
127
123
0x26 , 0x27 , 0x30 , 0x31 , 0x32 , 0x33 , 0x34 , 0x35 , 0x36 , 0x37 };
128
124
129
125
DeviceAttestationCredentialsProvider * example_dac_provider = Examples::GetExampleDACProvider ();
130
- EXPECT_NE (example_dac_provider, nullptr );
126
+ ASSERT_NE (example_dac_provider, nullptr );
131
127
132
128
// Sign using the example attestation private key
133
129
P256ECDSASignature da_signature;
@@ -200,15 +196,15 @@ TEST_F(TestDeviceAttestationCredentials, TestDACVerifierExample_AttestationInfoV
200
196
201
197
// Make sure default verifier exists and is not implemented on at least one method
202
198
DeviceAttestationVerifier * default_verifier = GetDeviceAttestationVerifier ();
203
- EXPECT_NE (default_verifier, nullptr );
199
+ ASSERT_NE (default_verifier, nullptr );
204
200
205
201
AttestationVerificationResult attestationResult = AttestationVerificationResult::kSuccess ;
206
202
ByteSpan emptyByteSpan;
207
203
attestationResult = default_verifier->ValidateCertificationDeclarationSignature (ByteSpan (), emptyByteSpan);
208
204
EXPECT_EQ (attestationResult, AttestationVerificationResult::kNotImplemented );
209
205
210
206
DeviceAttestationVerifier * example_dac_verifier = GetDefaultDACVerifier (GetTestAttestationTrustStore ());
211
- EXPECT_NE (example_dac_verifier, nullptr );
207
+ ASSERT_NE (example_dac_verifier, nullptr );
212
208
EXPECT_NE (default_verifier, example_dac_verifier);
213
209
214
210
SetDeviceAttestationVerifier (example_dac_verifier);
@@ -267,7 +263,7 @@ TEST_F(TestDeviceAttestationCredentials, TestDACVerifierExample_CertDeclarationV
267
263
268
264
// Replace default verifier with example verifier
269
265
DeviceAttestationVerifier * example_dac_verifier = GetDefaultDACVerifier (GetTestAttestationTrustStore ());
270
- EXPECT_NE (example_dac_verifier, nullptr );
266
+ ASSERT_NE (example_dac_verifier, nullptr );
271
267
272
268
SetDeviceAttestationVerifier (example_dac_verifier);
273
269
DeviceAttestationVerifier * default_verifier = GetDeviceAttestationVerifier ();
@@ -344,7 +340,7 @@ TEST_F(TestDeviceAttestationCredentials, TestDACVerifierExample_NocsrInformation
344
340
0x8d , 0x85 , 0xfb , 0xd7 , 0xa0 , 0x7c , 0x8e , 0x83 , 0x7d , 0xa4 , 0xd5 , 0xa8 , 0xb9 };
345
341
346
342
DeviceAttestationVerifier * exampleDacVerifier = GetDefaultDACVerifier (GetTestAttestationTrustStore ());
347
- EXPECT_NE (exampleDacVerifier, nullptr );
343
+ ASSERT_NE (exampleDacVerifier, nullptr );
348
344
349
345
P256PublicKey dacPubkey;
350
346
EXPECT_EQ (sizeof (attestationPublicKey), dacPubkey.Length ());
@@ -392,7 +388,7 @@ TEST_F(TestDeviceAttestationCredentials, TestAttestationTrustStore)
392
388
};
393
389
394
390
const AttestationTrustStore * testAttestationTrustStore = GetTestAttestationTrustStore ();
395
- EXPECT_NE (testAttestationTrustStore, nullptr );
391
+ ASSERT_NE (testAttestationTrustStore, nullptr );
396
392
397
393
for (const auto & testCase : kTestCases )
398
394
{
0 commit comments