Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-apple committed Jul 23, 2021
1 parent 8534692 commit a2ef424
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/messaging/tests/TestReliableMessageProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ void CheckUnencryptedMessageReceiveFailure(nlTestSuite * inSuite, void * inConte
ExchangeContext * exchange = ctx.NewExchangeToPeer(&mockSender);
NL_TEST_ASSERT(inSuite, exchange != nullptr);

ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr();
ReliableMessageContext * rc = exchange->GetReliableMessageContext();
NL_TEST_ASSERT(inSuite, rm != nullptr);
NL_TEST_ASSERT(inSuite, rc != nullptr);

err = mockSender.mMessageDispatch.Init();
NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR);

Expand All @@ -460,6 +465,9 @@ void CheckUnencryptedMessageReceiveFailure(nlTestSuite * inSuite, void * inConte
// Test that the message was dropped by the receiver
NL_TEST_ASSERT(inSuite, !mockReceiver.IsOnMessageReceivedCalled);

// Since peer dropped the message, we might have pending acks. Let's clear the table
rm->ClearRetransTable(rc);

exchange->Close();
}

Expand Down

0 comments on commit a2ef424

Please sign in to comment.