Skip to content

Commit

Permalink
Fix nasa#78, Align use of Table/Tbl mnemonics
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 28, 2022
1 parent a410436 commit 3b023b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int32 SAMPLE_APP_Init(void)
}
else
{
status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_TABLE_FILE);
status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_TBL_FILE);
}

CFE_EVS_SendEvent(SAMPLE_APP_STARTUP_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE App Initialized.%s",
Expand Down Expand Up @@ -352,7 +352,7 @@ int32 SAMPLE_APP_Process(const SAMPLE_APP_ProcessCmd_t *Msg)
{
int32 status;
SAMPLE_APP_Table_t *TblPtr;
const char * TableName = "SAMPLE_APP.SampleAppTable";
const char * TblName = "SAMPLE_APP.SampleAppTable";

/* Sample Use of Table */

Expand All @@ -366,7 +366,7 @@ int32 SAMPLE_APP_Process(const SAMPLE_APP_ProcessCmd_t *Msg)

CFE_ES_WriteToSysLog("Sample App: Table Value 1: %d Value 2: %d", TblPtr->Int1, TblPtr->Int2);

SAMPLE_APP_GetCrc(TableName);
SAMPLE_APP_GetCrc(TblName);

status = CFE_TBL_ReleaseAddress(SAMPLE_APP_Data.TblHandles[0]);
if (status != CFE_SUCCESS)
Expand Down Expand Up @@ -432,7 +432,7 @@ int32 SAMPLE_APP_TblValidationFunc(void *TblData)
if (TblDataPtr->Int1 > SAMPLE_APP_TBL_ELEMENT_1_MAX)
{
/* First element is out of range, return an appropriate error code */
ReturnCode = SAMPLE_APP_TABLE_OUT_OF_RANGE_ERR_CODE;
ReturnCode = SAMPLE_APP_TBL_OUT_OF_RANGE_ERR_CODE;
}

return ReturnCode;
Expand All @@ -443,13 +443,13 @@ int32 SAMPLE_APP_TblValidationFunc(void *TblData)
/* Output CRC */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void SAMPLE_APP_GetCrc(const char *TableName)
void SAMPLE_APP_GetCrc(const char *TblName)
{
int32 status;
uint32 Crc;
CFE_TBL_Info_t TblInfoPtr;

status = CFE_TBL_GetInfo(&TblInfoPtr, TableName);
status = CFE_TBL_GetInfo(&TblInfoPtr, TblName);
if (status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Sample App: Error Getting Table Info");
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
#define SAMPLE_APP_NUMBER_OF_TABLES 1 /* Number of Table(s) */

/* Define filenames of default data images for tables */
#define SAMPLE_APP_TABLE_FILE "/cf/sample_app_tbl.tbl"
#define SAMPLE_APP_TBL_FILE "/cf/sample_app_tbl.tbl"

#define SAMPLE_APP_TABLE_OUT_OF_RANGE_ERR_CODE -1
#define SAMPLE_APP_TBL_OUT_OF_RANGE_ERR_CODE -1

#define SAMPLE_APP_TBL_ELEMENT_1_MAX 10
/************************************************************************
Expand Down Expand Up @@ -103,7 +103,7 @@ int32 SAMPLE_APP_ReportHousekeeping(const CFE_MSG_CommandHeader_t *Msg);
int32 SAMPLE_APP_ResetCounters(const SAMPLE_APP_ResetCountersCmd_t *Msg);
int32 SAMPLE_APP_Process(const SAMPLE_APP_ProcessCmd_t *Msg);
int32 SAMPLE_APP_Noop(const SAMPLE_APP_NoopCmd_t *Msg);
void SAMPLE_APP_GetCrc(const char *TableName);
void SAMPLE_APP_GetCrc(const char *TblName);

int32 SAMPLE_APP_TblValidationFunc(void *TblData);

Expand Down
6 changes: 3 additions & 3 deletions unit-test/coveragetest/coveragetest_sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,16 +564,16 @@ void Test_SAMPLE_APP_TblValidationFunc(void)
/* nominal case (0) should succeed */
UtAssert_INT32_EQ(SAMPLE_APP_TblValidationFunc(&TestTblData), CFE_SUCCESS);

/* error case should return SAMPLE_APP_TABLE_OUT_OF_RANGE_ERR_CODE */
/* error case should return SAMPLE_APP_TBL_OUT_OF_RANGE_ERR_CODE */
TestTblData.Int1 = 1 + SAMPLE_APP_TBL_ELEMENT_1_MAX;
UtAssert_INT32_EQ(SAMPLE_APP_TblValidationFunc(&TestTblData), SAMPLE_APP_TABLE_OUT_OF_RANGE_ERR_CODE);
UtAssert_INT32_EQ(SAMPLE_APP_TblValidationFunc(&TestTblData), SAMPLE_APP_TBL_OUT_OF_RANGE_ERR_CODE);
}

void Test_SAMPLE_APP_GetCrc(void)
{
/*
* Test Case For:
* void SAMPLE_APP_GetCrc( const char *TableName )
* void SAMPLE_APP_GetCrc( const char *TblName )
*/

/*
Expand Down

0 comments on commit 3b023b8

Please sign in to comment.