diff --git a/fsw/src/sample_app.c b/fsw/src/sample_app.c index 2961237..dafb2e6 100644 --- a/fsw/src/sample_app.c +++ b/fsw/src/sample_app.c @@ -191,7 +191,7 @@ int32 SAMPLE_APP_Init(void) status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_TABLE_FILE); } - CFE_EVS_SendEvent(SAMPLE_APP_STARTUP_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", SAMPLE_APP_VERSION_STRING); return CFE_SUCCESS; @@ -221,7 +221,7 @@ void SAMPLE_APP_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr) break; default: - CFE_EVS_SendEvent(SAMPLE_APP_INVALID_MSGID_ERR_EID, CFE_EVS_EventType_ERROR, + 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)); break; } @@ -269,8 +269,8 @@ void SAMPLE_APP_ProcessGroundCommand(CFE_SB_Buffer_t *SBBufPtr) /* default case already found during FC vs length test */ default: - CFE_EVS_SendEvent(SAMPLE_APP_COMMAND_ERR_EID, CFE_EVS_EventType_ERROR, - "Invalid ground command code: CC = %d", CommandCode); + CFE_EVS_SendEvent(SAMPLE_APP_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid ground command code: CC = %d", + CommandCode); break; } } @@ -319,7 +319,7 @@ int32 SAMPLE_APP_Noop(const SAMPLE_APP_NoopCmd_t *Msg) { SAMPLE_APP_Data.CmdCounter++; - CFE_EVS_SendEvent(SAMPLE_APP_COMMANDNOP_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; @@ -337,7 +337,7 @@ int32 SAMPLE_APP_ResetCounters(const SAMPLE_APP_ResetCountersCmd_t *Msg) SAMPLE_APP_Data.CmdCounter = 0; SAMPLE_APP_Data.ErrCounter = 0; - CFE_EVS_SendEvent(SAMPLE_APP_COMMANDRST_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: RESET command"); + CFE_EVS_SendEvent(SAMPLE_APP_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE: RESET command"); return CFE_SUCCESS; } @@ -403,7 +403,7 @@ bool SAMPLE_APP_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength CFE_MSG_GetMsgId(MsgPtr, &MsgId); CFE_MSG_GetFcnCode(MsgPtr, &FcnCode); - CFE_EVS_SendEvent(SAMPLE_APP_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)ExpectedLength); diff --git a/fsw/src/sample_app_events.h b/fsw/src/sample_app_events.h index 46e7aaf..0d8a586 100644 --- a/fsw/src/sample_app_events.h +++ b/fsw/src/sample_app_events.h @@ -25,13 +25,13 @@ #ifndef SAMPLE_APP_EVENTS_H #define SAMPLE_APP_EVENTS_H -#define SAMPLE_APP_RESERVED_EID 0 -#define SAMPLE_APP_STARTUP_INF_EID 1 -#define SAMPLE_APP_COMMAND_ERR_EID 2 -#define SAMPLE_APP_COMMANDNOP_INF_EID 3 -#define SAMPLE_APP_COMMANDRST_INF_EID 4 -#define SAMPLE_APP_INVALID_MSGID_ERR_EID 5 -#define SAMPLE_APP_LEN_ERR_EID 6 -#define SAMPLE_APP_PIPE_ERR_EID 7 +#define SAMPLE_APP_RESERVED_EID 0 +#define SAMPLE_APP_INIT_INF_EID 1 +#define SAMPLE_APP_CC_ERR_EID 2 +#define SAMPLE_APP_NOOP_INF_EID 3 +#define SAMPLE_APP_RESET_INF_EID 4 +#define SAMPLE_APP_MID_ERR_EID 5 +#define SAMPLE_APP_CMD_LEN_ERR_EID 6 +#define SAMPLE_APP_PIPE_ERR_EID 7 #endif /* SAMPLE_APP_EVENTS_H */ diff --git a/unit-test/coveragetest/coveragetest_sample_app.c b/unit-test/coveragetest/coveragetest_sample_app.c index a1ca631..cb7f2c1 100644 --- a/unit-test/coveragetest/coveragetest_sample_app.c +++ b/unit-test/coveragetest/coveragetest_sample_app.c @@ -291,7 +291,7 @@ void Test_SAMPLE_APP_ProcessCommandPacket(void) UT_CheckEvent_t EventTest; memset(&TestMsg, 0, sizeof(TestMsg)); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_INVALID_MSGID_ERR_EID, "SAMPLE: invalid command packet,MID = 0x%x"); + UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_MID_ERR_EID, "SAMPLE: invalid command packet,MID = 0x%x"); /* * The CFE_MSG_GetMsgId() stub uses a data buffer to hold the @@ -355,7 +355,7 @@ void Test_SAMPLE_APP_ProcessGroundCommand(void) Size = sizeof(TestMsg.Noop); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_COMMANDNOP_INF_EID, NULL); + UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_NOOP_INF_EID, NULL); SAMPLE_APP_ProcessGroundCommand(&TestMsg.SBBuf); @@ -366,7 +366,7 @@ void Test_SAMPLE_APP_ProcessGroundCommand(void) Size = sizeof(TestMsg.Reset); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_COMMANDRST_INF_EID, NULL); + UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_RESET_INF_EID, NULL); SAMPLE_APP_ProcessGroundCommand(&TestMsg.SBBuf); @@ -386,7 +386,7 @@ void Test_SAMPLE_APP_ProcessGroundCommand(void) /* test an invalid CC */ FcnCode = 1000; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_COMMAND_ERR_EID, "Invalid ground command code: CC = %d"); + UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_CC_ERR_EID, "Invalid ground command code: CC = %d"); SAMPLE_APP_ProcessGroundCommand(&TestMsg.SBBuf); /* @@ -443,7 +443,7 @@ void Test_SAMPLE_APP_NoopCmd(void) memset(&TestMsg, 0, sizeof(TestMsg)); /* test dispatch of NOOP */ - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_COMMANDNOP_INF_EID, NULL); + UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_NOOP_INF_EID, NULL); UtAssert_INT32_EQ(SAMPLE_APP_Noop(&TestMsg), CFE_SUCCESS); @@ -464,7 +464,7 @@ void Test_SAMPLE_APP_ResetCounters(void) memset(&TestMsg, 0, sizeof(TestMsg)); - UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_COMMANDRST_INF_EID, "SAMPLE: RESET command"); + UT_CHECKEVENT_SETUP(&EventTest, SAMPLE_APP_RESET_INF_EID, "SAMPLE: RESET command"); UtAssert_INT32_EQ(SAMPLE_APP_ResetCounters(&TestMsg), CFE_SUCCESS); @@ -527,7 +527,7 @@ 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_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);