Skip to content

Commit

Permalink
Make test-only functions in ReliableMessageManager only be compiled f…
Browse files Browse the repository at this point in the history
…or tests. (#7053)
  • Loading branch information
bzbarsky-apple authored May 25, 2021
1 parent 53e7847 commit f95637b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/messaging/ReliableMessageMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ void ReliableMessageMgr::StopTimer()
mSystemLayer->CancelTimer(Timeout, this);
}

#if CHIP_CONFIG_TEST
int ReliableMessageMgr::TestGetCountRetransTable()
{
int count = 0;
Expand All @@ -516,6 +517,7 @@ int ReliableMessageMgr::TestGetCountRetransTable()

return count;
}
#endif // CHIP_CONFIG_TEST

} // namespace Messaging
} // namespace chip
2 changes: 2 additions & 0 deletions src/messaging/ReliableMessageMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ class ReliableMessageMgr
*/
void ExpireTicks();

#if CHIP_CONFIG_TEST
// Functions for testing
int TestGetCountRetransTable();
void TestSetIntervalShift(uint16_t value) { mTimerIntervalShift = value; }
#endif // CHIP_CONFIG_TEST

private:
BitMapObjectPool<ExchangeContext, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS> & mContextPool;
Expand Down

0 comments on commit f95637b

Please sign in to comment.