Skip to content

Commit

Permalink
Fix nasa#467 Add missing test for CFE_ES_SysLogReadData
Browse files Browse the repository at this point in the history
  • Loading branch information
pepepr08 committed Jun 23, 2021
1 parent d6a5652 commit 6be5f10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/es/ut-coverage/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -4844,6 +4844,18 @@ void TestSysLog(void)
CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.BlockSize, 1);
UtAssert_ZERO(SysLogBuffer.SizeLeft);

/* Test case where calculated blocksize results in 0 */
ES_ResetUnitTest();
SysLogBuffer.EndIdx = 0;
SysLogBuffer.SizeLeft = 1;

CFE_ES_SysLogReadData(&SysLogBuffer);

UtAssert_UINT32_EQ(SysLogBuffer.EndIdx, 0);
CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.LastOffset, 0);
CFE_UtAssert_MEMOFFSET_EQ(SysLogBuffer.BlockSize, 0);
UtAssert_INT32_EQ(SysLogBuffer.SizeLeft, 1);

/* Test nominal flow through CFE_ES_SysLogDump
* with multiple reads and writes */
ES_ResetUnitTest();
Expand Down

0 comments on commit 6be5f10

Please sign in to comment.