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 #2260, Convert CFE_TBL_INFO_TABLE_LOCKED into a negative error code #2261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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