Skip to content

Commit

Permalink
Fix nasa#2260, Convert CFE_TBL_INFO_TABLE_LOCKED into a negative erro…
Browse files Browse the repository at this point in the history
…r code
  • Loading branch information
thnkslprpt committed Mar 23, 2023
1 parent 7c03369 commit 368d222
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_content_access_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void TestReleaseAddress(void)
/* Attempt to load while address is locked */
LoadTable(&TestTable, CFE_SUCCESS);
UtAssert_INT32_EQ(CFE_TBL_GetAddress(&TblPtr, CFE_FT_Global.TblHandle), CFE_TBL_INFO_UPDATED);
LoadTable(&TestTable, CFE_TBL_INFO_TABLE_LOCKED);
LoadTable(&TestTable, CFE_TBL_ERR_TABLE_LOCKED);

/* Release and try again */
UtAssert_INT32_EQ(CFE_TBL_ReleaseAddress(CFE_FT_Global.TblHandle), CFE_SUCCESS);
Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ char *CFE_ES_StatusToString(CFE_Status_t status, CFE_StatusString_t *status_stri
* The calling Application tried to update a table that is locked by another user.
*
*/
#define CFE_TBL_INFO_TABLE_LOCKED ((CFE_Status_t)0x4c000018)
#define CFE_TBL_ERR_TABLE_LOCKED ((CFE_Status_t)0xcc000018)

/**
* Validation Pending
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/fsw/src/cfe_tbl_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ int32 CFE_TBL_UpdateInternal(CFE_TBL_Handle_t TblHandle, CFE_TBL_RegistryRec_t *

if (LockStatus)
{
Status = CFE_TBL_INFO_TABLE_LOCKED;
Status = CFE_TBL_ERR_TABLE_LOCKED;

CFE_ES_WriteToSysLog("%s: Unable to update locked table Handle=%d\n", __func__, TblHandle);
}
Expand Down
6 changes: 3 additions & 3 deletions modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2243,7 +2243,7 @@ void Test_CFE_TBL_Load(void)
/* c. Perform test */
UT_InitData();
UT_SetAppID(UT_TBL_APPID_1);
UtAssert_INT32_EQ(CFE_TBL_Load(App1TblHandle1, CFE_TBL_SRC_ADDRESS, &TestTable1), CFE_TBL_INFO_TABLE_LOCKED);
UtAssert_INT32_EQ(CFE_TBL_Load(App1TblHandle1, CFE_TBL_SRC_ADDRESS, &TestTable1), CFE_TBL_ERR_TABLE_LOCKED);
CFE_UtAssert_EVENTCOUNT(1);

/* d. Test cleanup */
Expand Down Expand Up @@ -2725,8 +2725,8 @@ void Test_CFE_TBL_Manage(void)

/* Configure table for update */
RegRecPtr->LoadPending = true;
UtAssert_INT32_EQ(CFE_TBL_Manage(App1TblHandle1), CFE_TBL_INFO_TABLE_LOCKED);
CFE_UtAssert_EVENTCOUNT(0);
UtAssert_INT32_EQ(CFE_TBL_Manage(App1TblHandle1), CFE_TBL_ERR_TABLE_LOCKED);
CFE_UtAssert_EVENTCOUNT(1);

/* Save the previous table's information for a subsequent test */
AccessDescPtr = &CFE_TBL_Global.Handles[App1TblHandle1];
Expand Down

0 comments on commit 368d222

Please sign in to comment.