Skip to content

Commit

Permalink
Merge pull request #1091 from jphickey/fix-1090-ut-eventcheck-bounds
Browse files Browse the repository at this point in the history
Fix #1090, UT event check bounds
  • Loading branch information
astrogeco committed Jan 21, 2021
2 parents 8559cf3 + ad9ae56 commit 0658a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fsw/cfe-core/unit-test/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2807,7 +2807,7 @@ void Test_CFE_TBL_Load(void)
RtnCode = CFE_TBL_Load(App1TblHandle2,
CFE_TBL_SRC_FILE,
"TblSrcFileName.dat");
EventsCorrect = (UT_EventIsInHistory(CFE_SUCCESS) == true &&
EventsCorrect = (UT_EventIsInHistory(CFE_TBL_LOAD_TBLNAME_MISMATCH_ERR_EID) == true &&
UT_GetNumEventsSent() == 1);
UT_Report(__FILE__, __LINE__,
RtnCode == CFE_TBL_ERR_FILE_FOR_WRONG_TABLE && EventsCorrect,
Expand Down Expand Up @@ -2846,7 +2846,7 @@ void Test_CFE_TBL_Load(void)
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(Test_CFE_TBL_ValidationFunc), 1, -1);
RtnCode = CFE_TBL_Load(App1TblHandle1, CFE_TBL_SRC_ADDRESS, &TestTable1);
EventsCorrect = (UT_EventIsInHistory(CFE_SUCCESS) == true &&
EventsCorrect = (UT_EventIsInHistory(CFE_TBL_VALIDATION_ERR_EID) == true &&
UT_GetNumEventsSent() == 1);
UT_Report(__FILE__, __LINE__,
RtnCode == -1 && EventsCorrect,
Expand All @@ -2859,7 +2859,7 @@ void Test_CFE_TBL_Load(void)
UT_InitData();
UT_SetDeferredRetcode(UT_KEY(Test_CFE_TBL_ValidationFunc), 1, 1);
RtnCode = CFE_TBL_Load(App1TblHandle1, CFE_TBL_SRC_ADDRESS, &TestTable1);
EventsCorrect = (UT_EventIsInHistory(CFE_SUCCESS) == true &&
EventsCorrect = (UT_EventIsInHistory(CFE_TBL_LOAD_VAL_ERR_EID) == true &&
UT_GetNumEventsSent() == 2);
UT_Report(__FILE__, __LINE__,
RtnCode == -1 && EventsCorrect,
Expand Down
1 change: 1 addition & 0 deletions fsw/cfe-core/unit-test/ut_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ static bool UT_CheckEventHistoryFromFunc(UT_EntryKey_t Func, uint16 EventIDToSea
UT_GetDataBuffer(Func, (void**)&EvBuf, &MaxSize, &Position);
if (EvBuf != NULL && MaxSize > 0)
{
Position /= sizeof(*EvBuf);
while (Position > 0)
{
if (*EvBuf == EventIDToSearchFor)
Expand Down

0 comments on commit 0658a01

Please sign in to comment.