diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index 3c3549beb..743fe2ef9 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -1916,7 +1916,7 @@ FILE: sample_app.h */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; + CFE_MSG_TelemetryHeader_t TelemetryHeader; /* ** Task command interface counters... @@ -1949,7 +1949,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ int32 Status; ... - Status = CFE_MSG_Init(&SAMPLE_AppData.HkPacket.TlmHeader.Msg, /* Address of SB Message Data Buffer */ + Status = CFE_MSG_Init(CFE_MSG_PTR(SAMPLE_AppData.HkPacket.TelemetryHeader), /* Location of SB Message Data Buffer */ SAMPLE_HK_TLM_MID, /* SB Message ID associated with Data */ sizeof(SAMPLE_AppData.HkPacket)); /* Size of Buffer */ ... @@ -2107,8 +2107,8 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ /* ** Send housekeeping telemetry packet... */ - CFE_SB_TimeStampMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg); - CFE_SB_TransmitMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(SAMPLE_APP_Data.HkTlm.TelemetryHeader), true); ... } ``` @@ -2222,7 +2222,7 @@ FILE: sample_app.h */ typedef struct { - CFE_MSG_CommandHeader_t TlmHeader; + CFE_MSG_CommandHeader_t TelemetryHeader; /* ** Task command interface counters... @@ -2255,17 +2255,17 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ */ SAMPLE_AppData.BigPktBuf = (SAMPLE_BigPkt_Buffer_t *)CFE_SB_AllocateMessageBuffer(sizeof(SAMPLE_BigPkt_t)); - CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg, SAMPLE_BIG_TLM_MID, - sizeof(SAMPLE_AppData.BigPktBuf->Pkt); + CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TelemetryHeader.Msg, SAMPLE_BIG_TLM_MID, + sizeof(SAMPLE_AppData.BigPktBuf->Pkt)); /* ** ...Fill Packet with Data... */ - /* + /* ** Send Message after time tagging it with current time */ - CFE_SB_TimeStampMsg(&SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg); + CFE_SB_TimeStampMsg(&SAMPLE_AppData.BigPktBuf->Pkt.TelemetryHeader.Msg); CFE_SB_TransmitBuffer(SAMPLE_AppData.BigPktBuf, BufferHandle, true); /* SAMPLE_AppData.BigPktBuf is no longer a valid pointer */ ... diff --git a/modules/cfe_testcase/src/sb_sendrecv_test.c b/modules/cfe_testcase/src/sb_sendrecv_test.c index 3ba2cf747..c404a0abb 100644 --- a/modules/cfe_testcase/src/sb_sendrecv_test.c +++ b/modules/cfe_testcase/src/sb_sendrecv_test.c @@ -51,8 +51,8 @@ typedef struct typedef union { CFE_MSG_Message_t Hdr; - CFE_MSG_CommandHeader_t CmdHeader; - CFE_MSG_TelemetryHeader_t TlmHeader; + CFE_MSG_CommandHeader_t CommandHeader; + CFE_MSG_TelemetryHeader_t TelemetryHeader; uint8 MaxSize[CFE_MISSION_SB_MAX_SB_MSG_SIZE + 16]; char StringBuffer[CFE_FT_STRINGBUF_SIZE]; } CFE_FT_TestBigMessage_t; diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 29d13ff1f..215a818b3 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -2599,23 +2599,23 @@ void TestTask(void) /* Test a successful HK request */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); UtAssert_NONZERO(CFE_ES_MEMOFFSET_TO_SIZET(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree)); /* Test the HK request with a get heap failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(OS_HeapGetInfo), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK); UtAssert_ZERO(CFE_ES_MEMOFFSET_TO_SIZET(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree)); /* Test successful no-op command */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_NOOP_INF_EID); /* Test successful reset counters command */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetCountersCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ResetCountersCmd), UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESET_INF_EID); @@ -2624,14 +2624,14 @@ void TestTask(void) CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; CmdBuf.RestartCmd.Payload.RestartType = CFE_PSP_RST_TYPE_PROCESSOR; UT_SetDataBuffer(UT_KEY(CFE_PSP_Restart), &ResetType, sizeof(ResetType), false); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); UtAssert_UINT32_EQ(ResetType, CFE_PSP_RST_TYPE_PROCESSOR); UtAssert_STUB_COUNT(CFE_PSP_Restart, 1); /* Test cFE restart with bad restart type */ ES_ResetUnitTest(); CmdBuf.RestartCmd.Payload.RestartType = 4524; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); CFE_UtAssert_EVENTSENT(CFE_ES_BOOT_ERR_EID); /* Test successful app create */ @@ -2647,13 +2647,13 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(8192); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INF_EID); /* Test app create with an OS task create failure */ ES_ResetUnitTest(); UT_SetDefaultReturnValue(UT_KEY(OS_TaskCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_ERR_EID); /* Test app create with an invalid file name */ @@ -2670,7 +2670,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INVALID_FILENAME_ERR_EID); /* Test app create with a null application entry point */ @@ -2684,7 +2684,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INVALID_ENTRY_POINT_ERR_EID); /* Test app create with a null application name */ @@ -2699,7 +2699,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_NULL_APP_NAME_ERR_EID); /* Test app create with with an invalid exception action */ @@ -2715,7 +2715,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = 255; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_EXC_ACTION_ERR_EID); /* Test app create with a default stack size */ @@ -2731,7 +2731,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(0); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INF_EID); /* Test app create with a bad priority */ @@ -2747,7 +2747,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 1000; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_PRIORITY_ERR_EID); /* Test successful app stop */ @@ -2755,13 +2755,13 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.StopAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1); CmdBuf.StopAppCmd.Payload.Application[sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_DBG_EID); /* Test app stop failure */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_ERR1_EID); /* Test app stop with a bad app name */ @@ -2769,7 +2769,7 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.StopAppCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1); CmdBuf.StopAppCmd.Payload.Application[sizeof(CmdBuf.StopAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StopAppCmd), UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_STOP_ERR2_EID); /* Test successful app restart */ @@ -2778,7 +2778,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_DBG_EID); /* Test app restart with failed file check */ @@ -2788,7 +2789,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application)); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR1_EID); /* Test app restart with a bad app name */ @@ -2797,7 +2799,8 @@ void TestTask(void) strncpy(CmdBuf.RestartAppCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR2_EID); /* Test failed app restart, core app */ @@ -2806,7 +2809,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR1_EID); /* Test failed app restart, not running */ @@ -2815,7 +2819,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.RestartAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.RestartAppCmd.Payload.Application)); CmdBuf.RestartAppCmd.Payload.Application[sizeof(CmdBuf.RestartAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartAppCmd), UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartAppCmd), + UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESTART_APP_ERR1_EID); /* Test successful app reload */ @@ -2826,7 +2831,8 @@ void TestTask(void) CmdBuf.ReloadAppCmd.Payload.AppFileName[sizeof(CmdBuf.ReloadAppCmd.Payload.AppFileName) - 1] = '\0'; strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_DBG_EID); /* Test app reload with filename parse error */ @@ -2836,7 +2842,8 @@ void TestTask(void) strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test app reload with missing file */ @@ -2848,7 +2855,8 @@ void TestTask(void) CmdBuf.ReloadAppCmd.Payload.AppFileName[sizeof(CmdBuf.ReloadAppCmd.Payload.AppFileName) - 1] = '\0'; strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application)); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test app reload with a bad app name */ @@ -2857,7 +2865,8 @@ void TestTask(void) strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR2_EID); /* Test failed app reload, core app */ @@ -2866,7 +2875,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application)); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test failed app reload, not RUNNING */ @@ -2875,7 +2885,8 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.ReloadAppCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.ReloadAppCmd.Payload.Application)); CmdBuf.ReloadAppCmd.Payload.Application[sizeof(CmdBuf.ReloadAppCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ReloadAppCmd), UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ReloadAppCmd), + UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RELOAD_APP_ERR1_EID); /* Test successful telemetry packet request for single app data */ @@ -2884,7 +2895,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_WAITING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.QueryOneCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1); CmdBuf.QueryOneCmd.Payload.Application[sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ONE_APP_EID); /* Test telemetry packet request for single app data with send message failure */ @@ -2894,7 +2905,7 @@ void TestTask(void) strncpy(CmdBuf.QueryOneCmd.Payload.Application, "CFE_ES", sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1); CmdBuf.QueryOneCmd.Payload.Application[sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1] = '\0'; UT_SetDeferredRetcode(UT_KEY(CFE_SB_TransmitMsg), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ONE_ERR_EID); /* Test telemetry packet request for single app data with a bad app name */ @@ -2903,7 +2914,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.QueryOneCmd.Payload.Application, "BAD_APP_NAME", sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1); CmdBuf.QueryOneCmd.Payload.Application[sizeof(CmdBuf.QueryOneCmd.Payload.Application) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryOneCmd), UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ONE_APPID_ERR_EID); /* Test successful write of all app data to file */ @@ -2912,7 +2923,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); strncpy(CmdBuf.QueryAllCmd.Payload.FileName, "AllFilename", sizeof(CmdBuf.QueryAllCmd.Payload.FileName) - 1); CmdBuf.QueryAllCmd.Payload.FileName[sizeof(CmdBuf.QueryAllCmd.Payload.FileName) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ALL_APPS_EID); /* Test Query tasks command with valid lib ID */ @@ -2920,27 +2931,27 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); CFE_ES_Global.LibTable[0].LibId = CFE_ES_LIBID_C(ES_UT_MakeLibIdForIndex(1)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ALL_APPS_EID); /* Test write of all app data to file with a null file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ALL_APPS_EID); /* Test write of all app data to file with a bad file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_OSCREATE_ERR_EID); /* Test write of all app data to file with a write header failure */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_WRHDR_ERR_EID); /* Test write of all app data to file with a file write failure */ @@ -2948,7 +2959,7 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKWR_ERR_EID); /* Test write of all app data to file with a file create failure */ @@ -2956,14 +2967,14 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_OSCREATE_ERR_EID); /* Test successful write of all task data to a file */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_EID); @@ -2973,7 +2984,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, &UtTaskRecPtr); TaskId = CFE_ES_TaskRecordGetID(UtTaskRecPtr); UT_SetHandlerFunction(UT_KEY(CFE_FS_InitHeader), ES_UT_UnusedAppTask, &TaskId); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_EID); @@ -2981,7 +2992,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_OSCREATE_ERR_EID); @@ -2991,7 +3002,7 @@ void TestTask(void) strncpy(CmdBuf.QueryAllTasksCmd.Payload.FileName, "filename", sizeof(CmdBuf.QueryAllTasksCmd.Payload.FileName) - 1); CmdBuf.QueryAllTasksCmd.Payload.FileName[sizeof(CmdBuf.QueryAllTasksCmd.Payload.FileName) - 1] = '\0'; UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_WRHDR_ERR_EID); @@ -3000,7 +3011,7 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "UT", NULL, NULL); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_WR_ERR_EID); @@ -3008,21 +3019,22 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.QueryAllTasksCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TASKINFO_OSCREATE_ERR_EID); /* Test successful clearing of the system log */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ClearSysLogCmd), UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ClearSysLogCmd), + UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG1_INF_EID); /* Test successful overwriting of the system log using overwrite mode */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = CFE_ES_LogMode_OVERWRITE; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOGMODE_EID); @@ -3030,7 +3042,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = CFE_ES_LogMode_DISCARD; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOGMODE_EID); @@ -3038,7 +3050,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = 255; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERR_SYSLOGMODE_EID); @@ -3048,21 +3060,24 @@ void TestTask(void) strncpy(CmdBuf.WriteSysLogCmd.Payload.FileName, "filename", sizeof(CmdBuf.WriteSysLogCmd.Payload.FileName) - 1); CmdBuf.WriteSysLogCmd.Payload.FileName[sizeof(CmdBuf.WriteSysLogCmd.Payload.FileName) - 1] = '\0'; CFE_ES_Global.TaskData.HkPacket.Payload.SysLogEntries = 123; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_EID); /* Test writing the system log using a bad file name */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_ERR_EID); /* Test writing the system log using a null file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_EID); /* Test writing the system log with an OS create failure */ @@ -3070,7 +3085,8 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOG2_ERR_EID); /* Test writing the system log with an OS write failure */ @@ -3082,19 +3098,22 @@ void TestTask(void) "0000-000-00:00:00.00000 Test Message\n"); CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_FILEWRITE_ERR_EID); /* Test writing the system log with a write header failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteSysLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_FILEWRITE_ERR_EID); /* Test successful clearing of the E&R log */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ClearERLogCmd), UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ClearERLogCmd), + UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG1_INF_EID); /* Test successful writing of the E&R log */ @@ -3105,26 +3124,30 @@ void TestTask(void) strncpy(CmdBuf.WriteERLogCmd.Payload.FileName, "filename", sizeof(CmdBuf.WriteERLogCmd.Payload.FileName) - 1); CmdBuf.WriteERLogCmd.Payload.FileName[sizeof(CmdBuf.WriteERLogCmd.Payload.FileName) - 1] = '\0'; UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), false); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); UtAssert_STUB_COUNT(CFE_FS_BackgroundFileDumpRequest, 1); CFE_UtAssert_EVENTCOUNT(0); /* Failure of parsing the file name */ UT_ClearEventHistory(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG2_ERR_EID); /* Failure from CFE_FS_BackgroundFileDumpRequest() should send the pending error event ID */ UT_ClearEventHistory(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_BackgroundFileDumpRequest), 1, CFE_STATUS_REQUEST_ALREADY_PENDING); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG_PENDING_ERR_EID); /* Same event but pending locally */ UT_ClearEventHistory(); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), true); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.WriteERLogCmd), + UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_ERLOG_PENDING_ERR_EID); /* Test scan for exceptions in the PSP, should invoke a Processor Reset */ @@ -3226,20 +3249,21 @@ void TestTask(void) * length call */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_CLEAR_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test resetting and setting the max for the processor reset count */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetPRCountCmd), UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ResetPRCountCmd), + UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_RESET_PR_COUNT_EID); /* Test setting the maximum processor reset count */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.SetMaxPRCountCmd.Payload.MaxPRCount = 3; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SetMaxPRCountCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SetMaxPRCountCmd), UT_TPID_CFE_ES_CMD_SET_MAX_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SET_MAX_PR_COUNT_EID); @@ -3250,14 +3274,16 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.DeleteCDSCmd.Payload.CdsName, "CFE_ES.CDS_NAME", sizeof(CmdBuf.DeleteCDSCmd.Payload.CdsName) - 1); CmdBuf.DeleteCDSCmd.Payload.CdsName[sizeof(CmdBuf.DeleteCDSCmd.Payload.CdsName) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DELETE_ERR_EID); /* Test failed deletion of specified critical table CDS */ /* NOTE - reuse command from previous test */ ES_ResetUnitTest(); ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, true, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DELETE_TBL_ERR_EID); /* Test successful deletion of a specified CDS */ @@ -3266,14 +3292,16 @@ void TestTask(void) ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, NULL); /* Set up the block to read what we need to from the CDS */ - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DELETED_INFO_EID); /* Test deletion of a specified CDS with the owning app being active */ ES_ResetUnitTest(); ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, NULL); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_OWNER_ACTIVE_EID); /* Test deletion of a specified CDS with the name not found */ @@ -3281,13 +3309,14 @@ void TestTask(void) ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, &UtCDSRegRecPtr); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_BAD", NULL, NULL); CFE_ES_CDSBlockRecordSetFree(UtCDSRegRecPtr); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DeleteCDSCmd), UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DeleteCDSCmd), + UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_NAME_ERR_EID); /* Test successful dump of CDS to file using the default dump file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_REG_DUMP_INF_EID); @@ -3295,7 +3324,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CREATING_CDS_DUMP_ERR_EID); @@ -3303,7 +3332,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDeferredRetcode(UT_KEY(CFE_FS_WriteHeader), 1, -1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_WRITE_CFE_HDR_ERR_EID); @@ -3311,7 +3340,7 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CREATING_CDS_DUMP_ERR_EID); @@ -3320,14 +3349,14 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); ES_UT_SetupSingleCDSRegistry("CFE_ES.CDS_NAME", ES_UT_CDS_BLOCK_SIZE, false, NULL); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_DUMP_ERR_EID); /* Test telemetry pool statistics retrieval with an invalid handle */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendMemPoolStatsCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendMemPoolStatsCmd), UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_INVALID_POOL_HANDLE_ERR_EID); @@ -3335,42 +3364,42 @@ void TestTask(void) ES_ResetUnitTest(); ES_UT_SetupMemPoolId(&UtPoolRecPtr); CmdBuf.SendMemPoolStatsCmd.Payload.PoolHandle = CFE_ES_MemPoolRecordGetID(UtPoolRecPtr); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendMemPoolStatsCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendMemPoolStatsCmd), UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_TLM_POOL_STATS_INFO_EID); /* Test the command pipe message process with an invalid command */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_INVALID_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_INVALID_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CC1_ERR_EID); /* Test sending a no-op command with an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a reset counters command with an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a cFE restart command with an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESTART_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test cFE restart with a power on reset */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.RestartCmd.Payload.RestartType = CFE_PSP_RST_TYPE_POWERON; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_BOOT_ERR_EID); /* Test sending a start application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test start application command with a processor restart on application @@ -3388,77 +3417,77 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_PROC_RESTART; CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(CFE_PLATFORM_ES_DEFAULT_STACK_SIZE); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_START_INF_EID); /* Test sending a stop application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_STOP_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_STOP_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a restart application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESTART_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESTART_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a reload application command with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RELOAD_APP_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a write request for a single application with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_QUERY_ONE_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a write request for all applications with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a write request for all tasks with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to clear the system log with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_CLEAR_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to overwrite the system log with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to write the system log with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test successful overwriting of the system log using overwrite mode */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.OverwriteSysLogCmd.Payload.Mode = CFE_ES_LogMode_OVERWRITE; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.OverwriteSysLogCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.OverwriteSysLogCmd), UT_TPID_CFE_ES_CMD_OVER_WRITE_SYSLOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_SYSLOGMODE_EID); @@ -3466,35 +3495,35 @@ void TestTask(void) * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to reset the processor reset count with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_RESET_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to set the maximum processor reset count with * an invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SET_MAX_PR_COUNT_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SET_MAX_PR_COUNT_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a request to delete the CDS with an invalid command * length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_DELETE_CDS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test sending a telemetry pool statistics retrieval command with an * invalid command length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SEND_MEM_POOL_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test successful dump of CDS to file using a specified dump file name */ @@ -3505,19 +3534,19 @@ void TestTask(void) strncpy(CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename, "DumpFile", sizeof(CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename) - 1); CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename[sizeof(CmdBuf.DumpCDSRegistryCmd.Payload.DumpFilename) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.DumpCDSRegistryCmd), UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_CDS_REG_DUMP_INF_EID); /* Dump CDS command with invalid length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); CFE_UtAssert_EVENTSENT(CFE_ES_LEN_ERR_EID); /* Test error when sending Build Info event */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_EVS_SendEvent), 1, CFE_EVS_INVALID_PARAMETER); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC); CFE_UtAssert_PRINTF("Error sending build info event"); /* @@ -3570,7 +3599,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test successful performance data collection start in CENTER @@ -3579,7 +3609,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_CENTER; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test successful performance data collection start in END @@ -3588,7 +3619,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_END; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test performance data collection start with an invalid trigger mode @@ -3597,7 +3629,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = (CFE_ES_PERF_TRIGGER_END + 1); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_TRIG_ERR_EID); /* Test performance data collection start with an invalid trigger mode @@ -3606,7 +3639,8 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = 0xffffffff; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_TRIG_ERR_EID); /* Test performance data collection start with a file write in progress */ @@ -3616,13 +3650,15 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_ERR_EID); /* Check again with pending state not idle */ CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_IDLE; CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_ERR_EID); /* Test performance data collection by sending another valid @@ -3632,14 +3668,16 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStartCmd), + UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test successful performance data collection stop */ ES_ResetUnitTest(); memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_EID); /* Test performance data collection stop with a file name validation issue */ @@ -3647,7 +3685,8 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_ParseInputFileNameEx), CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_LOG_ERR_EID); /* Test successful performance data collection stop with a non-default @@ -3658,19 +3697,22 @@ void TestPerf(void) memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); strncpy(CmdBuf.PerfStopCmd.Payload.DataFileName, "filename", sizeof(CmdBuf.PerfStopCmd.Payload.DataFileName) - 1); CmdBuf.PerfStopCmd.Payload.DataFileName[sizeof(CmdBuf.PerfStopCmd.Payload.DataFileName) - 1] = '\0'; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_EID); /* Test performance data collection stop with a file write in progress */ ES_ResetUnitTest(); CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_ERR2_EID); /* Repeat with pending state not IDLE */ CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_IDLE; CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfStopCmd), + UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_STOPCMD_ERR2_EID); /* Test performance filter mask command with out of range filter @@ -3678,7 +3720,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetFilterMaskCmd.Payload.FilterMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetFilterMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetFilterMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_FILTMSKERR_EID); @@ -3686,7 +3728,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetFilterMaskCmd.Payload.FilterMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK / 2; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetFilterMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetFilterMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_FILTMSKCMD_EID); @@ -3695,7 +3737,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetTrigMaskCmd.Payload.TriggerMaskNum = 0; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetTrigMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetTrigMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_TRIGMSKCMD_EID); @@ -3705,7 +3747,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetTrigMaskCmd.Payload.TriggerMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK - 1; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetTrigMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetTrigMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_TRIGMSKCMD_EID); @@ -3715,7 +3757,7 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfSetTrigMaskCmd.Payload.TriggerMaskNum = CFE_ES_PERF_32BIT_WORDS_IN_MASK + 1; - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfSetTrigMaskCmd), + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.PerfSetTrigMaskCmd), UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTSENT(CFE_ES_PERF_TRIGMSKERR_EID); @@ -3838,22 +3880,22 @@ void TestPerf(void) /* Test performance data collection start with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_STARTCMD_EID); /* Test performance data collection stop with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_STOPCMD_EID); /* Test performance data filter mask with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SET_PERF_FILTER_MASK_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_FILTMSKCMD_EID); /* Test performance data trigger mask with an invalid message length */ ES_ResetUnitTest(); - UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 0, UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); + UT_CallTaskPipe(CFE_ES_TaskPipe, CFE_MSG_PTR(CmdBuf), 0, UT_TPID_CFE_ES_CMD_SET_PERF_TRIGGER_MASK_CC); CFE_UtAssert_EVENTNOTSENT(CFE_ES_PERF_TRIGMSKCMD_EID); /* Test perf log dump state machine */ diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index 3308e2476..95b6cfe5e 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -274,7 +274,7 @@ void Test_Init(void) { CFE_EVS_EnablePortsCmd_t bitmaskcmd; CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; + CFE_SB_MsgId_t msgid = CFE_SB_INVALID_MSG_ID; UtPrintf("Begin Test Init"); @@ -695,7 +695,7 @@ void Test_Format(void) CFE_TIME_SysTime_t time = {0, 0}; CFE_EVS_SetEventFormatModeCmd_t modecmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; CFE_EVS_PacketID_t CapturedMsg; UT_SoftwareBusSnapshot_Entry_t LongFmtSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID), .SnapshotBuffer = &CapturedMsg, @@ -821,7 +821,7 @@ void Test_Format(void) */ void Test_Ports(void) { - CFE_EVS_EnablePortsCmd_t bitmaskcmd; + CFE_EVS_EnablePortsCmd_t bitmaskcmd; UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; CFE_TIME_SysTime_t PacketTime; @@ -1074,9 +1074,9 @@ void Test_WriteApp(void) { union { - CFE_EVS_ResetCountersCmd_t ResetCountersCmd; - CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_ResetCountersCmd_t ResetCountersCmd; + CFE_EVS_WriteAppDataFileCmd_t AppDataCmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; } CmdBuf; UtPrintf("Begin Test Write App"); @@ -1157,10 +1157,10 @@ void Test_WriteApp(void) */ void Test_BadAppCmd(void) { - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - CFE_EVS_AddEventFilterCmd_t appmaskcmd; - CFE_EVS_ResetFilterCmd_t appcmdcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + CFE_EVS_AddEventFilterCmd_t appmaskcmd; + CFE_EVS_ResetFilterCmd_t appcmdcmd; uint32 TestAppIndex; UtPrintf("Begin Test Bad App Command"); @@ -1425,11 +1425,11 @@ void Test_BadAppCmd(void) */ void Test_EventCmd(void) { - uint16 EventCount[4]; - CFE_EVS_EnablePortsCmd_t bitmaskcmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; + uint16 EventCount[4]; + CFE_EVS_EnablePortsCmd_t bitmaskcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + UT_SoftwareBusSnapshot_Entry_t LocalSnapshotData = {.MsgId = CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_LONG_EVENT_MSG_MID)}; memset(&bitmaskcmd, 0, sizeof(bitmaskcmd)); @@ -1602,10 +1602,10 @@ void Test_EventCmd(void) void Test_FilterCmd(void) { int i; - CFE_EVS_EnableAppEventsCmd_t appnamecmd; - CFE_EVS_AddEventFilterCmd_t appmaskcmd; - CFE_EVS_ResetFilterCmd_t appcmdcmd; - CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; + CFE_EVS_EnableAppEventsCmd_t appnamecmd; + CFE_EVS_AddEventFilterCmd_t appmaskcmd; + CFE_EVS_ResetFilterCmd_t appcmdcmd; + CFE_EVS_EnableAppEventTypeCmd_t appbitcmd; UtPrintf("Begin Test Filter Command"); @@ -2124,4 +2124,4 @@ void Test_Misc(void) EVS_AppDataSetUsed(&CFE_EVS_Global.AppData[i], AppID); } UtAssert_UINT32_EQ(CFE_EVS_ReportHousekeepingCmd(NULL), CFE_STATUS_NO_COUNTER_INCREMENT); -} +} \ No newline at end of file diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 72df5a6b3..1f3c2c83b 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -514,13 +514,13 @@ void Test_SB_Cmds_Noop(void) memset(&Noop, 0, sizeof(Noop)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &Noop.SBBuf.Msg, sizeof(Noop.Cmd), UT_TPID_CFE_SB_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(Noop.SBBuf), sizeof(Noop.Cmd), UT_TPID_CFE_SB_CMD_NOOP_CC); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_CMD0_RCVD_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &Noop.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(Noop.SBBuf), 0, UT_TPID_CFE_SB_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); } @@ -537,14 +537,15 @@ void Test_SB_Cmds_RstCtrs(void) memset(&ResetCounters, 0, sizeof(ResetCounters)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &ResetCounters.SBBuf.Msg, sizeof(ResetCounters.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(ResetCounters.SBBuf), sizeof(ResetCounters.Cmd), UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTCOUNT(1); CFE_UtAssert_EVENTSENT(CFE_SB_CMD1_RCVD_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &ResetCounters.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(ResetCounters.SBBuf), 0, + UT_TPID_CFE_SB_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); } /* Test_SB_Cmds_RstCtrs */ @@ -587,7 +588,7 @@ void Test_SB_Cmds_Stats(void) CFE_UtAssert_EVENTSENT(CFE_SB_SND_STATS_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &SendSbStats.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(SendSbStats.SBBuf), 0, UT_TPID_CFE_SB_CMD_SEND_SB_STATS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -611,7 +612,7 @@ void Test_SB_Cmds_RoutingInfoDef(void) /* Make some routing info by calling CFE_SB_AppInit */ CFE_UtAssert_SETUP(CFE_SB_AppInit()); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), sizeof(WriteRoutingInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTCOUNT(5); @@ -622,12 +623,13 @@ void Test_SB_Cmds_RoutingInfoDef(void) /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), sizeof(WriteRoutingInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), 0, + UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); @@ -651,7 +653,7 @@ void Test_SB_Cmds_RoutingInfoAlreadyPending(void) strncpy(WriteRoutingInfo.Cmd.Payload.Filename, "RoutingTstFile", sizeof(WriteRoutingInfo.Cmd.Payload.Filename) - 1); WriteRoutingInfo.Cmd.Payload.Filename[sizeof(WriteRoutingInfo.Cmd.Payload.Filename) - 1] = '\0'; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteRoutingInfo.SBBuf.Msg, sizeof(WriteRoutingInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteRoutingInfo.SBBuf), sizeof(WriteRoutingInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_ROUTING_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -758,7 +760,7 @@ void Test_SB_Cmds_PipeInfoDef(void) CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId2, PipeDepth, "TestPipe2")); CFE_UtAssert_SETUP(CFE_SB_CreatePipe(&PipeId3, PipeDepth, "TestPipe3")); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), sizeof(WritePipeInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -767,11 +769,12 @@ void Test_SB_Cmds_PipeInfoDef(void) /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), sizeof(WritePipeInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), 0, + UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -797,7 +800,7 @@ void Test_SB_Cmds_PipeInfoAlreadyPending(void) strncpy(WritePipeInfo.Cmd.Payload.Filename, "PipeTstFile", sizeof(WritePipeInfo.Cmd.Payload.Filename) - 1); WritePipeInfo.Cmd.Payload.Filename[sizeof(WritePipeInfo.Cmd.Payload.Filename) - 1] = '\0'; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WritePipeInfo.SBBuf.Msg, sizeof(WritePipeInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WritePipeInfo.SBBuf), sizeof(WritePipeInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_PIPE_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -960,7 +963,7 @@ void Test_SB_Cmds_MapInfoDef(void) CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId4, PipeId3)); CFE_UtAssert_SETUP(CFE_SB_Subscribe(MsgId5, PipeId2)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), sizeof(WriteMapInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTCOUNT(10); @@ -971,12 +974,12 @@ void Test_SB_Cmds_MapInfoDef(void) /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), sizeof(WriteMapInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_SND_RTG_ERR1_EID); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), 0, UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId1)); @@ -1002,7 +1005,7 @@ void Test_SB_Cmds_MapInfoAlreadyPending(void) strncpy(WriteMapInfo.Cmd.Payload.Filename, "MapTstFile", sizeof(WriteMapInfo.Cmd.Payload.Filename) - 1); WriteMapInfo.Cmd.Payload.Filename[sizeof(WriteMapInfo.Cmd.Payload.Filename) - 1] = '\0'; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &WriteMapInfo.SBBuf.Msg, sizeof(WriteMapInfo.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(WriteMapInfo.SBBuf), sizeof(WriteMapInfo.Cmd), UT_TPID_CFE_SB_CMD_WRITE_MAP_INFO_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1031,7 +1034,7 @@ void Test_SB_Cmds_EnRouteValParam(void) EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -1043,7 +1046,7 @@ void Test_SB_Cmds_EnRouteValParam(void) CFE_UtAssert_EVENTSENT(CFE_SB_ENBL_RTE2_EID); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), 0, UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -1072,7 +1075,7 @@ void Test_SB_Cmds_EnRouteNonExist(void) EnableRoute.Cmd.Payload.MsgId = MsgId; EnableRoute.Cmd.Payload.Pipe = PipeId2; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(4); @@ -1101,7 +1104,7 @@ void Test_SB_Cmds_EnRouteInvParam(void) EnableRoute.Cmd.Payload.MsgId = SB_UT_LAST_VALID_MID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1125,7 +1128,7 @@ void Test_SB_Cmds_EnRouteInvParam2(void) EnableRoute.Cmd.Payload.MsgId = CFE_SB_INVALID_MSG_ID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1150,7 +1153,7 @@ void Test_SB_Cmds_EnRouteInvParam3(void) EnableRoute.Cmd.Payload.MsgId = SB_UT_ALTERNATE_INVALID_MID; EnableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_0; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableRoute.SBBuf.Msg, sizeof(EnableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableRoute.SBBuf), sizeof(EnableRoute.Cmd), UT_TPID_CFE_SB_CMD_ENABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1179,7 +1182,7 @@ void Test_SB_Cmds_DisRouteValParam(void) DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(3); @@ -1191,7 +1194,7 @@ void Test_SB_Cmds_DisRouteValParam(void) CFE_UtAssert_EVENTSENT(CFE_SB_DSBL_RTE2_EID); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, 0, UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), 0, UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); CFE_UtAssert_TEARDOWN(CFE_SB_DeletePipe(PipeId)); @@ -1220,7 +1223,7 @@ void Test_SB_Cmds_DisRouteNonExist(void) DisableRoute.Cmd.Payload.MsgId = MsgId; DisableRoute.Cmd.Payload.Pipe = PipeId2; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(4); @@ -1249,7 +1252,7 @@ void Test_SB_Cmds_DisRouteInvParam(void) DisableRoute.Cmd.Payload.MsgId = SB_UT_LAST_VALID_MID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1273,7 +1276,7 @@ void Test_SB_Cmds_DisRouteInvParam2(void) DisableRoute.Cmd.Payload.MsgId = CFE_SB_INVALID_MSG_ID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_3; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1298,7 +1301,7 @@ void Test_SB_Cmds_DisRouteInvParam3(void) DisableRoute.Cmd.Payload.MsgId = SB_UT_ALTERNATE_INVALID_MID; DisableRoute.Cmd.Payload.Pipe = SB_UT_PIPEID_0; - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableRoute.SBBuf.Msg, sizeof(DisableRoute.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableRoute.SBBuf), sizeof(DisableRoute.Cmd), UT_TPID_CFE_SB_CMD_DISABLE_ROUTE_CC); CFE_UtAssert_EVENTCOUNT(1); @@ -1459,7 +1462,8 @@ void Test_SB_Cmds_SendPrevSubs(void) UT_ClearEventHistory(); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &SendPrevSubs.SBBuf.Msg, 0, UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC); + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(SendPrevSubs.SBBuf), 0, + UT_TPID_CFE_SB_SUB_RPT_CTL_SEND_PREV_SUBS_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1480,7 +1484,7 @@ void Test_SB_Cmds_SubRptOn(void) memset(&EnableSubReporting, 0, sizeof(EnableSubReporting)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableSubReporting.SBBuf.Msg, sizeof(EnableSubReporting.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableSubReporting.SBBuf), sizeof(EnableSubReporting.Cmd), UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTCOUNT(0); @@ -1489,7 +1493,7 @@ void Test_SB_Cmds_SubRptOn(void) UT_ClearEventHistory(); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &EnableSubReporting.SBBuf.Msg, 0, + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(EnableSubReporting.SBBuf), 0, UT_TPID_CFE_SB_SUB_RPT_CTL_ENABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -1508,7 +1512,7 @@ void Test_SB_Cmds_SubRptOff(void) memset(&DisableSubReporting, 0, sizeof(DisableSubReporting)); - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableSubReporting.SBBuf.Msg, sizeof(DisableSubReporting.Cmd), + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableSubReporting.SBBuf), sizeof(DisableSubReporting.Cmd), UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTCOUNT(0); @@ -1517,7 +1521,7 @@ void Test_SB_Cmds_SubRptOff(void) UT_ClearEventHistory(); /* Bad Size */ - UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, &DisableSubReporting.SBBuf.Msg, 0, + UT_CallTaskPipe(CFE_SB_ProcessCmdPipePkt, CFE_MSG_PTR(DisableSubReporting.SBBuf), 0, UT_TPID_CFE_SB_SUB_RPT_CTL_DISABLE_SUB_REPORTING_CC); CFE_UtAssert_EVENTSENT(CFE_SB_LEN_ERR_EID); @@ -4446,7 +4450,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_MSG_TOO_BIG_EID_BIT); - CFE_SB_TransmitMsg(&Housekeeping.SBBuf.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(Housekeeping.SBBuf), true); CFE_UtAssert_EVENTNOTSENT(CFE_SB_MSG_TOO_BIG_EID); UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); @@ -4455,7 +4459,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void) MsgId = CFE_SB_INVALID_MSG_ID; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_SEND_INV_MSGID_EID_BIT); - CFE_SB_TransmitMsg(&Housekeeping.SBBuf.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(Housekeeping.SBBuf), true); CFE_UtAssert_EVENTNOTSENT(CFE_SB_SEND_INV_MSGID_EID); UtAssert_UINT32_EQ(CFE_SB_Global.HKTlmMsg.Payload.MsgSendErrorCounter, 1); diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 113216dea..f6ad15bae 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -300,28 +300,28 @@ void Test_CFE_TBL_TaskInit(void) /* Test command pipe messages handler response to a valid command */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_NOOP_INF_EID); /* Test command pipe messages handler response to an invalid * message length */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd) - 1, UT_TPID_CFE_TBL_CMD_NOOP_CC); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd) - 1, UT_TPID_CFE_TBL_CMD_NOOP_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_LEN_ERR_EID); /* Test command pipe messages handler response to an invalid * command code */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_INVALID_CC); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_CMD_INVALID_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_CC1_ERR_EID); /* Test command pipe messages handler response to other errors */ UT_InitData(); CFE_TBL_Global.CommandCounter = 0; CFE_TBL_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_INVALID_MID); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_TBL_INVALID_MID); CFE_UtAssert_EVENTSENT(CFE_TBL_MID_ERR_EID); UtAssert_ZERO(CFE_TBL_Global.CommandCounter); UtAssert_ZERO(CFE_TBL_Global.CommandErrorCounter); @@ -330,13 +330,13 @@ void Test_CFE_TBL_TaskInit(void) UT_InitData(); CFE_TBL_Global.CommandCounter = 0; CFE_TBL_Global.CommandErrorCounter = 0; - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_TBL_MSG_HK); + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_TBL_MSG_HK); UtAssert_ZERO(CFE_TBL_Global.CommandCounter); UtAssert_ZERO(CFE_TBL_Global.CommandErrorCounter); /* Test command pipe messages handler response to "command type" message */ UT_InitData(); - UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetCountersCmd), + UT_CallTaskPipe(CFE_TBL_TaskPipe, CFE_MSG_PTR(CmdBuf), sizeof(CmdBuf.ResetCountersCmd), UT_TPID_CFE_TBL_CMD_RESET_COUNTERS_CC); CFE_UtAssert_EVENTSENT(CFE_TBL_RESET_INF_EID); UtAssert_ZERO(CFE_TBL_Global.CommandCounter); diff --git a/modules/time/fsw/src/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c index b3a431386..5284d890b 100644 --- a/modules/time/fsw/src/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -275,7 +275,7 @@ int32 CFE_TIME_ToneSendMET(CFE_TIME_SysTime_t NewMET) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with external data... @@ -415,7 +415,7 @@ int32 CFE_TIME_ToneSendGPS(CFE_TIME_SysTime_t NewTime, int16 NewLeaps) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with external data... @@ -555,7 +555,7 @@ int32 CFE_TIME_ToneSendTime(CFE_TIME_SysTime_t NewTime) /* ** Send "time at the tone" command data packet... */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneDataCmd.CommandHeader.Msg, true); + CFE_SB_TransmitMsg(CFE_MSG_PTR(CFE_TIME_Global.ToneDataCmd.CommandHeader), true); /* ** Count of "time at the tone" commands sent with external data...