Skip to content

Commit

Permalink
Restyle and remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Nov 2, 2022
1 parent 8b3d1e3 commit 1851a4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/tests/TestReadInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,7 @@ void TestReadInteraction::TestReadShutdown(nlTestSuite * apSuite, void * apConte
for (auto & pClient : pClients)
{
pClient = Platform::New<app::ReadClient>(engine, &ctx.GetExchangeManager(), delegate,
chip::app::ReadClient::InteractionType::Subscribe);
chip::app::ReadClient::InteractionType::Subscribe);
}

//
Expand Down
6 changes: 2 additions & 4 deletions src/credentials/tests/TestChipCert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,18 @@ static void TestChipCert_CertValidation(nlTestSuite * inSuite, void * inContext)
{ TestCert::kNode01_01, sGenTBSHashFlag, sNullLoadFlag } } },
};
// clang-format on
static const size_t sNumValidationTestCases = ArraySize(sValidationTestCases);

for (const auto & testCase : sValidationTestCases)
{
const ChipCertificateData * resultCert = nullptr;
err = certSet.Init(kMaxCertsPerTestCase);
err = certSet.Init(kMaxCertsPerTestCase);
NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);

for (auto InputCert : testCase.InputCerts)
{
if (InputCert.Type != TestCert::kNone)
{
err = LoadTestCert(certSet, InputCert.Type, InputCert.LoadFlags,
InputCert.DecodeFlags);
err = LoadTestCert(certSet, InputCert.Type, InputCert.LoadFlags, InputCert.DecodeFlags);
NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/crypto/tests/TestGroupOperationalCredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ void TestDeriveGroupOperationalCredentials(nlTestSuite * apSuite, void * apConte
CHIP_NO_ERROR == Crypto::DeriveGroupOperationalCredentials(epochKey, kCompressedFabricId1, opCreds));

NL_TEST_ASSERT(apSuite, opCreds.hash == i.groupKeys->hash);
NL_TEST_ASSERT(apSuite,
0 == memcmp(opCreds.encryption_key, i.groupKeys->encryption_key, KEY_LENGTH));
NL_TEST_ASSERT(apSuite, 0 == memcmp(opCreds.encryption_key, i.groupKeys->encryption_key, KEY_LENGTH));
NL_TEST_ASSERT(apSuite, 0 == memcmp(opCreds.privacy_key, i.groupKeys->privacy_key, KEY_LENGTH));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ void TestDelete(nlTestSuite * inSuite, void * inContext)
for (auto & vector : vectors)
{
NL_TEST_ASSERT(inSuite,
sessionStorage.Save(vector.node, vector.resumptionId, sharedSecret, chip::CATValues{}) ==
CHIP_NO_ERROR);
sessionStorage.Save(vector.node, vector.resumptionId, sharedSecret, chip::CATValues{}) == CHIP_NO_ERROR);
}

// Delete values in turn from storage and verify they are removed.
Expand All @@ -315,11 +314,9 @@ void TestDelete(nlTestSuite * inSuite, void * inContext)
chip::CATValues outCats;
NL_TEST_ASSERT(inSuite, sessionStorage.Delete(vector.node) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite,
sessionStorage.FindByScopedNodeId(vector.node, outResumptionId, outSharedSecret, outCats) !=
CHIP_NO_ERROR);
sessionStorage.FindByScopedNodeId(vector.node, outResumptionId, outSharedSecret, outCats) != CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite,
sessionStorage.FindByResumptionId(vector.resumptionId, outNode, outSharedSecret, outCats) !=
CHIP_NO_ERROR);
sessionStorage.FindByResumptionId(vector.resumptionId, outNode, outSharedSecret, outCats) != CHIP_NO_ERROR);
}

// Verify no state or link table persistent storage entries were leaked.
Expand Down

0 comments on commit 1851a4b

Please sign in to comment.