From 5039f7c22cc72e751ed37da60735d386e02ad457 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 13 Feb 2023 15:39:25 -0500 Subject: [PATCH] Fix #15, use CFE_MSG_PTR macro This requires headers to be named correctly per CFE_MSG definitions. Includes other remaining cleanup items --- fsw/inc/fm_msg.h | 68 ++++---- fsw/inc/fm_msgdefs.h | 18 +- fsw/src/fm_app.c | 12 +- fsw/src/fm_app.h | 8 +- fsw/src/fm_child.c | 32 ++-- fsw/src/fm_child.h | 26 +-- fsw/src/fm_cmds.c | 53 +++--- fsw/src/fm_cmds.h | 18 +- unit-test/fm_app_tests.c | 18 +- unit-test/fm_child_tests.c | 262 ++++++++++++++-------------- unit-test/fm_cmds_tests.c | 22 +-- unit-test/stubs/fm_app_stubs.c | 8 +- unit-test/stubs/fm_child_stubs.c | 40 ++--- unit-test/utilities/fm_test_utils.h | 20 +-- 14 files changed, 304 insertions(+), 301 deletions(-) diff --git a/fsw/inc/fm_msg.h b/fsw/inc/fm_msg.h index e6e51d6..effa552 100644 --- a/fsw/inc/fm_msg.h +++ b/fsw/inc/fm_msg.h @@ -44,8 +44,8 @@ */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ -} FM_HousekeepingCmd_t; + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ +} FM_SendHkCmd_t; /** * \brief No-Operation command packet structure @@ -54,7 +54,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } FM_NoopCmd_t; /** @@ -64,8 +64,8 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ -} FM_ResetCmd_t; + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ +} FM_ResetCountersCmd_t; /** * \brief Copy/Move File command payload structure @@ -88,7 +88,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_OvwSourceTargetFilename_Payload_t Payload; /**< \brief Command payload */ } FM_CopyFileCmd_t; @@ -100,7 +100,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_OvwSourceTargetFilename_Payload_t Payload; /**< \brief Command payload */ @@ -124,7 +124,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_SourceTargetFileName_Payload_t Payload; /**< \brief Command payload */ } FM_RenameFileCmd_t; @@ -146,7 +146,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_SingleFilename_Payload_t Payload; /**< \brief Command Payload */ } FM_DeleteFileCmd_t; @@ -168,10 +168,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_DirectoryName_Payload_t Payload; /**< \brief Command Payload */ -} FM_DeleteAllCmd_t; +} FM_DeleteAllFilesCmd_t; /** * \brief Decompress File command packet structure @@ -180,10 +180,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_SourceTargetFileName_Payload_t Payload; /**< \brief Command Payload */ -} FM_DecompressCmd_t; +} FM_DecompressFileCmd_t; /** * \brief Two source, one target filename command payload structure @@ -204,10 +204,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_TwoSourceOneTarget_Payload_t Payload; /**< \brief Command Payload */ -} FM_ConcatCmd_t; +} FM_ConcatFilesCmd_t; /** * \brief Filename and CRC command payload structure @@ -227,7 +227,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_FilenameAndCRC_Payload_t Payload; /**< \brief Command Payload */ } FM_GetFileInfoCmd_t; @@ -239,7 +239,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } FM_GetOpenFilesCmd_t; /** @@ -249,10 +249,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_DirectoryName_Payload_t Payload; /**< \brief Command Payload */ -} FM_CreateDirCmd_t; +} FM_CreateDirectoryCmd_t; /** * \brief Delete Directory command packet structure @@ -261,10 +261,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_DirectoryName_Payload_t Payload; /**< \brief Command Payload */ -} FM_DeleteDirCmd_t; +} FM_DeleteDirectoryCmd_t; /** * \brief Get Directory and output to file command payload @@ -287,10 +287,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_GetDirectoryToFile_Payload_t Payload; /**< \brief Command Payload */ -} FM_GetDirFileCmd_t; +} FM_GetDirListFileCmd_t; /** * \brief Get Directory and output to message command payload @@ -313,10 +313,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_GetDirectoryToPkt_Payload_t Payload; /**< \brief Command Payload */ -} FM_GetDirPktCmd_t; +} FM_GetDirListPktCmd_t; /** * \brief Get Free Space command packet structure @@ -325,7 +325,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ } FM_MonitorFilesystemSpaceCmd_t; /** @@ -346,7 +346,7 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_TableIndexAndState_Payload_t Payload; /**< \brief Command Payload */ } FM_SetTableStateCmd_t; @@ -369,10 +369,10 @@ typedef struct */ typedef struct { - CFE_MSG_CommandHeader_t CmdHeader; /**< \brief Command header */ + CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ FM_FilenameAndMode_Payload_t Payload; -} FM_SetPermCmd_t; +} FM_SetPermissionsCmd_t; /**\}*/ @@ -415,7 +415,7 @@ typedef struct */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry Header */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry Header */ FM_DirListPkt_Payload_t Payload; /**< \brief Telemetry Payload */ } FM_DirListPkt_t; @@ -462,7 +462,7 @@ typedef struct */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry Header */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry Header */ FM_FileInfoPkt_Payload_t Payload; /**< \brief Telemetry Payload */ } FM_FileInfoPkt_t; @@ -496,7 +496,7 @@ typedef struct */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry Header */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry Header */ FM_OpenFilesPkt_Payload_t Payload; /**< \brief Telemetry Payload */ } FM_OpenFilesPkt_t; @@ -531,7 +531,7 @@ typedef struct */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry Header */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry Header */ FM_MonitorReportPkt_Payload_t Payload; /**< \brief Telemetry Payload */ } FM_MonitorReportPkt_t; @@ -568,7 +568,7 @@ typedef struct */ typedef struct { - CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry Header */ + CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry Header */ FM_HousekeepingPkt_Payload_t Payload; /**< \brief Telemetry Payload */ } FM_HousekeepingPkt_t; diff --git a/fsw/inc/fm_msgdefs.h b/fsw/inc/fm_msgdefs.h index 8180b03..7d9e218 100644 --- a/fsw/inc/fm_msgdefs.h +++ b/fsw/inc/fm_msgdefs.h @@ -71,7 +71,7 @@ * - #FM_HousekeepingPkt_Payload_t.ChildCmdWarnCounter * * \par Command Packet Structure - * #FM_ResetCmd_t + * #FM_ResetCountersCmd_t * * \par Command Success Verification * - Command counters will be set to zero (see description) @@ -351,7 +351,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_DeleteAllCmd_t + * #FM_DeleteAllFilesCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation @@ -418,7 +418,7 @@ * will generate an error event. * * \par Command Packet Structure - * #FM_DecompressCmd_t + * #FM_DecompressFileCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation @@ -474,7 +474,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_ConcatCmd_t + * #FM_ConcatFilesCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation @@ -628,7 +628,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_CreateDirCmd_t + * #FM_CreateDirectoryCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation @@ -676,7 +676,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_DeleteDirCmd_t + * #FM_DeleteDirectoryCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation @@ -731,7 +731,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_GetDirFileCmd_t + * #FM_GetDirListFileCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation @@ -811,7 +811,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_GetDirPktCmd_t + * #FM_GetDirListPktCmd_t * * \par Command Verification * Successful execution of this command may be verified with @@ -943,7 +943,7 @@ * the child task interface queue. * * \par Command Packet Structure - * #FM_SetPermCmd_t + * #FM_SetPermissionsCmd_t * * \par Command Success Verification * - #FM_HousekeepingPkt_Payload_t.CommandCounter will increment after validation diff --git a/fsw/src/fm_app.c b/fsw/src/fm_app.c index d6650cd..148fee1 100644 --- a/fsw/src/fm_app.c +++ b/fsw/src/fm_app.c @@ -257,7 +257,7 @@ void FM_ProcessPkt(const CFE_SB_Buffer_t *BufPtr) { /* Housekeeping request */ case FM_SEND_HK_MID: - FM_ReportHK((CFE_MSG_CommandHeader_t *)BufPtr); + FM_SendHkCmd(BufPtr); break; /* FM ground commands */ @@ -387,14 +387,14 @@ void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr) /* FM application -- housekeeping request packet processor */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_ReportHK(const CFE_MSG_CommandHeader_t *Msg) +void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr) { const char * CmdText = "HK Request"; bool Result = true; FM_HousekeepingPkt_Payload_t *PayloadPtr; /* Verify command packet length */ - Result = FM_IsValidCmdPktLength(&Msg->Msg, sizeof(FM_HousekeepingCmd_t), FM_HK_REQ_ERR_EID, CmdText); + Result = FM_IsValidCmdPktLength(CFE_MSG_PTR(*BufPtr), sizeof(FM_SendHkCmd_t), FM_HK_REQ_ERR_EID, CmdText); if (Result == true) { @@ -403,7 +403,7 @@ void FM_ReportHK(const CFE_MSG_CommandHeader_t *Msg) FM_AcquireTablePointers(); /* Initialize housekeeping telemetry message */ - CFE_MSG_Init(&FM_GlobalData.HousekeepingPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(FM_HK_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(FM_GlobalData.HousekeepingPkt.TelemetryHeader), CFE_SB_ValueToMsgId(FM_HK_TLM_MID), sizeof(FM_HousekeepingPkt_t)); PayloadPtr = &FM_GlobalData.HousekeepingPkt.Payload; @@ -425,7 +425,7 @@ void FM_ReportHK(const CFE_MSG_CommandHeader_t *Msg) PayloadPtr->ChildCurrentCC = FM_GlobalData.ChildCurrentCC; PayloadPtr->ChildPreviousCC = FM_GlobalData.ChildPreviousCC; - CFE_SB_TimeStampMsg(&FM_GlobalData.HousekeepingPkt.TlmHeader.Msg); - CFE_SB_TransmitMsg(&FM_GlobalData.HousekeepingPkt.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(FM_GlobalData.HousekeepingPkt.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(FM_GlobalData.HousekeepingPkt.TelemetryHeader), true); } } diff --git a/fsw/src/fm_app.h b/fsw/src/fm_app.h index 269a9b3..589448f 100644 --- a/fsw/src/fm_app.h +++ b/fsw/src/fm_app.h @@ -172,7 +172,7 @@ int32 FM_AppInit(void); * * \param [in] MessagePtr Pointer to Software Bus message buffer. * - * \sa #FM_ReportHK, #FM_ProcessCmd + * \sa #FM_SendHkCmd, #FM_ProcessCmd */ void FM_ProcessPkt(const CFE_SB_Buffer_t *MessagePtr); @@ -202,11 +202,11 @@ void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr); * * \par Assumptions, External Events, and Notes: None * - * \param [in] Msg Pointer to Software Bus command packet. + * \param [in] BufPtr Pointer to Software Bus command packet. * - * \sa #FM_HousekeepingCmd_t, #FM_HousekeepingPkt_t + * \sa #FM_SendHkCmd_t, #FM_HousekeepingPkt_t */ -void FM_ReportHK(const CFE_MSG_CommandHeader_t *Msg); +void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ diff --git a/fsw/src/fm_child.c b/fsw/src/fm_child.c index 35e2e78..3d09b45 100644 --- a/fsw/src/fm_child.c +++ b/fsw/src/fm_child.c @@ -215,23 +215,23 @@ void FM_ChildProcess(void) break; case FM_DELETE_ALL_CC: - FM_ChildDeleteAllCmd(CmdArgs); + FM_ChildDeleteAllFilesCmd(CmdArgs); break; case FM_DECOMPRESS_CC: - FM_ChildDecompressCmd(CmdArgs); + FM_ChildDecompressFileCmd(CmdArgs); break; case FM_CONCAT_CC: - FM_ChildConcatCmd(CmdArgs); + FM_ChildConcatFilesCmd(CmdArgs); break; case FM_CREATE_DIR_CC: - FM_ChildCreateDirCmd(CmdArgs); + FM_ChildCreateDirectoryCmd(CmdArgs); break; case FM_DELETE_DIR_CC: - FM_ChildDeleteDirCmd(CmdArgs); + FM_ChildDeleteDirectoryCmd(CmdArgs); break; case FM_GET_FILE_INFO_CC: @@ -434,7 +434,7 @@ void FM_ChildDeleteCmd(const FM_ChildQueueEntry_t *CmdArgs) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_ChildDeleteAllCmd(FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildDeleteAllFilesCmd(FM_ChildQueueEntry_t *CmdArgs) { const char *CmdText = "Delete All Files"; osal_id_t DirId = OS_OBJECT_ID_UNDEFINED; @@ -585,7 +585,7 @@ void FM_ChildDeleteAllCmd(FM_ChildQueueEntry_t *CmdArgs) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_ChildDecompressCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildDecompressFileCmd(const FM_ChildQueueEntry_t *CmdArgs) { const char *CmdText = "Decompress File"; int32 CFE_Status = CFE_SUCCESS; @@ -625,7 +625,7 @@ void FM_ChildDecompressCmd(const FM_ChildQueueEntry_t *CmdArgs) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_ChildConcatCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildConcatFilesCmd(const FM_ChildQueueEntry_t *CmdArgs) { const char *CmdText = "Concat Files"; bool ConcatResult = false; @@ -825,7 +825,7 @@ void FM_ChildFileInfoCmd(FM_ChildQueueEntry_t *CmdArgs) */ /* Initialize file info packet (set all data to zero) */ - CFE_MSG_Init(&FM_GlobalData.FileInfoPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(FM_FILE_INFO_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(FM_GlobalData.FileInfoPkt.TelemetryHeader), CFE_SB_ValueToMsgId(FM_FILE_INFO_TLM_MID), sizeof(FM_FileInfoPkt_t)); ReportPtr = &FM_GlobalData.FileInfoPkt.Payload; @@ -941,8 +941,8 @@ void FM_ChildFileInfoCmd(FM_ChildQueueEntry_t *CmdArgs) } /* Timestamp and send file info telemetry packet */ - CFE_SB_TimeStampMsg(&FM_GlobalData.FileInfoPkt.TlmHeader.Msg); - CFE_SB_TransmitMsg(&FM_GlobalData.FileInfoPkt.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(FM_GlobalData.FileInfoPkt.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(FM_GlobalData.FileInfoPkt.TelemetryHeader), true); FM_GlobalData.ChildCmdCounter++; @@ -961,7 +961,7 @@ void FM_ChildFileInfoCmd(FM_ChildQueueEntry_t *CmdArgs) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_ChildCreateDirCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildCreateDirectoryCmd(const FM_ChildQueueEntry_t *CmdArgs) { const char *CmdText = "Create Directory"; int32 OS_Status = OS_SUCCESS; @@ -1000,7 +1000,7 @@ void FM_ChildCreateDirCmd(const FM_ChildQueueEntry_t *CmdArgs) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_ChildDeleteDirCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildDeleteDirectoryCmd(const FM_ChildQueueEntry_t *CmdArgs) { const char *CmdText = "Delete Directory"; bool RemoveTheDir = true; @@ -1183,7 +1183,7 @@ void FM_ChildDirListPktCmd(const FM_ChildQueueEntry_t *CmdArgs) else { /* Initialize the directory list telemetry packet */ - CFE_MSG_Init(&FM_GlobalData.DirListPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(FM_DIR_LIST_TLM_MID), + CFE_MSG_Init(CFE_MSG_PTR(FM_GlobalData.DirListPkt.TelemetryHeader), CFE_SB_ValueToMsgId(FM_DIR_LIST_TLM_MID), sizeof(FM_DirListPkt_t)); ReportPtr = &FM_GlobalData.DirListPkt.Payload; @@ -1253,8 +1253,8 @@ void FM_ChildDirListPktCmd(const FM_ChildQueueEntry_t *CmdArgs) OS_DirectoryClose(DirId); /* Timestamp and send directory listing telemetry packet */ - CFE_SB_TimeStampMsg(&FM_GlobalData.DirListPkt.TlmHeader.Msg); - CFE_SB_TransmitMsg(&FM_GlobalData.DirListPkt.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(FM_GlobalData.DirListPkt.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(FM_GlobalData.DirListPkt.TelemetryHeader), true); /* Send command completion event (info) */ CFE_EVS_SendEvent(FM_GET_DIR_PKT_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command: offset = %d, dir = %s", CmdText, diff --git a/fsw/src/fm_child.h b/fsw/src/fm_child.h index c5d6fab..db68fa8 100644 --- a/fsw/src/fm_child.h +++ b/fsw/src/fm_child.h @@ -188,9 +188,9 @@ void FM_ChildDeleteCmd(const FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_DeleteAllCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_DeleteAllFilesCmd_t */ -void FM_ChildDeleteAllCmd(FM_ChildQueueEntry_t *CmdArgs); +void FM_ChildDeleteAllFilesCmd(FM_ChildQueueEntry_t *CmdArgs); /** * \brief Child Task Decompress File Command Handler @@ -205,9 +205,9 @@ void FM_ChildDeleteAllCmd(FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_DecompressCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_DecompressFileCmd_t */ -void FM_ChildDecompressCmd(const FM_ChildQueueEntry_t *CmdArgs); +void FM_ChildDecompressFileCmd(const FM_ChildQueueEntry_t *CmdArgs); /** * \brief Child Task Concatenate Files Command Handler @@ -222,9 +222,9 @@ void FM_ChildDecompressCmd(const FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_ConcatCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_ConcatFilesCmd_t */ -void FM_ChildConcatCmd(const FM_ChildQueueEntry_t *CmdArgs); +void FM_ChildConcatFilesCmd(const FM_ChildQueueEntry_t *CmdArgs); /** * \brief Child Task Get File Info Command Handler @@ -256,9 +256,9 @@ void FM_ChildFileInfoCmd(FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_CreateDirCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_CreateDirectoryCmd_t */ -void FM_ChildCreateDirCmd(const FM_ChildQueueEntry_t *CmdArgs); +void FM_ChildCreateDirectoryCmd(const FM_ChildQueueEntry_t *CmdArgs); /** * \brief Child Task Delete Directory Command Handler @@ -273,9 +273,9 @@ void FM_ChildCreateDirCmd(const FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_DeleteDirCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_DeleteDirectoryCmd_t */ -void FM_ChildDeleteDirCmd(const FM_ChildQueueEntry_t *CmdArgs); +void FM_ChildDeleteDirectoryCmd(const FM_ChildQueueEntry_t *CmdArgs); /** * \brief Child Task Get Dir List to File Command Handler @@ -290,7 +290,7 @@ void FM_ChildDeleteDirCmd(const FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_GetDirFileCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_GetDirListFileCmd_t */ void FM_ChildDirListFileCmd(const FM_ChildQueueEntry_t *CmdArgs); @@ -307,7 +307,7 @@ void FM_ChildDirListFileCmd(const FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_GetDirPktCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_GetDirListPktCmd_t */ void FM_ChildDirListPktCmd(const FM_ChildQueueEntry_t *CmdArgs); @@ -324,7 +324,7 @@ void FM_ChildDirListPktCmd(const FM_ChildQueueEntry_t *CmdArgs); * \param [in] CmdArgs A pointer to an entry in the child task handshake command * queue which contains the arguments necessary to process this command. * - * \sa #FM_ChildQueueEntry_t, #FM_SetPermCmd_t + * \sa #FM_ChildQueueEntry_t, #FM_SetPermissionsCmd_t */ void FM_ChildSetPermissionsCmd(const FM_ChildQueueEntry_t *CmdArgs); diff --git a/fsw/src/fm_cmds.c b/fsw/src/fm_cmds.c index 4fc3fe0..6417680 100644 --- a/fsw/src/fm_cmds.c +++ b/fsw/src/fm_cmds.c @@ -83,7 +83,7 @@ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) bool CommandResult = false; /* Verify message length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_ResetCmd_t), FM_RESET_PKT_ERR_EID, CmdText); + CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_ResetCountersCmd_t), FM_RESET_PKT_ERR_EID, CmdText); /* Reset command counters */ if (CommandResult == true) @@ -355,10 +355,11 @@ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr) FM_ChildQueueEntry_t *CmdArgs = NULL; bool CommandResult = false; - const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteAllCmd_t); + const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteAllFilesCmd_t); /* Verify message length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteAllCmd_t), FM_DELETE_ALL_PKT_ERR_EID, CmdText); + CommandResult = + FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteAllFilesCmd_t), FM_DELETE_ALL_PKT_ERR_EID, CmdText); /* Verify that the directory exists */ if (CommandResult == true) @@ -410,10 +411,10 @@ bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr) FM_ChildQueueEntry_t *CmdArgs = NULL; bool CommandResult = false; - const FM_SourceTargetFileName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DecompressCmd_t); + const FM_SourceTargetFileName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DecompressFileCmd_t); /* Verify command packet length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DecompressCmd_t), FM_DECOM_PKT_ERR_EID, CmdText); + CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DecompressFileCmd_t), FM_DECOM_PKT_ERR_EID, CmdText); /* Verify that source file exists, is not a directory and is not open */ if (CommandResult == true) @@ -464,10 +465,10 @@ bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr) FM_ChildQueueEntry_t *CmdArgs = NULL; bool CommandResult = false; - const FM_TwoSourceOneTarget_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_ConcatCmd_t); + const FM_TwoSourceOneTarget_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_ConcatFilesCmd_t); /* Verify command packet length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_ConcatCmd_t), FM_CONCAT_PKT_ERR_EID, CmdText); + CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_ConcatFilesCmd_t), FM_CONCAT_PKT_ERR_EID, CmdText); /* Verify that source file #1 exists, is not a directory and is not open */ if (CommandResult == true) @@ -596,8 +597,8 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) if (CommandResult == true) { /* Initialize open files telemetry packet */ - CFE_MSG_Init(&FM_GlobalData.OpenFilesPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(FM_OPEN_FILES_TLM_MID), - sizeof(FM_OpenFilesPkt_t)); + CFE_MSG_Init(CFE_MSG_PTR(FM_GlobalData.OpenFilesPkt.TelemetryHeader), + CFE_SB_ValueToMsgId(FM_OPEN_FILES_TLM_MID), sizeof(FM_OpenFilesPkt_t)); /* Get list of open files and count */ NumOpenFiles = FM_GetOpenFilesData(ReportPtr->OpenFilesList); @@ -605,8 +606,8 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) ReportPtr->NumOpenFiles = NumOpenFiles; /* Timestamp and send open files telemetry packet */ - CFE_SB_TimeStampMsg(&FM_GlobalData.OpenFilesPkt.TlmHeader.Msg); - CFE_SB_TransmitMsg(&FM_GlobalData.OpenFilesPkt.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(FM_GlobalData.OpenFilesPkt.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(FM_GlobalData.OpenFilesPkt.TelemetryHeader), true); /* Send command completion event (debug) */ CFE_EVS_SendEvent(FM_GET_OPEN_FILES_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText); @@ -627,10 +628,11 @@ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) const char * CmdText = "Create Directory"; bool CommandResult = false; - const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_CreateDirCmd_t); + const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_CreateDirectoryCmd_t); /* Verify command packet length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_CreateDirCmd_t), FM_CREATE_DIR_PKT_ERR_EID, CmdText); + CommandResult = + FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_CreateDirectoryCmd_t), FM_CREATE_DIR_PKT_ERR_EID, CmdText); /* Verify that the directory name is not already in use */ if (CommandResult == true) @@ -674,10 +676,11 @@ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) const char * CmdText = "Delete Directory"; bool CommandResult = false; - const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteDirCmd_t); + const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteDirectoryCmd_t); /* Verify command packet length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteDirCmd_t), FM_DELETE_DIR_PKT_ERR_EID, CmdText); + CommandResult = + FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteDirectoryCmd_t), FM_DELETE_DIR_PKT_ERR_EID, CmdText); /* Verify that the directory exists */ if (CommandResult == true) @@ -723,11 +726,11 @@ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr) FM_ChildQueueEntry_t *CmdArgs = NULL; bool CommandResult = false; - const FM_GetDirectoryToFile_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_GetDirFileCmd_t); + const FM_GetDirectoryToFile_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_GetDirListFileCmd_t); /* Verify command packet length */ CommandResult = - FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetDirFileCmd_t), FM_GET_DIR_FILE_PKT_ERR_EID, CmdText); + FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetDirListFileCmd_t), FM_GET_DIR_FILE_PKT_ERR_EID, CmdText); /* Verify that source directory exists */ if (CommandResult == true) @@ -802,11 +805,11 @@ bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr) FM_ChildQueueEntry_t *CmdArgs = NULL; bool CommandResult = false; - const FM_GetDirectoryToPkt_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_GetDirPktCmd_t); + const FM_GetDirectoryToPkt_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_GetDirListPktCmd_t); /* Verify command packet length */ CommandResult = - FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetDirPktCmd_t), FM_GET_DIR_PKT_PKT_ERR_EID, CmdText); + FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetDirListPktCmd_t), FM_GET_DIR_PKT_PKT_ERR_EID, CmdText); /* Verify that source directory exists */ if (CommandResult == true) @@ -880,8 +883,8 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) else { /* Initialize the file system free space telemetry packet */ - CFE_MSG_Init(&FM_GlobalData.MonitorReportPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(FM_FREE_SPACE_TLM_MID), - sizeof(FM_MonitorReportPkt_t)); + CFE_MSG_Init(CFE_MSG_PTR(FM_GlobalData.MonitorReportPkt.TelemetryHeader), + CFE_SB_ValueToMsgId(FM_FREE_SPACE_TLM_MID), sizeof(FM_MonitorReportPkt_t)); /* Process enabled file system table entries */ MonitorPtr = FM_GlobalData.MonitorTablePtr->Entries; @@ -931,8 +934,8 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) } /* Timestamp and send file system free space telemetry packet */ - CFE_SB_TimeStampMsg(&FM_GlobalData.MonitorReportPkt.TlmHeader.Msg); - CFE_SB_TransmitMsg(&FM_GlobalData.MonitorReportPkt.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(FM_GlobalData.MonitorReportPkt.TelemetryHeader)); + CFE_SB_TransmitMsg(CFE_MSG_PTR(FM_GlobalData.MonitorReportPkt.TelemetryHeader), true); /* Send command completion event (debug) */ CFE_EVS_SendEvent(FM_MONITOR_FILESYSTEM_SPACE_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText); @@ -1026,10 +1029,10 @@ bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr) bool CommandResult = false; bool FilenameState = FM_NAME_IS_INVALID; - const FM_FilenameAndMode_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_SetPermCmd_t); + const FM_FilenameAndMode_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_SetPermissionsCmd_t); /* Verify command packet length */ - CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SetPermCmd_t), FM_SET_PERM_ERR_EID, CmdText); + CommandResult = FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SetPermissionsCmd_t), FM_SET_PERM_ERR_EID, CmdText); if (CommandResult == true) { diff --git a/fsw/src/fm_cmds.h b/fsw/src/fm_cmds.h index 6e2ebb2..c0566c2 100644 --- a/fsw/src/fm_cmds.h +++ b/fsw/src/fm_cmds.h @@ -65,7 +65,7 @@ bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_RESET_CC, #FM_ResetCmd_t + * \sa #FM_RESET_CC, #FM_ResetCountersCmd_t */ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr); @@ -173,7 +173,7 @@ bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_DELETE_ALL_CC, #FM_DeleteAllCmd_t + * \sa #FM_DELETE_ALL_CC, #FM_DeleteAllFilesCmd_t */ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr); @@ -200,7 +200,7 @@ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_DECOMPRESS_CC, #FM_DecompressCmd_t + * \sa #FM_DECOMPRESS_CC, #FM_DecompressFileCmd_t */ bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr); @@ -228,7 +228,7 @@ bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_CONCAT_CC, #FM_ConcatCmd_t + * \sa #FM_CONCAT_CC, #FM_ConcatFilesCmd_t */ bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr); @@ -292,7 +292,7 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_CREATE_DIR_CC, #FM_CreateDirCmd_t + * \sa #FM_CREATE_DIR_CC, #FM_CreateDirectoryCmd_t */ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); @@ -310,7 +310,7 @@ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_DELETE_DIR_CC, #FM_DeleteDirCmd_t + * \sa #FM_DELETE_DIR_CC, #FM_DeleteDirectoryCmd_t */ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); @@ -336,7 +336,7 @@ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_GET_DIR_FILE_CC, #FM_GetDirFileCmd_t, + * \sa #FM_GET_DIR_FILE_CC, #FM_GetDirListFileCmd_t, * #FM_DirListFileStats_t, FM_DirListEntry_t */ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr); @@ -364,7 +364,7 @@ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_GET_DIR_PKT_CC, #FM_GetDirPktCmd_t, #FM_DirListPkt_t + * \sa #FM_GET_DIR_PKT_CC, #FM_GetDirListPktCmd_t, #FM_DirListPkt_t */ bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr); @@ -421,7 +421,7 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr); * \retval true Command successful * \retval false Command not successful * - * \sa #FM_SET_FILE_PERM_CC, #FM_SetPermCmd_t, #FM_SET_PERM_CMD_EID, #FM_SET_PERM_ERR_EID + * \sa #FM_SET_FILE_PERM_CC, #FM_SetPermissionsCmd_t, #FM_SET_PERM_CMD_EID, #FM_SET_PERM_ERR_EID */ bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr); diff --git a/unit-test/fm_app_tests.c b/unit-test/fm_app_tests.c index ecdc67e..3b03ae1 100644 --- a/unit-test/fm_app_tests.c +++ b/unit-test/fm_app_tests.c @@ -347,7 +347,7 @@ void Test_FM_AppInit_TableInitSuccess(void) /* ******************************** * Report HK Tests * *******************************/ -void Test_FM_ReportHK_ReturnPktLengthTrue(void) +void Test_FM_SendHkCmd_ReturnPktLengthTrue(void) { FM_HousekeepingPkt_Payload_t *ReportPtr; @@ -366,7 +366,7 @@ void Test_FM_ReportHK_ReturnPktLengthTrue(void) FM_GlobalData.ChildPreviousCC = 8; /* Act */ - UtAssert_VOIDCALL(FM_ReportHK(NULL)); + UtAssert_VOIDCALL(FM_SendHkCmd(NULL)); /* Assert */ UtAssert_STUB_COUNT(FM_IsValidCmdPktLength, 1); @@ -389,13 +389,13 @@ void Test_FM_ReportHK_ReturnPktLengthTrue(void) UtAssert_INT32_EQ(ReportPtr->ChildPreviousCC, FM_GlobalData.ChildPreviousCC); } -void Test_FM_ReportHK_ReturnPktLengthFalse(void) +void Test_FM_SendHkCmd_ReturnPktLengthFalse(void) { /* Arrange */ UT_SetDefaultReturnValue(UT_KEY(FM_IsValidCmdPktLength), false); /* Act */ - UtAssert_VOIDCALL(FM_ReportHK(NULL)); + UtAssert_VOIDCALL(FM_SendHkCmd(NULL)); /* Assert */ UtAssert_STUB_COUNT(FM_ReleaseTablePointers, 0); @@ -859,11 +859,11 @@ void add_FM_ProcessCmd_tests(void) UtTest_Add(Test_FM_ProcessCmd_DefaultReturn, FM_Test_Setup, FM_Test_Teardown, "Test_FM_PRocessCmd_DefaultReturn"); } -void add_FM_ReportHK_tests(void) +void add_FM_SendHkCmd_tests(void) { - UtTest_Add(Test_FM_ReportHK_ReturnPktLengthTrue, FM_Test_Setup, FM_Test_Teardown, "Test_FM_ReportHK_Return"); - UtTest_Add(Test_FM_ReportHK_ReturnPktLengthFalse, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ReportHK_ReturnPktLengthFalse"); + UtTest_Add(Test_FM_SendHkCmd_ReturnPktLengthTrue, FM_Test_Setup, FM_Test_Teardown, "Test_FM_SendHkCmd_Return"); + UtTest_Add(Test_FM_SendHkCmd_ReturnPktLengthFalse, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_SendHkCmd_ReturnPktLengthFalse"); } /* @@ -874,6 +874,6 @@ void UtTest_Setup(void) add_FM_ProcessPkt_tests(); add_FM_AppInit_tests(); add_FM_AppMain_tests(); - add_FM_ReportHK_tests(); + add_FM_SendHkCmd_tests(); add_FM_ProcessCmd_tests(); } diff --git a/unit-test/fm_child_tests.c b/unit-test/fm_child_tests.c index 606a473..2db252e 100644 --- a/unit-test/fm_child_tests.c +++ b/unit-test/fm_child_tests.c @@ -583,9 +583,9 @@ void Test_FM_ChildDeleteCmd_OSRemoveNotSuccess(void) } /* **************** - * ChildDeleteAllCmd Tests + * ChildDeleteAllFilesCmd Tests * ***************/ -void Test_FM_ChildDeleteAllCmd_DirOpenNotSuccess(void) +void Test_FM_ChildDeleteAllFilesCmd_DirOpenNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -594,7 +594,7 @@ void Test_FM_ChildDeleteAllCmd_DirOpenNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_DirectoryOpen), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -606,7 +606,7 @@ void Test_FM_ChildDeleteAllCmd_DirOpenNotSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_ALL_OS_ERR_EID); } -void Test_FM_ChildDeleteAllCmd_DirReadNotSuccess(void) +void Test_FM_ChildDeleteAllFilesCmd_DirReadNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -615,7 +615,7 @@ void Test_FM_ChildDeleteAllCmd_DirReadNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_DirectoryRead), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -627,7 +627,7 @@ void Test_FM_ChildDeleteAllCmd_DirReadNotSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_ALL_CMD_EID); } -void Test_FM_ChildDeleteAllCmd_DirEntryThisDirectory(void) +void Test_FM_ChildDeleteAllFilesCmd_DirEntryThisDirectory(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -638,7 +638,7 @@ void Test_FM_ChildDeleteAllCmd_DirEntryThisDirectory(void) UT_SetDataBuffer(UT_KEY(OS_DirectoryRead), &direntry, sizeof(direntry), false); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -652,7 +652,7 @@ void Test_FM_ChildDeleteAllCmd_DirEntryThisDirectory(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_ALL_CMD_EID); } -void Test_FM_ChildDeleteAllCmd_DirEntryParentDirectory(void) +void Test_FM_ChildDeleteAllFilesCmd_DirEntryParentDirectory(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -663,7 +663,7 @@ void Test_FM_ChildDeleteAllCmd_DirEntryParentDirectory(void) UT_SetDataBuffer(UT_KEY(OS_DirectoryRead), &direntry, sizeof(direntry), false); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -677,7 +677,7 @@ void Test_FM_ChildDeleteAllCmd_DirEntryParentDirectory(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_ALL_CMD_EID); } -void Test_FM_ChildDeleteAllCmd_PathFilenameLengthGreaterMaxPthLen(void) +void Test_FM_ChildDeleteAllFilesCmd_PathFilenameLengthGreaterMaxPthLen(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_ALL_CC, @@ -689,7 +689,7 @@ void Test_FM_ChildDeleteAllCmd_PathFilenameLengthGreaterMaxPthLen(void) UT_SetDataBuffer(UT_KEY(OS_DirectoryRead), &direntry, sizeof(direntry), false); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -705,7 +705,7 @@ void Test_FM_ChildDeleteAllCmd_PathFilenameLengthGreaterMaxPthLen(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_DELETE_ALL_FILES_ND_WARNING_EID); } -void Test_FM_ChildDeleteAllCmd_InvalidFilenameState(void) +void Test_FM_ChildDeleteAllFilesCmd_InvalidFilenameState(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -717,7 +717,7 @@ void Test_FM_ChildDeleteAllCmd_InvalidFilenameState(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetFilenameState), FM_NAME_IS_INVALID); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -733,7 +733,7 @@ void Test_FM_ChildDeleteAllCmd_InvalidFilenameState(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_DELETE_ALL_FILES_ND_WARNING_EID); } -void Test_FM_ChildDeleteAllCmd_NotInUseFilenameState(void) +void Test_FM_ChildDeleteAllFilesCmd_NotInUseFilenameState(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -745,7 +745,7 @@ void Test_FM_ChildDeleteAllCmd_NotInUseFilenameState(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetFilenameState), FM_NAME_IS_NOT_IN_USE); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -761,7 +761,7 @@ void Test_FM_ChildDeleteAllCmd_NotInUseFilenameState(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_DELETE_ALL_FILES_ND_WARNING_EID); } -void Test_FM_ChildDeleteAllCmd_DirectoryFilenameState(void) +void Test_FM_ChildDeleteAllFilesCmd_DirectoryFilenameState(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -773,7 +773,7 @@ void Test_FM_ChildDeleteAllCmd_DirectoryFilenameState(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetFilenameState), FM_NAME_IS_DIRECTORY); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -789,7 +789,7 @@ void Test_FM_ChildDeleteAllCmd_DirectoryFilenameState(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_DELETE_ALL_SKIP_WARNING_EID); } -void Test_FM_ChildDeleteAllCmd_OpenFilenameState(void) +void Test_FM_ChildDeleteAllFilesCmd_OpenFilenameState(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -801,7 +801,7 @@ void Test_FM_ChildDeleteAllCmd_OpenFilenameState(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetFilenameState), FM_NAME_IS_FILE_OPEN); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -817,7 +817,7 @@ void Test_FM_ChildDeleteAllCmd_OpenFilenameState(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_DELETE_ALL_FILES_ND_WARNING_EID); } -void Test_FM_ChildDeleteAllCmd_ClosedFilename_OSRmNotSuccess(void) +void Test_FM_ChildDeleteAllFilesCmd_ClosedFilename_OSRmNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -830,7 +830,7 @@ void Test_FM_ChildDeleteAllCmd_ClosedFilename_OSRmNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_remove), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -847,7 +847,7 @@ void Test_FM_ChildDeleteAllCmd_ClosedFilename_OSRmNotSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, FM_DELETE_ALL_FILES_ND_WARNING_EID); } -void Test_FM_ChildDeleteAllCmd_ClosedFilename_OSrmSuccess(void) +void Test_FM_ChildDeleteAllFilesCmd_ClosedFilename_OSrmSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -859,7 +859,7 @@ void Test_FM_ChildDeleteAllCmd_ClosedFilename_OSrmSuccess(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetFilenameState), FM_NAME_IS_FILE_CLOSED); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -875,7 +875,7 @@ void Test_FM_ChildDeleteAllCmd_ClosedFilename_OSrmSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_ALL_CMD_EID); } -void Test_FM_ChildDeleteAllCmd_FilenameStateDefaultReturn(void) +void Test_FM_ChildDeleteAllFilesCmd_FilenameStateDefaultReturn(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -887,7 +887,7 @@ void Test_FM_ChildDeleteAllCmd_FilenameStateDefaultReturn(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetFilenameState), -1); /* default case */ /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteAllCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteAllFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 1, queue_entry.CommandCode); @@ -904,10 +904,10 @@ void Test_FM_ChildDeleteAllCmd_FilenameStateDefaultReturn(void) } /* **************** - * ChildDecompressCmd Tests + * ChildDecompressFileCmd Tests * ***************/ -void Test_FM_ChildDecompressCmd_FSDecompressSuccess(void) +void Test_FM_ChildDecompressFileCmd_FSDecompressSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DECOMPRESS_CC}; @@ -915,7 +915,7 @@ void Test_FM_ChildDecompressCmd_FSDecompressSuccess(void) FM_GlobalData.ChildCurrentCC = 1; /* Act */ - UtAssert_VOIDCALL(FM_ChildDecompressCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDecompressFileCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -926,7 +926,7 @@ void Test_FM_ChildDecompressCmd_FSDecompressSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DECOM_CMD_EID); } -void Test_FM_ChildDecompressCmd_FSDecompressNotSuccess(void) +void Test_FM_ChildDecompressFileCmd_FSDecompressNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DECOMPRESS_CC}; @@ -935,7 +935,7 @@ void Test_FM_ChildDecompressCmd_FSDecompressNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(FM_Decompress_Impl), !CFE_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDecompressCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDecompressFileCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -947,9 +947,9 @@ void Test_FM_ChildDecompressCmd_FSDecompressNotSuccess(void) } /* **************** - * ChildConcatCmd Tests + * ChildConcatFilesCmd Tests * ***************/ -void Test_FM_ChildConcatCmd_OSCpNotSuccess(void) +void Test_FM_ChildConcatFilesCmd_OSCpNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -959,7 +959,7 @@ void Test_FM_ChildConcatCmd_OSCpNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_cp), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -970,7 +970,7 @@ void Test_FM_ChildConcatCmd_OSCpNotSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CONCAT_OSCPY_ERR_EID); } -void Test_FM_ChildConcatCmd_OSOpenCreateSourceNotSuccess(void) +void Test_FM_ChildConcatFilesCmd_OSOpenCreateSourceNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -979,7 +979,7 @@ void Test_FM_ChildConcatCmd_OSOpenCreateSourceNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -992,7 +992,7 @@ void Test_FM_ChildConcatCmd_OSOpenCreateSourceNotSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CONCAT_OPEN_SRC2_ERR_EID); } -void Test_FM_ChildConcatCmd_OSOpenCreateTargetNotSuccess(void) +void Test_FM_ChildConcatFilesCmd_OSOpenCreateTargetNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -1001,7 +1001,7 @@ void Test_FM_ChildConcatCmd_OSOpenCreateTargetNotSuccess(void) UT_SetDeferredRetcode(UT_KEY(OS_OpenCreate), 2, !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1015,7 +1015,7 @@ void Test_FM_ChildConcatCmd_OSOpenCreateTargetNotSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CONCAT_OPEN_TGT_ERR_EID); } -void Test_FM_ChildConcatCmd_OSReadBytesZero(void) +void Test_FM_ChildConcatFilesCmd_OSReadBytesZero(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -1024,7 +1024,7 @@ void Test_FM_ChildConcatCmd_OSReadBytesZero(void) UT_SetDefaultReturnValue(UT_KEY(OS_read), 0); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -1039,7 +1039,7 @@ void Test_FM_ChildConcatCmd_OSReadBytesZero(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CONCAT_CMD_EID); } -void Test_FM_ChildConcatCmd_OSReadBytesLessThanZero(void) +void Test_FM_ChildConcatFilesCmd_OSReadBytesLessThanZero(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -1048,7 +1048,7 @@ void Test_FM_ChildConcatCmd_OSReadBytesLessThanZero(void) UT_SetDefaultReturnValue(UT_KEY(OS_read), -1); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1063,7 +1063,7 @@ void Test_FM_ChildConcatCmd_OSReadBytesLessThanZero(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CONCAT_OSRD_ERR_EID); } -void Test_FM_ChildConcatCmd_BytesWrittenNotEqualBytesRead(void) +void Test_FM_ChildConcatFilesCmd_BytesWrittenNotEqualBytesRead(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -1073,7 +1073,7 @@ void Test_FM_ChildConcatCmd_BytesWrittenNotEqualBytesRead(void) UT_SetDefaultReturnValue(UT_KEY(OS_write), 0); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1088,7 +1088,7 @@ void Test_FM_ChildConcatCmd_BytesWrittenNotEqualBytesRead(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CONCAT_OSWR_ERR_EID); } -void Test_FM_ChildConcatCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount(void) +void Test_FM_ChildConcatFilesCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = { @@ -1099,7 +1099,7 @@ void Test_FM_ChildConcatCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount(v UT_SetDeferredRetcode(UT_KEY(OS_read), FM_CHILD_FILE_LOOP_COUNT + 1, -1); /* Act */ - UtAssert_VOIDCALL(FM_ChildConcatCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildConcatFilesCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1341,15 +1341,15 @@ void Test_FM_ChildFileInfoCmd_BytesReadGreaterThanZero(void) } /* **************** - * ChildCreateDirCmd Tests + * ChildCreateDirectoryCmd Tests * ***************/ -void Test_FM_ChildCreateDirCmd_OSMkDirSuccess(void) +void Test_FM_ChildCreateDirectoryCmd_OSMkDirSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_CREATE_DIR_CC}; /* Act */ - UtAssert_VOIDCALL(FM_ChildCreateDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildCreateDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -1360,7 +1360,7 @@ void Test_FM_ChildCreateDirCmd_OSMkDirSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_CREATE_DIR_CMD_EID); } -void Test_FM_ChildCreateDirCmd_OSMkDirNotSuccess(void) +void Test_FM_ChildCreateDirectoryCmd_OSMkDirNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_CREATE_DIR_CC}; @@ -1368,7 +1368,7 @@ void Test_FM_ChildCreateDirCmd_OSMkDirNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_mkdir), !CFE_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildCreateDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildCreateDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1380,9 +1380,9 @@ void Test_FM_ChildCreateDirCmd_OSMkDirNotSuccess(void) } /* **************** - * ChildDeleteDirCmd Tests + * ChildDeleteDirectoryCmd Tests * ***************/ -void Test_FM_ChildDeleteDirCmd_OSDirectoryOpenNoSuccess(void) +void Test_FM_ChildDeleteDirectoryCmd_OSDirectoryOpenNoSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_DIR_CC}; @@ -1390,7 +1390,7 @@ void Test_FM_ChildDeleteDirCmd_OSDirectoryOpenNoSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_DirectoryOpen), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1401,7 +1401,7 @@ void Test_FM_ChildDeleteDirCmd_OSDirectoryOpenNoSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_OPENDIR_OS_ERR_EID); } -void Test_FM_ChildDeleteDirCmd_OSDirectoryReadNoSuccess(void) +void Test_FM_ChildDeleteDirectoryCmd_OSDirectoryReadNoSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_DIR_CC}; @@ -1409,7 +1409,7 @@ void Test_FM_ChildDeleteDirCmd_OSDirectoryReadNoSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_DirectoryRead), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -1422,7 +1422,7 @@ void Test_FM_ChildDeleteDirCmd_OSDirectoryReadNoSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_DIR_CMD_EID); } -void Test_FM_ChildDeleteDirCmd_StrCmpThisDirectoryZero(void) +void Test_FM_ChildDeleteDirectoryCmd_StrCmpThisDirectoryZero(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_DIR_CC}; @@ -1432,7 +1432,7 @@ void Test_FM_ChildDeleteDirCmd_StrCmpThisDirectoryZero(void) UT_SetDeferredRetcode(UT_KEY(OS_DirectoryRead), 2, !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -1444,7 +1444,7 @@ void Test_FM_ChildDeleteDirCmd_StrCmpThisDirectoryZero(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_DIR_CMD_EID); } -void Test_FM_ChildDeleteDirCmd_StrCmpParentDirectoryZero(void) +void Test_FM_ChildDeleteDirectoryCmd_StrCmpParentDirectoryZero(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_DIR_CC}; @@ -1453,7 +1453,7 @@ void Test_FM_ChildDeleteDirCmd_StrCmpParentDirectoryZero(void) UT_SetDataBuffer(UT_KEY(OS_DirectoryRead), &direntry, sizeof(direntry), false); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -1465,7 +1465,7 @@ void Test_FM_ChildDeleteDirCmd_StrCmpParentDirectoryZero(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_DIR_EMPTY_ERR_EID); } -void Test_FM_ChildDeleteDirCmd_RemoveTheDirIsTrueRmDirSuccess(void) +void Test_FM_ChildDeleteDirectoryCmd_RemoveTheDirIsTrueRmDirSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_DIR_CC}; @@ -1473,7 +1473,7 @@ void Test_FM_ChildDeleteDirCmd_RemoveTheDirIsTrueRmDirSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_DirectoryRead), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(1, 0, 0, queue_entry.CommandCode); @@ -1485,7 +1485,7 @@ void Test_FM_ChildDeleteDirCmd_RemoveTheDirIsTrueRmDirSuccess(void) UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_DELETE_DIR_CMD_EID); } -void Test_FM_ChildDeleteDirCmd_RemoveDirTrueOSRmDirNotSuccess(void) +void Test_FM_ChildDeleteDirectoryCmd_RemoveDirTrueOSRmDirNotSuccess(void) { /* Arrange */ FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_DELETE_DIR_CC}; @@ -1494,7 +1494,7 @@ void Test_FM_ChildDeleteDirCmd_RemoveDirTrueOSRmDirNotSuccess(void) UT_SetDefaultReturnValue(UT_KEY(OS_rmdir), !OS_SUCCESS); /* Act */ - UtAssert_VOIDCALL(FM_ChildDeleteDirCmd(&queue_entry)); + UtAssert_VOIDCALL(FM_ChildDeleteDirectoryCmd(&queue_entry)); /* Assert */ UT_FM_Child_Cmd_Assert(0, 1, 0, queue_entry.CommandCode); @@ -2346,76 +2346,76 @@ void add_FM_ChildDeleteCmd_tests(void) "Test_FM_ChildDeleteCmd_OSRemoveNotSuccess"); } -void add_FM_ChildDeleteAllCmd_tests(void) +void add_FM_ChildDeleteAllFilesCmd_tests(void) { - UtTest_Add(Test_FM_ChildDeleteAllCmd_DirOpenNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_DirOpenNotSuccess"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_DirOpenNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_DirOpenNotSuccess"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_DirReadNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_DirReadNotSuccess"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_DirReadNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_DirReadNotSuccess"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_DirEntryThisDirectory, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_DirEntryThisDirectory"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_DirEntryThisDirectory, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_DirEntryThisDirectory"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_DirEntryParentDirectory, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_DirEntryParentDirectory"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_DirEntryParentDirectory, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_DirEntryParentDirectory"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_PathFilenameLengthGreaterMaxPthLen, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_PathFilenameLengthGreaterMaxPthLen"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_PathFilenameLengthGreaterMaxPthLen, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_PathFilenameLengthGreaterMaxPthLen"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_InvalidFilenameState, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_InvalidFilenameState"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_InvalidFilenameState, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_InvalidFilenameState"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_NotInUseFilenameState, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_NotInUseFilenameState"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_NotInUseFilenameState, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_NotInUseFilenameState"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_DirectoryFilenameState, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_DirectoryFilenameState"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_DirectoryFilenameState, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_DirectoryFilenameState"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_OpenFilenameState, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_OpenFilenameState"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_OpenFilenameState, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_OpenFilenameState"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_ClosedFilename_OSRmNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_ClosedFilename_OSRmNotSuccess"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_ClosedFilename_OSRmNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_ClosedFilename_OSRmNotSuccess"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_ClosedFilename_OSrmSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_ClosedFilename_OSrmSuccess"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_ClosedFilename_OSrmSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_ClosedFilename_OSrmSuccess"); - UtTest_Add(Test_FM_ChildDeleteAllCmd_FilenameStateDefaultReturn, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteAllCmd_FilenameStateDefaultReturn"); + UtTest_Add(Test_FM_ChildDeleteAllFilesCmd_FilenameStateDefaultReturn, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteAllFilesCmd_FilenameStateDefaultReturn"); } -void add_FM_ChildDecompressCmd_tests(void) +void add_FM_ChildDecompressFileCmd_tests(void) { - UtTest_Add(Test_FM_ChildDecompressCmd_FSDecompressNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDecompressCmd_FSDecompressNotSuccess"); + UtTest_Add(Test_FM_ChildDecompressFileCmd_FSDecompressNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDecompressFileCmd_FSDecompressNotSuccess"); - UtTest_Add(Test_FM_ChildDecompressCmd_FSDecompressSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDecompressCmd_FSDecompressSuccess"); + UtTest_Add(Test_FM_ChildDecompressFileCmd_FSDecompressSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDecompressFileCmd_FSDecompressSuccess"); } -void add_FM_ChildConcatCmd_tests(void) +void add_FM_ChildConcatFilesCmd_tests(void) { - UtTest_Add(Test_FM_ChildConcatCmd_OSCpNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildConcatCmd_OSCpNotSuccess"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_OSCpNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildConcatFilesCmd_OSCpNotSuccess"); - UtTest_Add(Test_FM_ChildConcatCmd_OSOpenCreateSourceNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildConcatCmd_OSOpenCreateSourceNotSuccess"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_OSOpenCreateSourceNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildConcatFilesCmd_OSOpenCreateSourceNotSuccess"); - UtTest_Add(Test_FM_ChildConcatCmd_OSOpenCreateTargetNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildConcatCmd_OSOpenCreateTargetNotSuccess"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_OSOpenCreateTargetNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildConcatFilesCmd_OSOpenCreateTargetNotSuccess"); - UtTest_Add(Test_FM_ChildConcatCmd_OSReadBytesZero, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildConcatCmd_OSReadBytesZero"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_OSReadBytesZero, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildConcatFilesCmd_OSReadBytesZero"); - UtTest_Add(Test_FM_ChildConcatCmd_OSReadBytesLessThanZero, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildConcatCmd_OSReadBytesLessThanZero"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_OSReadBytesLessThanZero, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildConcatFilesCmd_OSReadBytesLessThanZero"); - UtTest_Add(Test_FM_ChildConcatCmd_BytesWrittenNotEqualBytesRead, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildConcatCmd_BytesWrittenNotEqualBytesRead"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_BytesWrittenNotEqualBytesRead, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildConcatFilesCmd_BytesWrittenNotEqualBytesRead"); - UtTest_Add(Test_FM_ChildConcatCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount, FM_Test_Setup, - FM_Test_Teardown, "Test_FM_ChildConcatCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount"); + UtTest_Add(Test_FM_ChildConcatFilesCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount, FM_Test_Setup, + FM_Test_Teardown, "Test_FM_ChildConcatFilesCmd_CopyInProgressTrueLoopCountEqualChildFileLoopCount"); } void add_FM_ChildFileInfoCmd_tests(void) @@ -2448,34 +2448,34 @@ void add_FM_ChildFileInfoCmd_tests(void) "Test_FM_ChildFileInfoCmd_BytesReadGreaterThanZero"); } -void add_FM_ChildCreateDirCmd_tests(void) +void add_FM_ChildCreateDirectoryCmd_tests(void) { - UtTest_Add(Test_FM_ChildCreateDirCmd_OSMkDirNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildCreateDirCmd_OSMkDirNotSuccess"); + UtTest_Add(Test_FM_ChildCreateDirectoryCmd_OSMkDirNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildCreateDirectoryCmd_OSMkDirNotSuccess"); - UtTest_Add(Test_FM_ChildCreateDirCmd_OSMkDirSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildCreateDirCmd_OSMkDirSuccess"); + UtTest_Add(Test_FM_ChildCreateDirectoryCmd_OSMkDirSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildCreateDirectoryCmd_OSMkDirSuccess"); } -void add_FM_ChildDeleteDirCmd_tests(void) +void add_FM_ChildDeleteDirectoryCmd_tests(void) { - UtTest_Add(Test_FM_ChildDeleteDirCmd_OSDirectoryOpenNoSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteDirCmd_OSDirectoryOpenNoSuccess"); + UtTest_Add(Test_FM_ChildDeleteDirectoryCmd_OSDirectoryOpenNoSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteDirectoryCmd_OSDirectoryOpenNoSuccess"); - UtTest_Add(Test_FM_ChildDeleteDirCmd_OSDirectoryReadNoSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteDirCmd_OSDirectoryReadNoSuccess"); + UtTest_Add(Test_FM_ChildDeleteDirectoryCmd_OSDirectoryReadNoSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteDirectoryCmd_OSDirectoryReadNoSuccess"); - UtTest_Add(Test_FM_ChildDeleteDirCmd_StrCmpThisDirectoryZero, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteDirCmd_StrCmpThisDirectoryZero"); + UtTest_Add(Test_FM_ChildDeleteDirectoryCmd_StrCmpThisDirectoryZero, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteDirectoryCmd_StrCmpThisDirectoryZero"); - UtTest_Add(Test_FM_ChildDeleteDirCmd_StrCmpParentDirectoryZero, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteDirCmd_StrCmpParentDirectoryZero"); + UtTest_Add(Test_FM_ChildDeleteDirectoryCmd_StrCmpParentDirectoryZero, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteDirectoryCmd_StrCmpParentDirectoryZero"); - UtTest_Add(Test_FM_ChildDeleteDirCmd_RemoveTheDirIsTrueRmDirSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteDirCmd_RemoveTheDirIsTrueRmDirSuccess"); + UtTest_Add(Test_FM_ChildDeleteDirectoryCmd_RemoveTheDirIsTrueRmDirSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteDirectoryCmd_RemoveTheDirIsTrueRmDirSuccess"); - UtTest_Add(Test_FM_ChildDeleteDirCmd_RemoveDirTrueOSRmDirNotSuccess, FM_Test_Setup, FM_Test_Teardown, - "Test_FM_ChildDeleteDirCmd_RemoveDirTrueOSRmDirNotSuccess"); + UtTest_Add(Test_FM_ChildDeleteDirectoryCmd_RemoveDirTrueOSRmDirNotSuccess, FM_Test_Setup, FM_Test_Teardown, + "Test_FM_ChildDeleteDirectoryCmd_RemoveDirTrueOSRmDirNotSuccess"); } void add_FM_ChildDirListFileCmd_tests(void) @@ -2616,12 +2616,12 @@ void UtTest_Setup(void) add_FM_ChildMoveCmd_tests(); add_FM_ChildRenameCmd_tests(); add_FM_ChildDeleteCmd_tests(); - add_FM_ChildDeleteAllCmd_tests(); - add_FM_ChildDecompressCmd_tests(); - add_FM_ChildConcatCmd_tests(); + add_FM_ChildDeleteAllFilesCmd_tests(); + add_FM_ChildDecompressFileCmd_tests(); + add_FM_ChildConcatFilesCmd_tests(); add_FM_ChildFileInfoCmd_tests(); - add_FM_ChildCreateDirCmd_tests(); - add_FM_ChildDeleteDirCmd_tests(); + add_FM_ChildCreateDirectoryCmd_tests(); + add_FM_ChildDeleteDirectoryCmd_tests(); add_FM_ChildDirListFileCmd_tests(); add_FM_ChildDirListPktCmd_tests(); add_FM_ChildSetPermissionsCmd_tests(); diff --git a/unit-test/fm_cmds_tests.c b/unit-test/fm_cmds_tests.c index 17c4d33..a1ebf77 100644 --- a/unit-test/fm_cmds_tests.c +++ b/unit-test/fm_cmds_tests.c @@ -815,7 +815,7 @@ void Test_FM_DeleteAllFilesCmd_Success(void) { FM_DirectoryName_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.DeleteAllCmd.Payload; + CmdPtr = &UT_CmdBuf.DeleteAllFilesCmd.Payload; strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); @@ -881,7 +881,7 @@ void Test_FM_DeleteAllFilesCmd_NoChildTask(void) { FM_DirectoryName_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.DeleteAllCmd.Payload; + CmdPtr = &UT_CmdBuf.DeleteAllFilesCmd.Payload; strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); FM_GlobalData.ChildWriteIndex = 0; @@ -1050,7 +1050,7 @@ void Test_FM_ConcatFilesCmd_Success(void) { FM_TwoSourceOneTarget_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.ConcatCmd.Payload; + CmdPtr = &UT_CmdBuf.ConcatFilesCmd.Payload; strncpy(CmdPtr->Source1, "src1", sizeof(CmdPtr->Source1) - 1); strncpy(CmdPtr->Source2, "src2", sizeof(CmdPtr->Source2) - 1); @@ -1357,7 +1357,7 @@ void Test_FM_CreateDirectoryCmd_Success(void) { FM_DirectoryName_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.CreateDirCmd.Payload; + CmdPtr = &UT_CmdBuf.CreateDirectoryCmd.Payload; strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); FM_GlobalData.ChildWriteIndex = 0; @@ -1461,7 +1461,7 @@ void Test_FM_DeleteDirectoryCmd_Success(void) { FM_DirectoryName_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.DeleteDirCmd.Payload; + CmdPtr = &UT_CmdBuf.DeleteDirectoryCmd.Payload; strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); FM_GlobalData.ChildWriteIndex = 0; @@ -1565,7 +1565,7 @@ void Test_FM_GetDirListFileCmd_Success(void) { FM_GetDirectoryToFile_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.GetDirFileCmd.Payload; + CmdPtr = &UT_CmdBuf.GetDirListFileCmd.Payload; strncpy(CmdPtr->Filename, "file", sizeof(CmdPtr->Filename) - 1); strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); @@ -1592,7 +1592,7 @@ void Test_FM_GetDirListFileCmd_SuccessDefaultPath(void) { FM_GetDirectoryToFile_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.GetDirFileCmd.Payload; + CmdPtr = &UT_CmdBuf.GetDirListFileCmd.Payload; strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); CmdPtr->Filename[0] = '\0'; @@ -1661,7 +1661,7 @@ void Test_FM_GetDirListFileCmd_TargetFileOpen(void) { FM_GetDirectoryToFile_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.GetDirFileCmd.Payload; + CmdPtr = &UT_CmdBuf.GetDirListFileCmd.Payload; strncpy(CmdPtr->Filename, "file", sizeof(CmdPtr->Filename) - 1); strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); @@ -1689,7 +1689,7 @@ void Test_FM_GetDirListFileCmd_NoChildTask(void) { FM_GetDirectoryToFile_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.GetDirFileCmd.Payload; + CmdPtr = &UT_CmdBuf.GetDirListFileCmd.Payload; strncpy(CmdPtr->Filename, "file", sizeof(CmdPtr->Filename) - 1); strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); @@ -1741,7 +1741,7 @@ void Test_FM_GetDirListPktCmd_Success(void) { FM_GetDirectoryToPkt_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.GetDirPktCmd.Payload; + CmdPtr = &UT_CmdBuf.GetDirListPktCmd.Payload; strncpy(CmdPtr->Directory, "dir", sizeof(CmdPtr->Directory) - 1); @@ -2296,7 +2296,7 @@ void Test_FM_SetPermissionsCmd_Success(void) { FM_FilenameAndMode_Payload_t *CmdPtr; - CmdPtr = &UT_CmdBuf.SetPermCmd.Payload; + CmdPtr = &UT_CmdBuf.SetPermissionsCmd.Payload; strncpy(CmdPtr->FileName, "file", sizeof(CmdPtr->FileName) - 1); UT_SetDefaultReturnValue(UT_KEY(FM_IsValidCmdPktLength), true); diff --git a/unit-test/stubs/fm_app_stubs.c b/unit-test/stubs/fm_app_stubs.c index a0f591b..4e3f55a 100644 --- a/unit-test/stubs/fm_app_stubs.c +++ b/unit-test/stubs/fm_app_stubs.c @@ -77,12 +77,12 @@ void FM_ProcessPkt(const CFE_SB_Buffer_t *MessagePtr) /* * ---------------------------------------------------- - * Generated stub function for FM_ReportHK() + * Generated stub function for FM_SendHkCmd() * ---------------------------------------------------- */ -void FM_ReportHK(const CFE_MSG_CommandHeader_t *Msg) +void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr) { - UT_GenStub_AddParam(FM_ReportHK, const CFE_MSG_CommandHeader_t *, Msg); + UT_GenStub_AddParam(FM_SendHkCmd, const CFE_SB_Buffer_t *, BufPtr); - UT_GenStub_Execute(FM_ReportHK, Basic, NULL); + UT_GenStub_Execute(FM_SendHkCmd, Basic, NULL); } diff --git a/unit-test/stubs/fm_child_stubs.c b/unit-test/stubs/fm_child_stubs.c index 16a1c66..c9a82de 100644 --- a/unit-test/stubs/fm_child_stubs.c +++ b/unit-test/stubs/fm_child_stubs.c @@ -28,14 +28,14 @@ /* * ---------------------------------------------------- - * Generated stub function for FM_ChildConcatCmd() + * Generated stub function for FM_ChildConcatFilesCmd() * ---------------------------------------------------- */ -void FM_ChildConcatCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildConcatFilesCmd(const FM_ChildQueueEntry_t *CmdArgs) { - UT_GenStub_AddParam(FM_ChildConcatCmd, const FM_ChildQueueEntry_t *, CmdArgs); + UT_GenStub_AddParam(FM_ChildConcatFilesCmd, const FM_ChildQueueEntry_t *, CmdArgs); - UT_GenStub_Execute(FM_ChildConcatCmd, Basic, NULL); + UT_GenStub_Execute(FM_ChildConcatFilesCmd, Basic, NULL); } /* @@ -52,38 +52,38 @@ void FM_ChildCopyCmd(const FM_ChildQueueEntry_t *CmdArgs) /* * ---------------------------------------------------- - * Generated stub function for FM_ChildCreateDirCmd() + * Generated stub function for FM_ChildCreateDirectoryCmd() * ---------------------------------------------------- */ -void FM_ChildCreateDirCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildCreateDirectoryCmd(const FM_ChildQueueEntry_t *CmdArgs) { - UT_GenStub_AddParam(FM_ChildCreateDirCmd, const FM_ChildQueueEntry_t *, CmdArgs); + UT_GenStub_AddParam(FM_ChildCreateDirectoryCmd, const FM_ChildQueueEntry_t *, CmdArgs); - UT_GenStub_Execute(FM_ChildCreateDirCmd, Basic, NULL); + UT_GenStub_Execute(FM_ChildCreateDirectoryCmd, Basic, NULL); } /* * ---------------------------------------------------- - * Generated stub function for FM_ChildDecompressCmd() + * Generated stub function for FM_ChildDecompressFileCmd() * ---------------------------------------------------- */ -void FM_ChildDecompressCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildDecompressFileCmd(const FM_ChildQueueEntry_t *CmdArgs) { - UT_GenStub_AddParam(FM_ChildDecompressCmd, const FM_ChildQueueEntry_t *, CmdArgs); + UT_GenStub_AddParam(FM_ChildDecompressFileCmd, const FM_ChildQueueEntry_t *, CmdArgs); - UT_GenStub_Execute(FM_ChildDecompressCmd, Basic, NULL); + UT_GenStub_Execute(FM_ChildDecompressFileCmd, Basic, NULL); } /* * ---------------------------------------------------- - * Generated stub function for FM_ChildDeleteAllCmd() + * Generated stub function for FM_ChildDeleteAllFilesCmd() * ---------------------------------------------------- */ -void FM_ChildDeleteAllCmd(FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildDeleteAllFilesCmd(FM_ChildQueueEntry_t *CmdArgs) { - UT_GenStub_AddParam(FM_ChildDeleteAllCmd, FM_ChildQueueEntry_t *, CmdArgs); + UT_GenStub_AddParam(FM_ChildDeleteAllFilesCmd, FM_ChildQueueEntry_t *, CmdArgs); - UT_GenStub_Execute(FM_ChildDeleteAllCmd, Basic, NULL); + UT_GenStub_Execute(FM_ChildDeleteAllFilesCmd, Basic, NULL); } /* @@ -100,14 +100,14 @@ void FM_ChildDeleteCmd(const FM_ChildQueueEntry_t *CmdArgs) /* * ---------------------------------------------------- - * Generated stub function for FM_ChildDeleteDirCmd() + * Generated stub function for FM_ChildDeleteDirectoryCmd() * ---------------------------------------------------- */ -void FM_ChildDeleteDirCmd(const FM_ChildQueueEntry_t *CmdArgs) +void FM_ChildDeleteDirectoryCmd(const FM_ChildQueueEntry_t *CmdArgs) { - UT_GenStub_AddParam(FM_ChildDeleteDirCmd, const FM_ChildQueueEntry_t *, CmdArgs); + UT_GenStub_AddParam(FM_ChildDeleteDirectoryCmd, const FM_ChildQueueEntry_t *, CmdArgs); - UT_GenStub_Execute(FM_ChildDeleteDirCmd, Basic, NULL); + UT_GenStub_Execute(FM_ChildDeleteDirectoryCmd, Basic, NULL); } /* diff --git a/unit-test/utilities/fm_test_utils.h b/unit-test/utilities/fm_test_utils.h index a435d29..eed6ff8 100644 --- a/unit-test/utilities/fm_test_utils.h +++ b/unit-test/utilities/fm_test_utils.h @@ -41,25 +41,25 @@ extern CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent[]; typedef union { CFE_SB_Buffer_t Buf; - FM_HousekeepingCmd_t HousekeepingCmd; + FM_SendHkCmd_t SendHkCmd; FM_NoopCmd_t NoopCmd; - FM_ResetCmd_t ResetCmd; + FM_ResetCountersCmd_t ResetCountersCmd; FM_CopyFileCmd_t CopyFileCmd; FM_MoveFileCmd_t MoveFileCmd; FM_RenameFileCmd_t RenameFileCmd; FM_DeleteFileCmd_t DeleteFileCmd; - FM_DeleteAllCmd_t DeleteAllCmd; - FM_DecompressCmd_t DecompressCmd; - FM_ConcatCmd_t ConcatCmd; + FM_DeleteAllFilesCmd_t DeleteAllFilesCmd; + FM_DecompressFileCmd_t DecompressFileCmd; + FM_ConcatFilesCmd_t ConcatFilesCmd; FM_GetFileInfoCmd_t GetFileInfoCmd; FM_GetOpenFilesCmd_t GetOpenFilesCmd; - FM_CreateDirCmd_t CreateDirCmd; - FM_DeleteDirCmd_t DeleteDirCmd; - FM_GetDirFileCmd_t GetDirFileCmd; - FM_GetDirPktCmd_t GetDirPktCmd; + FM_CreateDirectoryCmd_t CreateDirectoryCmd; + FM_DeleteDirectoryCmd_t DeleteDirectoryCmd; + FM_GetDirListFileCmd_t GetDirListFileCmd; + FM_GetDirListPktCmd_t GetDirListPktCmd; FM_MonitorFilesystemSpaceCmd_t GetFreeSpaceCmd; FM_SetTableStateCmd_t SetTableStateCmd; - FM_SetPermCmd_t SetPermCmd; + FM_SetPermissionsCmd_t SetPermissionsCmd; } UT_CmdBuf_t; extern UT_CmdBuf_t UT_CmdBuf;