Skip to content

Commit

Permalink
Merge pull request #2229 from dmknutsen/ISSUE_2228
Browse files Browse the repository at this point in the history
Fix #2228, Update UTs to use correct cmd types
  • Loading branch information
dzbaker committed Dec 20, 2022
2 parents 5ad31f1 + 0f9313d commit 9b047b8
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 53 deletions.
1 change: 1 addition & 0 deletions modules/es/fsw/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetCountersCmd_t;
typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearSysLogCmd_t;
typedef CFE_ES_NoArgsCmd_t CFE_ES_ClearERLogCmd_t;
typedef CFE_ES_NoArgsCmd_t CFE_ES_ResetPRCountCmd_t;
typedef CFE_ES_NoArgsCmd_t CFE_ES_SendHkCmd_t;

/**
** \brief Restart cFE Command Payload
Expand Down
4 changes: 2 additions & 2 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
** Housekeeping telemetry request
*/
case CFE_ES_SEND_HK_MID:
CFE_ES_HousekeepingCmd((CFE_MSG_CommandHeader_t *)SBBufPtr);
CFE_ES_HousekeepingCmd((CFE_ES_SendHkCmd_t *)SBBufPtr);
break;

/*
Expand Down Expand Up @@ -655,7 +655,7 @@ void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data)
int32 CFE_ES_HousekeepingCmd(const CFE_ES_SendHkCmd_t *data)
{
OS_heap_prop_t HeapProp;
int32 OsStatus;
Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void CFE_ES_BackgroundCleanup(void);
/*
** ES Task message dispatch functions
*/
int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data);
int32 CFE_ES_HousekeepingCmd(const CFE_ES_SendHkCmd_t *data);

/*---------------------------------------------------------------------------------------*/
/**
Expand Down
23 changes: 13 additions & 10 deletions modules/es/ut-coverage/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void ES_ResetUnitTest(void)
* so it must be re-initialized here every time CFE_ES_Global is reset.
*/
CFE_ES_Global.ResetDataPtr = ES_UT_PersistentResetData;
}
} /* end ES_ResetUnitTest() */

void TestInit(void)
{
Expand Down Expand Up @@ -2466,7 +2466,9 @@ void TestTask(void)
union
{
CFE_MSG_Message_t Msg;
CFE_MSG_CommandHeader_t NoArgsCmd;
CFE_ES_SendHkCmd_t SendHkCmd;
CFE_ES_NoopCmd_t NoopCmd;
CFE_ES_ResetCountersCmd_t ResetCountersCmd;
CFE_ES_ClearSysLogCmd_t ClearSysLogCmd;
CFE_ES_ClearERLogCmd_t ClearERLogCmd;
CFE_ES_ResetPRCountCmd_t ResetPRCountCmd;
Expand Down Expand Up @@ -2587,23 +2589,24 @@ void TestTask(void)

/* Test a successful HK request */
ES_ResetUnitTest();
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_SEND_HK);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK);
UtAssert_NONZERO(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.NoArgsCmd), UT_TPID_CFE_ES_SEND_HK);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.SendHkCmd), UT_TPID_CFE_ES_SEND_HK);
UtAssert_ZERO(CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree);

/* Test successful no-op command */
ES_ResetUnitTest();
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_CMD_NOOP_CC);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 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.NoArgsCmd), UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.ResetCountersCmd),
UT_TPID_CFE_ES_CMD_RESET_COUNTERS_CC);
CFE_UtAssert_EVENTSENT(CFE_ES_RESET_INF_EID);

/* Test successful cFE restart */
Expand Down Expand Up @@ -3328,7 +3331,7 @@ void TestTask(void)

/* Test the command pipe message process with an invalid command */
ES_ResetUnitTest();
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_CMD_INVALID_CC);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, 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 */
Expand Down Expand Up @@ -3504,7 +3507,7 @@ void TestTask(void)
/* 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.NoArgsCmd), UT_TPID_CFE_ES_CMD_NOOP_CC);
UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoopCmd), UT_TPID_CFE_ES_CMD_NOOP_CC);
CFE_UtAssert_PRINTF("Error sending build info event");

/*
Expand All @@ -3518,7 +3521,7 @@ void TestTask(void)
UT_SetHandlerFunction(UT_KEY(CFE_Config_IterateAll), ES_UT_Config_IterateAll, NULL);
UtAssert_VOIDCALL(CFE_ES_TaskInit());
CFE_UtAssert_PRINTF("Error sending mission version event");
}
} /* end TestTask */

void TestPerf(void)
{
Expand Down Expand Up @@ -5014,7 +5017,7 @@ void TestCDS()
CFE_ES_Global.CDSIsAvailable = false;
UtAssert_INT32_EQ(CFE_ES_GetCDSBlockIDByName(&CDSHandle, "NotNULL"), CFE_ES_NOT_IMPLEMENTED);
UtAssert_INT32_EQ(CFE_ES_GetCDSBlockName(CDSName, CDSHandle, sizeof(CDSName)), CFE_ES_NOT_IMPLEMENTED);
}
} /* End TestCDS */

void TestCDSMempool(void)
{
Expand Down
1 change: 1 addition & 0 deletions modules/evs/fsw/inc/cfe_evs_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ typedef struct CFE_EVS_NoArgsCmd
typedef CFE_EVS_NoArgsCmd_t CFE_EVS_NoopCmd_t;
typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ResetCountersCmd_t;
typedef CFE_EVS_NoArgsCmd_t CFE_EVS_ClearLogCmd_t;
typedef CFE_EVS_NoArgsCmd_t CFE_EVS_SendHkCmd_t;

/**
** \brief Write Event Log to File Command Payload
Expand Down
4 changes: 2 additions & 2 deletions modules/evs/fsw/src/cfe_evs_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr)

case CFE_EVS_SEND_HK_MID:
/* Housekeeping request */
CFE_EVS_ReportHousekeepingCmd((CFE_MSG_CommandHeader_t *)SBBufPtr);
CFE_EVS_ReportHousekeepingCmd((CFE_EVS_SendHkCmd_t *)SBBufPtr);
break;

default:
Expand Down Expand Up @@ -613,7 +613,7 @@ int32 CFE_EVS_ClearLogCmd(const CFE_EVS_ClearLogCmd_t *data)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CFE_EVS_ReportHousekeepingCmd(const CFE_MSG_CommandHeader_t *data)
int32 CFE_EVS_ReportHousekeepingCmd(const CFE_EVS_SendHkCmd_t *data)
{
uint32 i, j;
EVS_AppData_t * AppDataPtr;
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/fsw/src/cfe_evs_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void CFE_EVS_ProcessCommandPacket(CFE_SB_Buffer_t *SBBufPtr);
*
* Request for housekeeping status telemetry packet.
*/
int32 CFE_EVS_ReportHousekeepingCmd(const CFE_MSG_CommandHeader_t *data);
int32 CFE_EVS_ReportHousekeepingCmd(const CFE_EVS_SendHkCmd_t *data);

/*---------------------------------------------------------------------------------------*/
/**
Expand Down
21 changes: 12 additions & 9 deletions modules/evs/ut-coverage/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,8 @@ void Test_Logging(void)
char tmpString[100];
union
{
CFE_MSG_CommandHeader_t cmd;
CFE_EVS_NoopCmd_t noopcmd;
CFE_EVS_ClearLogCmd_t clearlogcmd;
CFE_EVS_SetLogModeCmd_t modecmd;
CFE_EVS_WriteLogDataFileCmd_t logfilecmd;
} CmdBuf;
Expand Down Expand Up @@ -976,13 +977,15 @@ void Test_Logging(void)
/* Test sending a no op command */
UT_InitData();
memset(&CmdBuf, 0, sizeof(CmdBuf));
UT_EVS_DoDispatchCheckEvents(&CmdBuf.cmd, sizeof(CmdBuf.cmd), UT_TPID_CFE_EVS_CMD_NOOP_CC, &UT_EVS_EventBuf);
UT_EVS_DoDispatchCheckEvents(&CmdBuf.noopcmd, sizeof(CmdBuf.noopcmd), UT_TPID_CFE_EVS_CMD_NOOP_CC,
&UT_EVS_EventBuf);
UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_NOOP_EID);

/* Clear log for next test */
UT_InitData();
CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true;
UT_EVS_DoDispatchCheckEvents(&CmdBuf.cmd, sizeof(CmdBuf.cmd), UT_TPID_CFE_EVS_CMD_CLEAR_LOG_CC, &UT_EVS_EventBuf);
UT_EVS_DoDispatchCheckEvents(&CmdBuf.clearlogcmd, sizeof(CmdBuf.clearlogcmd), UT_TPID_CFE_EVS_CMD_CLEAR_LOG_CC,
&UT_EVS_EventBuf);
UtAssert_BOOL_FALSE(CFE_EVS_Global.EVS_LogPtr->LogFullFlag);
UtAssert_UINT32_EQ(CFE_EVS_Global.EVS_LogPtr->LogOverflowCounter, 0);

Expand Down Expand Up @@ -1056,7 +1059,7 @@ void Test_WriteApp(void)
{
union
{
CFE_MSG_CommandHeader_t cmd;
CFE_EVS_ResetCountersCmd_t ResetCountersCmd;
CFE_EVS_WriteAppDataFileCmd_t AppDataCmd;
CFE_EVS_AppNameBitMaskCmd_t appbitcmd;
} CmdBuf;
Expand All @@ -1078,8 +1081,8 @@ void Test_WriteApp(void)

/* Test resetting counters */
UT_InitData();
UT_EVS_DoDispatchCheckEvents(&CmdBuf.cmd, sizeof(CmdBuf.cmd), UT_TPID_CFE_EVS_CMD_RESET_COUNTERS_CC,
&UT_EVS_EventBuf);
UT_EVS_DoDispatchCheckEvents(&CmdBuf.ResetCountersCmd, sizeof(CmdBuf.ResetCountersCmd),
UT_TPID_CFE_EVS_CMD_RESET_COUNTERS_CC, &UT_EVS_EventBuf);
UtAssert_UINT32_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_RSTCNT_EID);

/* Test writing application data with a create failure using default
Expand Down Expand Up @@ -1993,7 +1996,7 @@ void Test_Misc(void)
union
{
CFE_MSG_Message_t msg;
CFE_MSG_CommandHeader_t cmd;
CFE_EVS_SendHkCmd_t sendhkcmd;
CFE_EVS_SetLogModeCmd_t modecmd;
CFE_EVS_WriteLogDataFileCmd_t writelogdatacmd;
} PktBuf;
Expand Down Expand Up @@ -2051,7 +2054,7 @@ void Test_Misc(void)
CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true;
HK_SnapshotData.Count = 0;
UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &HK_SnapshotData);
UT_CallTaskPipe(CFE_EVS_ProcessCommandPacket, &PktBuf.msg, sizeof(PktBuf.cmd), UT_TPID_CFE_EVS_SEND_HK);
UT_CallTaskPipe(CFE_EVS_ProcessCommandPacket, &PktBuf.msg, sizeof(PktBuf.sendhkcmd), UT_TPID_CFE_EVS_SEND_HK);
UtAssert_UINT32_EQ(HK_SnapshotData.Count, 1);

/* Test successful application cleanup */
Expand All @@ -2067,7 +2070,7 @@ void Test_Misc(void)
CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = false;
HK_SnapshotData.Count = 0;
UT_SetHookFunction(UT_KEY(CFE_SB_TransmitMsg), UT_SoftwareBusSnapshotHook, &HK_SnapshotData);
UT_CallTaskPipe(CFE_EVS_ProcessCommandPacket, &PktBuf.msg, sizeof(PktBuf.cmd), UT_TPID_CFE_EVS_SEND_HK);
UT_CallTaskPipe(CFE_EVS_ProcessCommandPacket, &PktBuf.msg, sizeof(PktBuf.sendhkcmd), UT_TPID_CFE_EVS_SEND_HK);
UtAssert_UINT32_EQ(HK_SnapshotData.Count, 1);

/* Test sending a packet with the message counter and the event counter
Expand Down
1 change: 1 addition & 0 deletions modules/sb/fsw/inc/cfe_sb_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ typedef CFE_MSG_CommandHeader_t CFE_SB_EnableSubReportingCmd_t;
typedef CFE_MSG_CommandHeader_t CFE_SB_DisableSubReportingCmd_t;
typedef CFE_MSG_CommandHeader_t CFE_SB_SendSbStatsCmd_t;
typedef CFE_MSG_CommandHeader_t CFE_SB_SendPrevSubsCmd_t;
typedef CFE_MSG_CommandHeader_t CFE_SB_SendHkCmd_t;

/**
** \brief Write File Info Command Payload
Expand Down
2 changes: 1 addition & 1 deletion modules/sb/fsw/src/cfe_sb_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReportingCmd_t *data)
* \param[in] data Pointer to command structure
* \return Execution status, see \ref CFEReturnCodes
*/
int32 CFE_SB_SendHKTlmCmd(const CFE_MSG_CommandHeader_t *data);
int32 CFE_SB_SendHKTlmCmd(const CFE_SB_SendHkCmd_t *data);

/*---------------------------------------------------------------------------------------*/
/**
Expand Down
2 changes: 1 addition & 1 deletion modules/sb/fsw/src/cfe_sb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ int32 CFE_SB_DisableSubReportingCmd(const CFE_SB_DisableSubReportingCmd_t *data)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CFE_SB_SendHKTlmCmd(const CFE_MSG_CommandHeader_t *data)
int32 CFE_SB_SendHKTlmCmd(const CFE_SB_SendHkCmd_t *data)
{
CFE_SB_LockSharedData(__FILE__, __LINE__);

Expand Down
8 changes: 4 additions & 4 deletions modules/sb/ut-coverage/sb_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -4321,8 +4321,8 @@ void Test_SB_TransmitMsgPaths_Nominal(void)
{
union
{
CFE_SB_Buffer_t SBBuf;
CFE_MSG_CommandHeader_t Cmd;
CFE_SB_Buffer_t SBBuf;
CFE_SB_SendHkCmd_t SendHkCmd;
} Housekeeping;
CFE_SB_MsgId_t MsgId;
CFE_SB_PipeId_t PipeId = CFE_SB_INVALID_PIPE;
Expand All @@ -4335,7 +4335,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void)
memset(&TlmPkt, 0, sizeof(TlmPkt));

/* Set up for dispatch FIRST */
UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.Cmd), false);
UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.SendHkCmd), false);

/* For internal send message call */
MsgId = CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID);
Expand All @@ -4357,7 +4357,7 @@ void Test_SB_TransmitMsgPaths_Nominal(void)
CFE_SB_Global.StopRecurseFlags[1] |= CFE_BIT(CFE_SB_GET_BUF_ERR_EID_BIT);

/* Set up for dispatch FIRST */
UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.Cmd), false);
UT_SetupBasicMsgDispatch(&UT_TPID_CFE_SB_SEND_HK, sizeof(Housekeeping.SendHkCmd), false);

/* For internal send message call */
MsgId = CFE_SB_ValueToMsgId(CFE_SB_HK_TLM_MID);
Expand Down
1 change: 1 addition & 0 deletions modules/tbl/fsw/inc/cfe_tbl_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ typedef struct CFE_TBL_NoArgsCmd
*/
typedef CFE_TBL_NoArgsCmd_t CFE_TBL_NoopCmd_t;
typedef CFE_TBL_NoArgsCmd_t CFE_TBL_ResetCountersCmd_t;
typedef CFE_TBL_NoArgsCmd_t CFE_TBL_SendHkCmd_t;

/**
** \brief Load Table Command Payload
Expand Down
19 changes: 11 additions & 8 deletions modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ void Test_CFE_TBL_TaskInit(void)
uint32 ExitCode;
union
{
CFE_MSG_CommandHeader_t NoArgsCmd;
CFE_MSG_Message_t Msg;
CFE_TBL_NoopCmd_t NoopCmd;
CFE_TBL_SendHkCmd_t SendHkCmd;
CFE_TBL_ResetCountersCmd_t ResetCountersCmd;
CFE_MSG_Message_t Msg;
} CmdBuf;
CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID;
CFE_MSG_FcnCode_t FcnCode = 0;
Expand Down Expand Up @@ -298,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.NoArgsCmd), UT_TPID_CFE_TBL_CMD_NOOP_CC);
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, 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.NoArgsCmd) - 1, UT_TPID_CFE_TBL_CMD_NOOP_CC);
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, 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.NoArgsCmd), UT_TPID_CFE_TBL_CMD_INVALID_CC);
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, 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.NoArgsCmd), UT_TPID_CFE_TBL_INVALID_MID);
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, 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);
Expand All @@ -328,13 +330,14 @@ 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.NoArgsCmd), UT_TPID_CFE_TBL_MSG_HK);
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, 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.NoArgsCmd), UT_TPID_CFE_TBL_CMD_RESET_COUNTERS_CC);
UT_CallTaskPipe(CFE_TBL_TaskPipe, &CmdBuf.Msg, 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);
UtAssert_ZERO(CFE_TBL_Global.CommandErrorCounter);
Expand Down
1 change: 1 addition & 0 deletions modules/time/fsw/inc/cfe_time_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendDiagnosticCmd_t;
typedef CFE_TIME_NoArgsCmd_t CFE_TIME_1HzCmd_t;
typedef CFE_TIME_NoArgsCmd_t CFE_TIME_ToneSignalCmd_t;
typedef CFE_TIME_NoArgsCmd_t CFE_TIME_FakeToneCmd_t;
typedef CFE_TIME_NoArgsCmd_t CFE_TIME_SendHkCmd_t;

/**
* \brief Set leap seconds command payload
Expand Down
4 changes: 2 additions & 2 deletions modules/time/fsw/src/cfe_time_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void CFE_TIME_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
** Housekeeping telemetry request...
*/
case CFE_TIME_SEND_HK_MID:
CFE_TIME_HousekeepingCmd((CFE_MSG_CommandHeader_t *)SBBufPtr);
CFE_TIME_HousekeepingCmd((CFE_TIME_SendHkCmd_t *)SBBufPtr);
break;

/*
Expand Down Expand Up @@ -547,7 +547,7 @@ void CFE_TIME_TaskPipe(CFE_SB_Buffer_t *SBBufPtr)
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CFE_TIME_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data)
int32 CFE_TIME_HousekeepingCmd(const CFE_TIME_SendHkCmd_t *data)
{
CFE_TIME_Reference_t Reference;

Expand Down
2 changes: 1 addition & 1 deletion modules/time/fsw/src/cfe_time_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ void CFE_TIME_Local1HzTimerCallback(osal_id_t TimerId, void *Arg);
/**
* @brief Onboard command (HK request)
*/
int32 CFE_TIME_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data);
int32 CFE_TIME_HousekeepingCmd(const CFE_TIME_SendHkCmd_t *data);

/*
** Command handler for "tone signal detected"...
Expand Down
Loading

0 comments on commit 9b047b8

Please sign in to comment.