diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml new file mode 100644 index 0000000..4142b77 --- /dev/null +++ b/.github/workflows/add-to-project.yml @@ -0,0 +1,13 @@ +name: Add Issue or PR to Project + +on: + issues: + types: [opened] + pull_request_target: + types: [opened, ready_for_review, converted_to_draft] + +jobs: + add-to-project: + name: Add issue or pull request to project + uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build-run-app.yml b/.github/workflows/build-run-app.yml new file mode 100644 index 0000000..8f7aba1 --- /dev/null +++ b/.github/workflows/build-run-app.yml @@ -0,0 +1,23 @@ +name: Build and Run + +on: + push: + branches: + - dev + - main + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + schedule: + # 10:45 PM UTC every Sunday + - cron: '45 22 * * 0' +jobs: + build-run: + name: Build and run with startup msg verification + uses: nasa/cFS/.github/workflows/build-run-app-reusable.yml@dev + with: + dependency: nasa/sample_lib + app-entrypoint-suffix: Main \ No newline at end of file diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml index 78741ba..e9718f1 100644 --- a/.github/workflows/codeql-build.yml +++ b/.github/workflows/codeql-build.yml @@ -15,8 +15,9 @@ on: jobs: codeql: name: Codeql Analysis - uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main + uses: nasa/cFS/.github/workflows/codeql-reusable.yml@dev with: component-path: apps/sample_app prep: 'make prep; make -C build/tools/elf2cfetbl' make: 'make -C build/native/default_cpu1/apps/sample_app' + dependency: nasa/sample_lib diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 441199a..a47839d 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -2,13 +2,18 @@ name: Format Check # Run on all push and pull requests on: + push: + branches: + - dev + - main pull_request: types: - opened - reopened - synchronize + workflow_dispatch: jobs: format-check: name: Run format check - uses: nasa/cFS/.github/workflows/format-check.yml@main + uses: nasa/cFS/.github/workflows/format-check.yml@dev diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index ffe1ea2..9c279a0 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,5 +15,5 @@ on: jobs: static-analysis: - name: Run cppcheck - uses: nasa/cFS/.github/workflows/static-analysis.yml@main \ No newline at end of file + name: Static Analysis + uses: nasa/cFS/.github/workflows/app-static-analysis-reusable.yml@dev \ No newline at end of file diff --git a/.github/workflows/unit-test-coverage.yml b/.github/workflows/unit-test-coverage.yml new file mode 100644 index 0000000..e9178a0 --- /dev/null +++ b/.github/workflows/unit-test-coverage.yml @@ -0,0 +1,23 @@ +name: Unit Test and Coverage + +on: + push: + branches: + - dev + - main + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + schedule: + # 10:50 PM UTC every Sunday + - cron: '50 22 * * 0' + +jobs: + unit-test-coverage: + name: Run unit test and coverage + uses: nasa/cFS/.github/workflows/unit-test-coverage-reusable.yml@dev + with: + dependency: nasa/sample_lib \ No newline at end of file diff --git a/config/default_sample_app_msgdefs.h b/config/default_sample_app_msgdefs.h index 3cf27e4..533daa2 100644 --- a/config/default_sample_app_msgdefs.h +++ b/config/default_sample_app_msgdefs.h @@ -43,7 +43,6 @@ typedef struct SAMPLE_APP_HkTlm_Payload { uint8 CommandCounter; uint8 CommandErrorCounter; - uint8 spare[2]; } SAMPLE_APP_HkTlm_Payload_t; #endif diff --git a/fsw/src/sample_app.c b/fsw/src/sample_app.c index 01c3b85..b07a431 100644 --- a/fsw/src/sample_app.c +++ b/fsw/src/sample_app.c @@ -87,7 +87,8 @@ void SAMPLE_APP_Main(void) } else { - CFE_EVS_SendEvent(SAMPLE_APP_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(SAMPLE_APP_PIPE_ERR_EID, + CFE_EVS_EventType_ERROR, "SAMPLE APP: SB Pipe Read Error, App Will Exit"); SAMPLE_APP_Data.RunStatus = CFE_ES_RunStatus_APP_ERROR; @@ -130,18 +131,22 @@ CFE_Status_t SAMPLE_APP_Init(void) /* ** Initialize housekeeping packet (clear user data area). */ - CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader), CFE_SB_ValueToMsgId(SAMPLE_APP_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader), + CFE_SB_ValueToMsgId(SAMPLE_APP_HK_TLM_MID), sizeof(SAMPLE_APP_Data.HkTlm)); /* ** Create Software Bus message pipe. */ - status = CFE_SB_CreatePipe(&SAMPLE_APP_Data.CommandPipe, SAMPLE_APP_PLATFORM_PIPE_DEPTH, + status = CFE_SB_CreatePipe(&SAMPLE_APP_Data.CommandPipe, + SAMPLE_APP_PLATFORM_PIPE_DEPTH, SAMPLE_APP_PLATFORM_PIPE_NAME); if (status != CFE_SUCCESS) { - CFE_EVS_SendEvent(SAMPLE_APP_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, - "Sample App: Error creating SB Command Pipe, RC = 0x%08lX", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_CR_PIPE_ERR_EID, + CFE_EVS_EventType_ERROR, + "Sample App: Error creating SB Command Pipe, RC = 0x%08lX", + (unsigned long)status); } } @@ -153,8 +158,10 @@ CFE_Status_t SAMPLE_APP_Init(void) status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_SEND_HK_MID), SAMPLE_APP_Data.CommandPipe); if (status != CFE_SUCCESS) { - CFE_EVS_SendEvent(SAMPLE_APP_SUB_HK_ERR_EID, CFE_EVS_EventType_ERROR, - "Sample App: Error Subscribing to HK request, RC = 0x%08lX", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_SUB_HK_ERR_EID, + CFE_EVS_EventType_ERROR, + "Sample App: Error Subscribing to HK request, RC = 0x%08lX", + (unsigned long)status); } } @@ -166,8 +173,10 @@ CFE_Status_t SAMPLE_APP_Init(void) status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(SAMPLE_APP_CMD_MID), SAMPLE_APP_Data.CommandPipe); if (status != CFE_SUCCESS) { - CFE_EVS_SendEvent(SAMPLE_APP_SUB_CMD_ERR_EID, CFE_EVS_EventType_ERROR, - "Sample App: Error Subscribing to Commands, RC = 0x%08lX", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_SUB_CMD_ERR_EID, + CFE_EVS_EventType_ERROR, + "Sample App: Error Subscribing to Commands, RC = 0x%08lX", + (unsigned long)status); } } @@ -176,22 +185,33 @@ CFE_Status_t SAMPLE_APP_Init(void) /* ** Register Example Table(s) */ - status = CFE_TBL_Register(&SAMPLE_APP_Data.TblHandles[0], "ExampleTable", sizeof(SAMPLE_APP_ExampleTable_t), - CFE_TBL_OPT_DEFAULT, SAMPLE_APP_TblValidationFunc); + status = CFE_TBL_Register(&SAMPLE_APP_Data.TblHandles[0], + "ExampleTable", + sizeof(SAMPLE_APP_ExampleTable_t), + CFE_TBL_OPT_DEFAULT, + SAMPLE_APP_TblValidationFunc); if (status != CFE_SUCCESS) { - CFE_EVS_SendEvent(SAMPLE_APP_TABLE_REG_ERR_EID, CFE_EVS_EventType_ERROR, - "Sample App: Error Registering Example Table, RC = 0x%08lX", (unsigned long)status); + CFE_EVS_SendEvent(SAMPLE_APP_TABLE_REG_ERR_EID, + CFE_EVS_EventType_ERROR, + "Sample App: Error Registering Example Table, RC = 0x%08lX", + (unsigned long)status); } else { status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_PLATFORM_TABLE_FILE); } - CFE_Config_GetVersionString(VersionString, SAMPLE_APP_CFG_MAX_VERSION_STR_LEN, "Sample App", SAMPLE_APP_VERSION, - SAMPLE_APP_BUILD_CODENAME, SAMPLE_APP_LAST_OFFICIAL); + CFE_Config_GetVersionString(VersionString, + SAMPLE_APP_CFG_MAX_VERSION_STR_LEN, + "Sample App", + SAMPLE_APP_VERSION, + SAMPLE_APP_BUILD_CODENAME, + SAMPLE_APP_LAST_OFFICIAL); - CFE_EVS_SendEvent(SAMPLE_APP_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "Sample App Initialized.%s", + CFE_EVS_SendEvent(SAMPLE_APP_INIT_INF_EID, + CFE_EVS_EventType_INFORMATION, + "Sample App Initialized.%s", VersionString); } diff --git a/fsw/src/sample_app.h b/fsw/src/sample_app.h index 07a4b5b..ab85169 100644 --- a/fsw/src/sample_app.h +++ b/fsw/src/sample_app.h @@ -50,8 +50,8 @@ typedef struct /* ** Command interface counters... */ - uint8 CmdCounter; - uint8 ErrCounter; + uint8 CommandCounter; + uint8 CommandErrorCounter; /* ** Housekeeping telemetry packet... diff --git a/fsw/src/sample_app_cmds.c b/fsw/src/sample_app_cmds.c index b9d8da3..66bdc5d 100644 --- a/fsw/src/sample_app_cmds.c +++ b/fsw/src/sample_app_cmds.c @@ -51,8 +51,8 @@ CFE_Status_t SAMPLE_APP_SendHkCmd(const SAMPLE_APP_SendHkCmd_t *Msg) /* ** Get command execution counters... */ - SAMPLE_APP_Data.HkTlm.Payload.CommandErrorCounter = SAMPLE_APP_Data.ErrCounter; - SAMPLE_APP_Data.HkTlm.Payload.CommandCounter = SAMPLE_APP_Data.CmdCounter; + SAMPLE_APP_Data.HkTlm.Payload.CommandErrorCounter = SAMPLE_APP_Data.CommandErrorCounter; + SAMPLE_APP_Data.HkTlm.Payload.CommandCounter = SAMPLE_APP_Data.CommandCounter; /* ** Send housekeeping telemetry packet... @@ -78,9 +78,11 @@ CFE_Status_t SAMPLE_APP_SendHkCmd(const SAMPLE_APP_SendHkCmd_t *Msg) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg) { - SAMPLE_APP_Data.CmdCounter++; + SAMPLE_APP_Data.CommandCounter++; - CFE_EVS_SendEvent(SAMPLE_APP_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: NOOP command %s", + CFE_EVS_SendEvent(SAMPLE_APP_NOOP_INF_EID, + CFE_EVS_EventType_INFORMATION, + "SAMPLE: NOOP command %s", SAMPLE_APP_VERSION); return CFE_SUCCESS; @@ -95,8 +97,8 @@ CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Msg) { - SAMPLE_APP_Data.CmdCounter = 0; - SAMPLE_APP_Data.ErrCounter = 0; + SAMPLE_APP_Data.CommandCounter = 0; + SAMPLE_APP_Data.CommandErrorCounter = 0; CFE_EVS_SendEvent(SAMPLE_APP_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: RESET command"); @@ -112,12 +114,12 @@ CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Ms CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg) { CFE_Status_t Status; - void * TblAddr; + void *TblAddr; SAMPLE_APP_ExampleTable_t *TblPtr; - const char * TableName = "SAMPLE_APP.ExampleTable"; + const char *TableName = "SAMPLE_APP.ExampleTable"; /* Sample Use of Example Table */ - SAMPLE_APP_Data.CmdCounter++; + SAMPLE_APP_Data.CommandCounter++; Status = CFE_TBL_GetAddress(&TblAddr, SAMPLE_APP_Data.TblHandles[0]); if (Status < CFE_SUCCESS) { @@ -152,10 +154,13 @@ CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ CFE_Status_t SAMPLE_APP_DisplayParamCmd(const SAMPLE_APP_DisplayParamCmd_t *Msg) { - SAMPLE_APP_Data.CmdCounter++; - CFE_EVS_SendEvent(SAMPLE_APP_VALUE_INF_EID, CFE_EVS_EventType_INFORMATION, - "SAMPLE_APP: ValU32=%lu, ValI16=%d, ValStr=%s", (unsigned long)Msg->Payload.ValU32, - (int)Msg->Payload.ValI16, Msg->Payload.ValStr); + SAMPLE_APP_Data.CommandCounter++; + CFE_EVS_SendEvent(SAMPLE_APP_VALUE_INF_EID, + CFE_EVS_EventType_INFORMATION, + "SAMPLE_APP: ValU32=%lu, ValI16=%d, ValStr=%s", + (unsigned long)Msg->Payload.ValU32, + (int)Msg->Payload.ValI16, + Msg->Payload.ValStr); return CFE_SUCCESS; } diff --git a/fsw/src/sample_app_cmds.h b/fsw/src/sample_app_cmds.h index 44f74ae..2e6bbe8 100644 --- a/fsw/src/sample_app_cmds.h +++ b/fsw/src/sample_app_cmds.h @@ -31,9 +31,9 @@ #include "sample_app_msg.h" CFE_Status_t SAMPLE_APP_SendHkCmd(const SAMPLE_APP_SendHkCmd_t *Msg); +CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg); CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Msg); CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg); -CFE_Status_t SAMPLE_APP_NoopCmd(const SAMPLE_APP_NoopCmd_t *Msg); CFE_Status_t SAMPLE_APP_DisplayParamCmd(const SAMPLE_APP_DisplayParamCmd_t *Msg); #endif /* SAMPLE_APP_CMDS_H */ diff --git a/fsw/src/sample_app_dispatch.c b/fsw/src/sample_app_dispatch.c index 0e4de94..a06988a 100644 --- a/fsw/src/sample_app_dispatch.c +++ b/fsw/src/sample_app_dispatch.c @@ -53,14 +53,17 @@ bool SAMPLE_APP_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t Expected CFE_MSG_GetMsgId(MsgPtr, &MsgId); CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); - CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID, + CFE_EVS_EventType_ERROR, "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, + (unsigned int)CFE_SB_MsgIdToValue(MsgId), + (unsigned int)FcnCode, + (unsigned int)ActualLength, (unsigned int)ExpectedLength); result = false; - SAMPLE_APP_Data.ErrCounter++; + SAMPLE_APP_Data.CommandErrorCounter++; } return result; @@ -110,9 +113,10 @@ void SAMPLE_APP_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr) } break; - /* default case already found during FC vs length test */ default: - CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid ground command code: CC = %d", + CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, + CFE_EVS_EventType_ERROR, + "Invalid ground command code: CC = %d", CommandCode); break; } @@ -155,7 +159,9 @@ void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) else { /* Unknown command */ - CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID, CFE_EVS_EventType_ERROR, "SAMPLE: invalid command packet,MID = 0x%x", + CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID, + CFE_EVS_EventType_ERROR, + "SAMPLE: invalid command packet,MID = 0x%x", (unsigned int)CFE_SB_MsgIdToValue(MsgId)); } } diff --git a/fsw/src/sample_app_dispatch.h b/fsw/src/sample_app_dispatch.h index 41a7fa3..701b825 100644 --- a/fsw/src/sample_app_dispatch.h +++ b/fsw/src/sample_app_dispatch.h @@ -31,8 +31,8 @@ #include "cfe.h" #include "sample_app_msg.h" -void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr); -void SAMPLE_APP_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr); bool SAMPLE_APP_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength); +void SAMPLE_APP_ProcessGroundCommand(const CFE_SB_Buffer_t *SBBufPtr); +void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr); #endif /* SAMPLE_APP_DISPATCH_H */ diff --git a/fsw/src/sample_app_eds_dispatch.c b/fsw/src/sample_app_eds_dispatch.c index 73a0767..1f73477 100644 --- a/fsw/src/sample_app_eds_dispatch.c +++ b/fsw/src/sample_app_eds_dispatch.c @@ -38,7 +38,7 @@ * Define a lookup table for SAMPLE app command codes */ /* clang-format off */ -static const EdsDispatchTable_EdsComponent_SAMPLE_APP_Application_CFE_SB_Telecommand_t SAMPLE_TC_DISPATCH_TABLE = +static const EdsDispatchTable_EdsComponent_SAMPLE_APP_Application_CFE_SB_Telecommand_t SAMPLE_TC_DISPATCH_TABLE = { .CMD = { @@ -75,23 +75,30 @@ void SAMPLE_APP_TaskPipe(const CFE_SB_Buffer_t *SBBufPtr) CFE_MSG_GetMsgId(&SBBufPtr->Msg, &MsgId); CFE_MSG_GetSize(&SBBufPtr->Msg, &MsgSize); CFE_MSG_GetFcnCode(&SBBufPtr->Msg, &MsgFc); - ++SAMPLE_APP_Data.ErrCounter; + ++SAMPLE_APP_Data.CommandErrorCounter; if (Status == CFE_STATUS_UNKNOWN_MSG_ID) { - CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID, CFE_EVS_EventType_ERROR, - "SAMPLE: invalid command packet,MID = 0x%x", (unsigned int)CFE_SB_MsgIdToValue(MsgId)); + CFE_EVS_SendEvent(SAMPLE_APP_MID_ERR_EID, + CFE_EVS_EventType_ERROR, + "SAMPLE: invalid command packet,MID = 0x%x", + (unsigned int)CFE_SB_MsgIdToValue(MsgId)); } else if (Status == CFE_STATUS_WRONG_MSG_LENGTH) { - CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(SAMPLE_APP_CMD_LEN_ERR_EID, + CFE_EVS_EventType_ERROR, "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u", - (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)MsgFc, (unsigned int)MsgSize); + (unsigned int)CFE_SB_MsgIdToValue(MsgId), + (unsigned int)MsgFc, + (unsigned int)MsgSize); } else { - CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, CFE_EVS_EventType_ERROR, - "SAMPLE: Invalid ground command code: CC = %d", (int)MsgFc); + CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, + CFE_EVS_EventType_ERROR, + "SAMPLE: Invalid ground command code: CC = %d", + (int)MsgFc); } } } diff --git a/fsw/src/sample_app_version.h b/fsw/src/sample_app_version.h index 4b45567..7236846 100644 --- a/fsw/src/sample_app_version.h +++ b/fsw/src/sample_app_version.h @@ -27,17 +27,18 @@ /* Development Build Macro Definitions */ -#define SAMPLE_APP_BUILD_NUMBER 0 -#define SAMPLE_APP_BUILD_BASELINE "v7.0.0" /*!< Development Build: git tag that is the base for the current development */ +#define SAMPLE_APP_BUILD_NUMBER 0 +#define SAMPLE_APP_BUILD_BASELINE \ + "v7.0.0" /*!< Development Build: git tag that is the base for the current development */ #define SAMPLE_APP_BUILD_DEV_CYCLE "v7.0.0" /**< @brief Development: Release name for current development cycle */ -#define SAMPLE_APP_BUILD_CODENAME "Draco" /**< @brief: Development: Code name for the current build */ +#define SAMPLE_APP_BUILD_CODENAME "Draco" /**< @brief: Development: Code name for the current build */ /* * Version Macros, see \ref cfsversions for definitions. */ -#define SAMPLE_APP_MAJOR_VERSION 7 /*!< @brief Major version number. */ -#define SAMPLE_APP_MINOR_VERSION 0 /*!< @brief Minor version number. */ -#define SAMPLE_APP_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/ +#define SAMPLE_APP_MAJOR_VERSION 7 /*!< @brief Major version number. */ +#define SAMPLE_APP_MINOR_VERSION 0 /*!< @brief Minor version number. */ +#define SAMPLE_APP_REVISION 0 /*!< @brief Revision version number. Value of 0 indicates a development version.*/ /** * @brief Last official release. @@ -65,9 +66,9 @@ /** * @brief Max Version String length. - * + * * Maximum length that an OSAL version string can be. - * + * */ #define SAMPLE_APP_CFG_MAX_VERSION_STR_LEN 256 diff --git a/fsw/tables/sample_app_tbl.c b/fsw/tables/sample_app_tbl.c index 4a53ac8..1262584 100644 --- a/fsw/tables/sample_app_tbl.c +++ b/fsw/tables/sample_app_tbl.c @@ -23,7 +23,7 @@ ** The following is an example of the declaration statement that defines the desired ** contents of the table image. */ -SAMPLE_APP_ExampleTable_t ExampleTable = {1, 2}; +SAMPLE_APP_ExampleTable_t ExampleTable = { 1, 2 }; /* ** The macro below identifies: diff --git a/unit-test/common/eventcheck.c b/unit-test/common/eventcheck.c index 4d2b89a..6ce167e 100644 --- a/unit-test/common/eventcheck.c +++ b/unit-test/common/eventcheck.c @@ -47,12 +47,12 @@ /* * An example hook function to check for a specific event. */ -static int32 UT_CheckEvent_Hook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context, - va_list va) +static int32 +UT_CheckEvent_Hook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context, va_list va) { UT_CheckEvent_t *State = UserObj; uint16 EventId; - const char * Spec; + const char *Spec; /* * The CFE_EVS_SendEvent stub passes the EventID as the @@ -110,8 +110,10 @@ static int32 UT_CheckEvent_Hook(void *UserObj, int32 StubRetcode, uint32 CallCou * Helper function to set up for event checking * This attaches the hook function to CFE_EVS_SendEvent */ -void UT_CheckEvent_Setup_Impl(UT_CheckEvent_t *Evt, uint16 ExpectedEvent, const char *EventName, - const char *ExpectedFormat) +void UT_CheckEvent_Setup_Impl(UT_CheckEvent_t *Evt, + uint16 ExpectedEvent, + const char *EventName, + const char *ExpectedFormat) { if (ExpectedFormat == NULL) { diff --git a/unit-test/common/eventcheck.h b/unit-test/common/eventcheck.h index 793862d..7d73c14 100644 --- a/unit-test/common/eventcheck.h +++ b/unit-test/common/eventcheck.h @@ -58,7 +58,9 @@ typedef struct * Helper function to set up for event checking * This attaches the hook function to CFE_EVS_SendEvent */ -void UT_CheckEvent_Setup_Impl(UT_CheckEvent_t *Evt, uint16 ExpectedEvent, const char *EventName, - const char *ExpectedFormat); +void UT_CheckEvent_Setup_Impl(UT_CheckEvent_t *Evt, + uint16 ExpectedEvent, + const char *EventName, + const char *ExpectedFormat); #endif diff --git a/unit-test/common/setup.c b/unit-test/common/setup.c index 7fb7b73..bbca5ed 100644 --- a/unit-test/common/setup.c +++ b/unit-test/common/setup.c @@ -52,4 +52,6 @@ void Sample_UT_Setup(void) /* * Teardown function after every test */ -void Sample_UT_TearDown(void) {} +void Sample_UT_TearDown(void) +{ +} diff --git a/unit-test/coveragetest/coveragetest_sample_app_cmds.c b/unit-test/coveragetest/coveragetest_sample_app_cmds.c index 57fa2d0..3bbb910 100644 --- a/unit-test/coveragetest/coveragetest_sample_app_cmds.c +++ b/unit-test/coveragetest/coveragetest_sample_app_cmds.c @@ -131,7 +131,7 @@ void Test_SAMPLE_APP_ProcessCmd(void) */ SAMPLE_APP_ProcessCmd_t TestMsg; SAMPLE_APP_ExampleTable_t TestTblData; - void * TblPtr = &TestTblData; + void *TblPtr = &TestTblData; memset(&TestTblData, 0, sizeof(TestTblData)); memset(&TestMsg, 0, sizeof(TestMsg)); diff --git a/unit-test/coveragetest/coveragetest_sample_app_dispatch.c b/unit-test/coveragetest/coveragetest_sample_app_dispatch.c index e92dd2d..ca49f22 100644 --- a/unit-test/coveragetest/coveragetest_sample_app_dispatch.c +++ b/unit-test/coveragetest/coveragetest_sample_app_dispatch.c @@ -115,7 +115,8 @@ void Test_SAMPLE_APP_ProcessGroundCommand(void) memset(&TestMsg, 0, sizeof(TestMsg)); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_CMD_LEN_ERR_EID, + UT_CHECKEVENT_SETUP(&EventTest, + SAMPLE_APP_CMD_LEN_ERR_EID, "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u"); /* @@ -245,7 +246,8 @@ void Test_SAMPLE_APP_VerifyCmdLength(void) * test a match case */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &size, sizeof(size), false); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_CMD_LEN_ERR_EID, + UT_CHECKEVENT_SETUP(&EventTest, + SAMPLE_APP_CMD_LEN_ERR_EID, "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u"); SAMPLE_APP_VerifyCmdLength(NULL, size); diff --git a/unit-test/stubs/sample_app_stubs.c b/unit-test/stubs/sample_app_stubs.c index dfc211c..c3d6249 100644 --- a/unit-test/stubs/sample_app_stubs.c +++ b/unit-test/stubs/sample_app_stubs.c @@ -46,6 +46,5 @@ CFE_Status_t SAMPLE_APP_Init(void) */ void SAMPLE_APP_Main(void) { - UT_GenStub_Execute(SAMPLE_APP_Main, Basic, NULL); }