Skip to content

Commit

Permalink
Fix #217, Convert remaining int32 CFE status variables to `CFE_Stat…
Browse files Browse the repository at this point in the history
…us_t`
  • Loading branch information
thnkslprpt committed Dec 2, 2023
1 parent 0d0cad0 commit 6bf6b80
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 20 deletions.
7 changes: 3 additions & 4 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SAMPLE_APP_Data_t SAMPLE_APP_Data;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
void SAMPLE_APP_Main(void)
{
int32 status;
CFE_Status_t status;
CFE_SB_Buffer_t *SBBufPtr;

/*
Expand Down Expand Up @@ -107,9 +107,9 @@ void SAMPLE_APP_Main(void)
/* Initialization */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
int32 SAMPLE_APP_Init(void)
CFE_Status_t SAMPLE_APP_Init(void)

Check notice

Code scanning / CodeQL-coding-standard

Function too long Note

SAMPLE_APP_Init has too many lines (89, while 60 are allowed).

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
{
int32 status;
CFE_Status_t status;

/* Zero out the global data structure */
memset(&SAMPLE_APP_Data, 0, sizeof(SAMPLE_APP_Data));
Expand Down Expand Up @@ -172,7 +172,6 @@ int32 SAMPLE_APP_Init(void)
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08lX\n", (unsigned long)status);
}

}

if (status == CFE_SUCCESS)
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extern SAMPLE_APP_Data_t SAMPLE_APP_Data;
** Note: Except for the entry point (SAMPLE_APP_Main), these
** functions are not called from any other source module.
*/
void SAMPLE_APP_Main(void);
int32 SAMPLE_APP_Init(void);
void SAMPLE_APP_Main(void);
CFE_Status_t SAMPLE_APP_Init(void);

#endif /* SAMPLE_APP_H */
2 changes: 1 addition & 1 deletion fsw/src/sample_app_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Ms
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
{
int32 status;
CFE_Status_t status;
void * TblAddr;
SAMPLE_APP_ExampleTable_t *TblPtr;
const char * TableName = "SAMPLE_APP.ExampleTable";
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/sample_app_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
/* Verify contents of First Example Table buffer contents */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 SAMPLE_APP_TblValidationFunc(void *TblData)
CFE_Status_t SAMPLE_APP_TblValidationFunc(void *TblData)
{
int32 ReturnCode = CFE_SUCCESS;
CFE_Status_t ReturnCode = CFE_SUCCESS;
SAMPLE_APP_ExampleTable_t *TblDataPtr = (SAMPLE_APP_ExampleTable_t *)TblData;

/*
Expand All @@ -58,7 +58,7 @@ int32 SAMPLE_APP_TblValidationFunc(void *TblData)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void SAMPLE_APP_GetCrc(const char *TableName)
{
int32 status;
CFE_Status_t status;
uint32 Crc;
CFE_TBL_Info_t TblInfoPtr;

Expand Down
4 changes: 2 additions & 2 deletions fsw/src/sample_app_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
#include "sample_app.h"

int32 SAMPLE_APP_TblValidationFunc(void *TblData);
void SAMPLE_APP_GetCrc(const char *TableName);
CFE_Status_t SAMPLE_APP_TblValidationFunc(void *TblData);
void SAMPLE_APP_GetCrc(const char *TableName);

#endif /* SAMPLE_APP_UTILS_H */
2 changes: 1 addition & 1 deletion unit-test/coveragetest/coveragetest_sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void Test_SAMPLE_APP_Init(void)
{
/*
* Test Case For:
* int32 SAMPLE_APP_Init( void )
* CFE_Status_t SAMPLE_APP_Init( void )
*/

/* nominal case should return CFE_SUCCESS */
Expand Down
2 changes: 1 addition & 1 deletion unit-test/coveragetest/coveragetest_sample_app_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void Test_SAMPLE_APP_TblValidationFunc(void)
{
/*
* Test Case For:
* int32 SAMPLE_APP_TblValidationFunc( void *TblData )
* CFE_Status_t SAMPLE_APP_TblValidationFunc( void *TblData )
*/
SAMPLE_APP_ExampleTable_t TestTblData;

Expand Down
6 changes: 3 additions & 3 deletions unit-test/stubs/sample_app_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
* Generated stub function for SAMPLE_APP_Init()
* ----------------------------------------------------
*/
int32 SAMPLE_APP_Init(void)
CFE_Status_t SAMPLE_APP_Init(void)
{
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_Init, int32);
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_Init, CFE_Status_t);

UT_GenStub_Execute(SAMPLE_APP_Init, Basic, NULL);

return UT_GenStub_GetReturnValue(SAMPLE_APP_Init, int32);
return UT_GenStub_GetReturnValue(SAMPLE_APP_Init, CFE_Status_t);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions unit-test/stubs/sample_app_utils_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ void SAMPLE_APP_GetCrc(const char *TableName)
* Generated stub function for SAMPLE_APP_TblValidationFunc()
* ----------------------------------------------------
*/
int32 SAMPLE_APP_TblValidationFunc(void *TblData)
CFE_Status_t SAMPLE_APP_TblValidationFunc(void *TblData)
{
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_TblValidationFunc, int32);
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_TblValidationFunc, CFE_Status_t);

UT_GenStub_AddParam(SAMPLE_APP_TblValidationFunc, void *, TblData);

UT_GenStub_Execute(SAMPLE_APP_TblValidationFunc, Basic, NULL);

return UT_GenStub_GetReturnValue(SAMPLE_APP_TblValidationFunc, int32);
return UT_GenStub_GetReturnValue(SAMPLE_APP_TblValidationFunc, CFE_Status_t);
}

0 comments on commit 6bf6b80

Please sign in to comment.