Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and mkardous-silabs committed Oct 5, 2023
1 parent 95dc127 commit 0a651e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/messaging/ExchangeContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext,
* If the call is not done, we will rely on information within the exchange context.
*
* @param shouldPeerBeActive true if the peer should be active, false if we don't know or it should not be
*/
*/
void SetShouldPeerBeActive(bool shouldPeerBeActive) { mFlags.Set(Flags::kPeerShouldBeActive, shouldPeerBeActive); }

/**
Expand Down
25 changes: 16 additions & 9 deletions src/messaging/tests/TestReliableMessageProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ class TestReliableMessageProtocol
static int InitializeTestCase(void * inContext);
};


void TestReliableMessageProtocol::CheckAddClearRetrans(nlTestSuite * inSuite, void * inContext)
{
TestContext & ctx = *reinterpret_cast<TestContext *>(inContext);
Expand Down Expand Up @@ -1856,25 +1855,33 @@ int TestReliableMessageProtocol::InitializeTestCase(void * inContext)

const nlTest sTests[] = {
NL_TEST_DEF("Test ReliableMessageMgr::CheckAddClearRetrans", TestReliableMessageProtocol::CheckAddClearRetrans),
NL_TEST_DEF("Test ReliableMessageMgr::CheckResendApplicationMessage", TestReliableMessageProtocol::CheckResendApplicationMessage),
NL_TEST_DEF("Test ReliableMessageMgr::CheckResendApplicationMessage",
TestReliableMessageProtocol::CheckResendApplicationMessage),
NL_TEST_DEF("Test ReliableMessageMgr::CheckCloseExchangeAndResendApplicationMessage",
TestReliableMessageProtocol::CheckCloseExchangeAndResendApplicationMessage),
NL_TEST_DEF("Test ReliableMessageMgr::CheckFailedMessageRetainOnSend",TestReliableMessageProtocol::CheckFailedMessageRetainOnSend),
NL_TEST_DEF("Test ReliableMessageMgr::CheckFailedMessageRetainOnSend",
TestReliableMessageProtocol::CheckFailedMessageRetainOnSend),
NL_TEST_DEF("Test ReliableMessageMgr::CheckResendApplicationMessageWithPeerExchange",
TestReliableMessageProtocol::CheckResendApplicationMessageWithPeerExchange),
NL_TEST_DEF("Test ReliableMessageMgr::CheckResendSessionEstablishmentMessageWithPeerExchange",
TestReliableMessageProtocol::CheckResendSessionEstablishmentMessageWithPeerExchange),
NL_TEST_DEF("Test ReliableMessageMgr::CheckDuplicateMessage", TestReliableMessageProtocol::CheckDuplicateMessage),
NL_TEST_DEF("Test ReliableMessageMgr::CheckDuplicateMessageClosedExchange", TestReliableMessageProtocol::CheckDuplicateMessageClosedExchange),
NL_TEST_DEF("Test ReliableMessageMgr::CheckDuplicateOldMessageClosedExchange", TestReliableMessageProtocol::CheckDuplicateOldMessageClosedExchange),
NL_TEST_DEF("Test that a reply after a standalone ack comes through correctly", TestReliableMessageProtocol::CheckReceiveAfterStandaloneAck),
NL_TEST_DEF("Test ReliableMessageMgr::CheckDuplicateMessageClosedExchange",
TestReliableMessageProtocol::CheckDuplicateMessageClosedExchange),
NL_TEST_DEF("Test ReliableMessageMgr::CheckDuplicateOldMessageClosedExchange",
TestReliableMessageProtocol::CheckDuplicateOldMessageClosedExchange),
NL_TEST_DEF("Test that a reply after a standalone ack comes through correctly",
TestReliableMessageProtocol::CheckReceiveAfterStandaloneAck),
NL_TEST_DEF("Test that a reply to a non-MRP message piggybacks an ack if there were MRP things happening on the context before",
TestReliableMessageProtocol::CheckPiggybackAfterPiggyback),
NL_TEST_DEF("Test sending an unsolicited ack-soliciting 'standalone ack' message", TestReliableMessageProtocol::CheckSendUnsolicitedStandaloneAckMessage),
NL_TEST_DEF("Test ReliableMessageMgr::CheckSendStandaloneAckMessage", TestReliableMessageProtocol::CheckSendStandaloneAckMessage),
NL_TEST_DEF("Test sending an unsolicited ack-soliciting 'standalone ack' message",
TestReliableMessageProtocol::CheckSendUnsolicitedStandaloneAckMessage),
NL_TEST_DEF("Test ReliableMessageMgr::CheckSendStandaloneAckMessage",
TestReliableMessageProtocol::CheckSendStandaloneAckMessage),
NL_TEST_DEF("Test command, response, default response, with receiver closing exchange after sending response",
TestReliableMessageProtocol::CheckMessageAfterClosed),
NL_TEST_DEF("Test that unencrypted message is dropped if exchange requires encryption", TestReliableMessageProtocol::CheckUnencryptedMessageReceiveFailure),
NL_TEST_DEF("Test that unencrypted message is dropped if exchange requires encryption",
TestReliableMessageProtocol::CheckUnencryptedMessageReceiveFailure),
NL_TEST_DEF("Test that dropping an application-level message with a piggyback ack works ok once both sides retransmit",
TestReliableMessageProtocol::CheckLostResponseWithPiggyback),
NL_TEST_DEF("Test that an application-level response-to-response after a lost standalone ack to the initial message works",
Expand Down
6 changes: 4 additions & 2 deletions src/protocols/secure_channel/CASESession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,8 @@ CHIP_ERROR CASESession::SendSigma3a()
SuccessOrExit(err = helper->ScheduleWork());
mSendSigma3Helper = helper;
mExchangeCtxt->WillSendMessage();
mExchangeCtxt->SetShouldPeerBeActive(true); // When we send sigma3, peer has processed sigma 1 and sent sigma2 which means it is active
mExchangeCtxt->SetShouldPeerBeActive(
true); // When we send sigma3, peer has processed sigma 1 and sent sigma2 which means it is active
mState = State::kSendSigma3Pending;
}
else
Expand Down Expand Up @@ -1704,7 +1705,8 @@ CHIP_ERROR CASESession::HandleSigma3a(System::PacketBufferHandle && msg)
SuccessOrExit(err = helper->ScheduleWork());
mHandleSigma3Helper = helper;
mExchangeCtxt->WillSendMessage();
mExchangeCtxt->SetShouldPeerBeActive(true); // When we receive sigma3, peer has received and processed sigma2 which means it is active
mExchangeCtxt->SetShouldPeerBeActive(
true); // When we receive sigma3, peer has received and processed sigma2 which means it is active
mState = State::kHandleSigma3Pending;
}

Expand Down

0 comments on commit 0a651e2

Please sign in to comment.