Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1090, UT event check bounds #1091

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -399,6 +399,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