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 #1834 CFE_TBL_Modified: Test CRC, updated flag #1865

Merged
merged 1 commit into from
Aug 27, 2021
Merged
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
12 changes: 11 additions & 1 deletion modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2984,6 +2984,7 @@ void Test_CFE_TBL_TblMod(void)
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_Handle_t AccessIterator;
uint8 CDS_Data[sizeof(UT_Table1_t)];
uint32 ExpectedCrc;

UtPrintf("Begin Test Table Modified");

Expand Down Expand Up @@ -3104,10 +3105,19 @@ void Test_CFE_TBL_TblMod(void)
CFE_UtAssert_EVENTSENT(CFE_TBL_LOAD_SUCCESS_INF_EID);
CFE_UtAssert_EVENTCOUNT(1);

/* Notify Table Services that the table has been modified */
/*
* Notify Table Services that the table has been modified. Verify CRC has been
* calculated and table has been flagged as Updated
*/
ExpectedCrc = 0x0000F00D;
UT_SetDeferredRetcode(UT_KEY(CFE_ES_CalculateCRC), 1, ExpectedCrc);
CFE_TBL_Global.Handles[AccessIterator].Updated = false;
CFE_UtAssert_SUCCESS(CFE_TBL_Modified(App1TblHandle1));
UtAssert_BOOL_TRUE(CFE_TBL_Global.Handles[AccessIterator].Updated);
CFE_UtAssert_SUCCESS(CFE_TBL_GetInfo(&TblInfo1, "ut_cfe_tbl.UT_Table2"));
UtAssert_INT32_EQ(TblInfo1.TimeOfLastUpdate.Seconds, TblInfo1.TimeOfLastUpdate.Subseconds);
UtAssert_UINT32_EQ(TblInfo1.Crc, ExpectedCrc);
UtAssert_INT32_EQ(CFE_TBL_GetAddress((void **)&TblDataPtr, App1TblHandle1), CFE_TBL_INFO_UPDATED);

/*
* LastFileLoaded (limited by mission) can be bigger than MyFilename (limited by osal),
Expand Down