Skip to content

Commit

Permalink
Fix #1834 CFE_TBL_Modified: Test CRC, updated flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pepepr08 committed Aug 24, 2021
1 parent 5e41330 commit 9b96246
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit 9b96246

Please sign in to comment.