diff --git a/fsw/src/fm_app.c b/fsw/src/fm_app.c index a1b4579..7c35ada 100644 --- a/fsw/src/fm_app.c +++ b/fsw/src/fm_app.c @@ -165,10 +165,10 @@ void FM_AppMain(void) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 FM_AppInit(void) +CFE_Status_t FM_AppInit(void) { - const char *ErrText = "Initialization error:"; - int32 Result = CFE_SUCCESS; + const char * ErrText = "Initialization error:"; + CFE_Status_t Result = CFE_SUCCESS; /* Initialize global data */ memset(&FM_GlobalData, 0, sizeof(FM_GlobalData)); @@ -246,7 +246,7 @@ int32 FM_AppInit(void) /* FM application -- housekeeping request packet processor */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr) +void FM_SendHkCmd(const FM_SendHkCmd_t *BufPtr) { FM_HousekeepingPkt_Payload_t *PayloadPtr; diff --git a/fsw/src/fm_app.h b/fsw/src/fm_app.h index 560b725..090fd8d 100644 --- a/fsw/src/fm_app.h +++ b/fsw/src/fm_app.h @@ -30,7 +30,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* FM -- application global constants */ +/* FM -- Macro Definitions */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -43,6 +43,11 @@ */ #define FM_SB_TIMEOUT 1000 +/** + * \brief FM Error Codes + */ +#define FM_ERROR -1 /**< \brief Generic FM error return code */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* FM -- application global data structure */ @@ -159,7 +164,7 @@ void FM_AppMain(void); * * \sa #CFE_EVS_Register, #CFE_SB_CreatePipe, #CFE_SB_Subscribe */ -int32 FM_AppInit(void); +CFE_Status_t FM_AppInit(void); /** * \brief Housekeeping Request Command Handler @@ -178,7 +183,7 @@ int32 FM_AppInit(void); * * \sa #FM_SendHkCmd_t, #FM_HousekeepingPkt_t */ -void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr); +void FM_SendHkCmd(const FM_SendHkCmd_t *BufPtr); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ diff --git a/fsw/src/fm_child.c b/fsw/src/fm_child.c index 77fd2fc..74a1c90 100644 --- a/fsw/src/fm_child.c +++ b/fsw/src/fm_child.c @@ -54,12 +54,12 @@ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 FM_ChildInit(void) +CFE_Status_t FM_ChildInit(void) { - int32 TaskTextLen = OS_MAX_PATH_LEN; - char TaskText[OS_MAX_PATH_LEN] = "\0"; - int32 Result = CFE_SUCCESS; - uint32 TaskEID = 0; + int32 TaskTextLen = OS_MAX_PATH_LEN; + char TaskText[OS_MAX_PATH_LEN] = "\0"; + CFE_Status_t Result = CFE_SUCCESS; + uint32 TaskEID = 0; /* Create counting semaphore (given by parent to wake-up child) */ Result = OS_CountSemCreate(&FM_GlobalData.ChildSemaphore, FM_CHILD_SEM_NAME, 0, 0); diff --git a/fsw/src/fm_child.h b/fsw/src/fm_child.h index db68fa8..8e636b1 100644 --- a/fsw/src/fm_child.h +++ b/fsw/src/fm_child.h @@ -49,7 +49,7 @@ * * \sa #FM_AppInit */ -int32 FM_ChildInit(void); +CFE_Status_t FM_ChildInit(void); /** * \brief Child Task Entry Point Function diff --git a/fsw/src/fm_cmd_utils.c b/fsw/src/fm_cmd_utils.c index f547092..5a23b31 100644 --- a/fsw/src/fm_cmd_utils.c +++ b/fsw/src/fm_cmd_utils.c @@ -563,13 +563,13 @@ int32 FM_GetVolumeFreeSpace(const char *FileSys, uint64 *BlockCount, uint64 *Byt /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, uint64 *ByteCount) +CFE_Status_t FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, uint64 *ByteCount) { osal_id_t DirId; os_dirent_t DirEntry; os_fstat_t FileStat; osal_status_t OS_Status; - int32 Result; + CFE_Status_t Result; char FullPath[OS_MAX_PATH_LEN]; uint64 TotalBytes; size_t DirLen; diff --git a/fsw/src/fm_cmd_utils.h b/fsw/src/fm_cmd_utils.h index e681290..0646f89 100644 --- a/fsw/src/fm_cmd_utils.h +++ b/fsw/src/fm_cmd_utils.h @@ -398,6 +398,6 @@ int32 FM_GetVolumeFreeSpace(const char *FileSys, uint64 *BlockCount, uint64 *Byt * \returns Status code * \retval CFE_SUCCESS if successful */ -int32 FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, uint64 *ByteCount); +CFE_Status_t FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, uint64 *ByteCount); #endif diff --git a/fsw/src/fm_cmds.c b/fsw/src/fm_cmds.c index 9e576ef..70184f7 100644 --- a/fsw/src/fm_cmds.c +++ b/fsw/src/fm_cmds.c @@ -53,14 +53,14 @@ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_NoopCmd(const FM_NoopCmd_t *BufPtr) { const char *CmdText = "No-op"; CFE_EVS_SendEvent(FM_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "%s command: FM version %d.%d.%d.%d", CmdText, FM_MAJOR_VERSION, FM_MINOR_VERSION, FM_REVISION, FM_MISSION_REV); - return true; + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -69,7 +69,7 @@ bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_ResetCountersCmd(const FM_ResetCountersCmd_t *BufPtr) { const char *CmdText = "Reset Counters"; @@ -83,7 +83,7 @@ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) /* Send command completion event (debug) */ CFE_EVS_SendEvent(FM_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText); - return true; + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -92,10 +92,11 @@ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_CopyFileCmd(const FM_CopyFileCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Copy File"; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_OvwSourceTargetFilename_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_CopyFileCmd_t); @@ -143,9 +144,11 @@ bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -154,10 +157,11 @@ bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_MoveFileCmd(const FM_MoveFileCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Move File"; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_OvwSourceTargetFilename_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_MoveFileCmd_t); @@ -206,9 +210,11 @@ bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -217,10 +223,11 @@ bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_RenameFileCmd(const FM_RenameFileCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Rename File"; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_SourceTargetFileName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_RenameFileCmd_t); @@ -256,9 +263,11 @@ bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -267,10 +276,11 @@ bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteFileCmd(const FM_DeleteFileCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Delete File"; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_SingleFilename_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteFileCmd_t); @@ -290,15 +300,17 @@ bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr) CmdArgs = &FM_GlobalData.ChildQueue[FM_GlobalData.ChildWriteIndex]; /* Set handshake queue command args - might be global or internal CC */ - CFE_MSG_GetFcnCode(&BufPtr->Msg, &CmdArgs->CommandCode); + CFE_MSG_GetFcnCode(&BufPtr->CommandHeader.Msg, &CmdArgs->CommandCode); strncpy(CmdArgs->Source1, CmdPtr->Filename, OS_MAX_PATH_LEN - 1); CmdArgs->Source1[OS_MAX_PATH_LEN - 1] = '\0'; /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -307,11 +319,12 @@ bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteAllFilesCmd(const FM_DeleteAllFilesCmd_t *BufPtr) { const char * CmdText = "Delete All Files"; char DirWithSep[OS_MAX_PATH_LEN] = "\0"; FM_ChildQueueEntry_t *CmdArgs = NULL; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteAllFilesCmd_t); @@ -346,9 +359,11 @@ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -357,10 +372,11 @@ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DecompressFileCmd(const FM_DecompressFileCmd_t *BufPtr) { const char * CmdText = "Decompress File"; FM_ChildQueueEntry_t *CmdArgs = NULL; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_SourceTargetFileName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DecompressFileCmd_t); @@ -394,21 +410,23 @@ bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* FM command handler -- Concatenate Files */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_ConcatFilesCmd(const FM_ConcatFilesCmd_t *BufPtr) { const char * CmdText = "Concat Files"; FM_ChildQueueEntry_t *CmdArgs = NULL; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_TwoSourceOneTarget_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_ConcatFilesCmd_t); @@ -450,9 +468,11 @@ bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -461,10 +481,11 @@ bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetFileInfoCmd(const FM_GetFileInfoCmd_t *BufPtr) { const char * CmdText = "Get File Info"; FM_ChildQueueEntry_t *CmdArgs = NULL; + CFE_Status_t Status = FM_ERROR; bool CommandResult = true; uint32 FilenameState = FM_NAME_IS_INVALID; @@ -505,9 +526,11 @@ bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -516,7 +539,7 @@ bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetOpenFilesCmd(const FM_GetOpenFilesCmd_t *BufPtr) { const char *CmdText = "Get Open Files"; uint32 NumOpenFiles = 0; @@ -539,7 +562,7 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) /* Send command completion event (debug) */ CFE_EVS_SendEvent(FM_GET_OPEN_FILES_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText); - return true; + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -548,10 +571,11 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_CreateDirectoryCmd(const FM_CreateDirectoryCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Create Directory"; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_CreateDirectoryCmd_t); @@ -578,9 +602,11 @@ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -589,10 +615,11 @@ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteDirectoryCmd(const FM_DeleteDirectoryCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Delete Directory"; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_DirectoryName_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_DeleteDirectoryCmd_t); @@ -619,9 +646,11 @@ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -630,12 +659,13 @@ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetDirListFileCmd(const FM_GetDirListFileCmd_t *BufPtr) { const char * CmdText = "Directory List to File"; char DirWithSep[OS_MAX_PATH_LEN] = "\0"; char Filename[OS_MAX_PATH_LEN] = "\0"; FM_ChildQueueEntry_t *CmdArgs = NULL; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_GetDirectoryToFile_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_GetDirListFileCmd_t); @@ -692,9 +722,11 @@ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -703,11 +735,12 @@ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetDirListPktCmd(const FM_GetDirListPktCmd_t *BufPtr) { const char * CmdText = "Directory List to Packet"; char DirWithSep[OS_MAX_PATH_LEN] = "\0"; FM_ChildQueueEntry_t *CmdArgs = NULL; + CFE_Status_t Status = FM_ERROR; bool CommandResult; const FM_GetDirectoryToPkt_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_GetDirListPktCmd_t); @@ -744,9 +777,11 @@ bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -755,12 +790,12 @@ bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_MonitorFilesystemSpaceCmd(const FM_MonitorFilesystemSpaceCmd_t *BufPtr) { - const char *CmdText = "Get Free Space"; - bool CommandResult = true; - uint32 i = 0; - int32 OpResult; + const char * CmdText = "Get Free Space"; + uint32 i = 0; + CFE_Status_t Status = CFE_SUCCESS; + int32 OpResult; const FM_MonitorTableEntry_t *MonitorPtr; FM_MonitorReportEntry_t * ReportPtr; @@ -768,7 +803,7 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) /* Verify that we have a pointer to the file system table data */ if (FM_GlobalData.MonitorTablePtr == NULL) { - CommandResult = false; + Status = CFE_STATUS_INCORRECT_STATE; CFE_EVS_SendEvent(FM_GET_FREE_SPACE_TBL_ERR_EID, CFE_EVS_EventType_ERROR, "%s error: file system free space table is not loaded", CmdText); @@ -812,7 +847,7 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) if (OpResult != CFE_SUCCESS) { - CommandResult = false; + Status = FM_ERROR; } } } @@ -834,7 +869,7 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) CFE_EVS_SendEvent(FM_MONITOR_FILESYSTEM_SPACE_CMD_EID, CFE_EVS_EventType_DEBUG, "%s command", CmdText); } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -843,17 +878,17 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_SetTableStateCmd(const FM_SetTableStateCmd_t *BufPtr) { - const char *CmdText = "Set Table State"; - bool CommandResult = true; + const char * CmdText = "Set Table State"; + CFE_Status_t Status = CFE_SUCCESS; const FM_TableIndexAndState_Payload_t *CmdPtr = FM_GET_CMD_PAYLOAD(BufPtr, FM_SetTableStateCmd_t); if (FM_GlobalData.MonitorTablePtr == NULL) { /* File system table has not been loaded */ - CommandResult = false; + Status = CFE_STATUS_INCORRECT_STATE; CFE_EVS_SendEvent(FM_SET_TABLE_STATE_TBL_ERR_EID, CFE_EVS_EventType_ERROR, "%s error: file system free space table is not loaded", CmdText); @@ -861,7 +896,7 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) else if (CmdPtr->TableEntryIndex >= FM_TABLE_ENTRY_COUNT) { /* Table index argument is out of range */ - CommandResult = false; + Status = CFE_STATUS_RANGE_ERROR; CFE_EVS_SendEvent(FM_SET_TABLE_STATE_ARG_IDX_ERR_EID, CFE_EVS_EventType_ERROR, "%s error: invalid command argument: index = %d", CmdText, (int)CmdPtr->TableEntryIndex); @@ -870,7 +905,7 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) (CmdPtr->TableEntryState != FM_TABLE_ENTRY_DISABLED)) { /* State argument must be either enabled or disabled */ - CommandResult = false; + Status = CFE_STATUS_RANGE_ERROR; CFE_EVS_SendEvent(FM_SET_TABLE_STATE_ARG_STATE_ERR_EID, CFE_EVS_EventType_ERROR, "%s error: invalid command argument: state = %d", CmdText, (int)CmdPtr->TableEntryState); @@ -878,7 +913,7 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) else if (FM_GlobalData.MonitorTablePtr->Entries[CmdPtr->TableEntryIndex].Type == FM_MonitorTableEntry_Type_UNUSED) { /* Current table entry state must not be unused */ - CommandResult = false; + Status = CFE_STATUS_INCORRECT_STATE; CFE_EVS_SendEvent(FM_SET_TABLE_STATE_UNUSED_ERR_EID, CFE_EVS_EventType_ERROR, "%s error: cannot modify unused table entry: index = %d", CmdText, @@ -898,7 +933,7 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) (int)CmdPtr->TableEntryState); } - return CommandResult; + return Status; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -907,10 +942,11 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_SetPermissionsCmd(const FM_SetPermissionsCmd_t *BufPtr) { FM_ChildQueueEntry_t *CmdArgs = NULL; const char * CmdText = "Set Permissions"; + CFE_Status_t Status = FM_ERROR; bool CommandResult = true; bool FilenameState = FM_NAME_IS_INVALID; @@ -941,7 +977,9 @@ bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr) /* Invoke lower priority child task */ FM_InvokeChildTask(); + + Status = CFE_SUCCESS; } - return CommandResult; + return Status; } diff --git a/fsw/src/fm_cmds.h b/fsw/src/fm_cmds.h index bb89fcb..3af3df8 100644 --- a/fsw/src/fm_cmds.h +++ b/fsw/src/fm_cmds.h @@ -25,6 +25,7 @@ #define FM_CMDS_H #include "cfe.h" +#include "fm_msg.h" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ @@ -43,13 +44,12 @@ * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS + * \retval CFE_SUCCESS * * \sa #FM_NOOP_CC, #FM_NoopCmd_t */ -bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_NoopCmd(const FM_NoopCmd_t *BufPtr); /** * \brief Reset Counters Command Handler Function @@ -61,13 +61,12 @@ bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS + * \retval CFE_SUCCESS * * \sa #FM_RESET_COUNTERS_CC, #FM_ResetCountersCmd_t */ -bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_ResetCountersCmd(const FM_ResetCountersCmd_t *BufPtr); /** * \brief Copy File Command Handler Function @@ -87,13 +86,13 @@ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_COPY_FILE_CC, #FM_CopyFileCmd_t */ -bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_CopyFileCmd(const FM_CopyFileCmd_t *BufPtr); /** * \brief Move File Command Handler Function @@ -106,13 +105,13 @@ bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_MOVE_FILE_CC, #FM_MoveFileCmd_t */ -bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_MoveFileCmd(const FM_MoveFileCmd_t *BufPtr); /** * \brief Rename File Command Handler Function @@ -125,13 +124,13 @@ bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_RENAME_FILE_CC, #FM_RenameFileCmd_t */ -bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_RenameFileCmd(const FM_RenameFileCmd_t *BufPtr); /** * \brief Delete File Command Handler Function @@ -143,13 +142,13 @@ bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_DELETE_FILE_CC, #FM_DeleteFileCmd_t */ -bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_DeleteFileCmd(const FM_DeleteFileCmd_t *BufPtr); /** * \brief Delete All Files Command Handler Function @@ -169,13 +168,13 @@ bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_DELETE_ALL_FILES_CC, #FM_DeleteAllFilesCmd_t */ -bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_DeleteAllFilesCmd(const FM_DeleteAllFilesCmd_t *BufPtr); /** * \brief Decompress Files Command Handler Function @@ -196,13 +195,13 @@ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_DECOMPRESS_FILE_CC, #FM_DecompressFileCmd_t */ -bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_DecompressFileCmd(const FM_DecompressFileCmd_t *BufPtr); /** * \brief Concatenate Files Command Handler Function @@ -224,13 +223,13 @@ bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_CONCAT_FILES_CC, #FM_ConcatFilesCmd_t */ -bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_ConcatFilesCmd(const FM_ConcatFilesCmd_t *BufPtr); /** * \brief Get File Information Command Handler Function @@ -251,13 +250,13 @@ bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_GET_FILE_INFO_CC, #FM_GetFileInfoCmd_t, #FM_FileInfoPkt_t */ -bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_GetFileInfoCmd(const FM_GetFileInfoCmd_t *BufPtr); /** * \brief Get Open Files List Command Handler Function @@ -270,13 +269,12 @@ bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS + * \retval CFE_SUCCESS * * \sa #FM_GET_OPEN_FILES_CC, #FM_GetOpenFilesCmd_t, #FM_OpenFilesPkt_t */ -bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_GetOpenFilesCmd(const FM_GetOpenFilesCmd_t *BufPtr); /** * \brief Create Directory Command Handler Function @@ -288,13 +286,13 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_CREATE_DIRECTORY_CC, #FM_CreateDirectoryCmd_t */ -bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_CreateDirectoryCmd(const FM_CreateDirectoryCmd_t *BufPtr); /** * \brief Delete Directory Command Handler Function @@ -306,13 +304,13 @@ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_DELETE_DIRECTORY_CC, #FM_DeleteDirectoryCmd_t */ -bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_DeleteDirectoryCmd(const FM_DeleteDirectoryCmd_t *BufPtr); /** * \brief Get Directory List to Packet Command Handler Function @@ -332,14 +330,14 @@ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_GET_DIR_LIST_FILE_CC, #FM_GetDirListFileCmd_t, * #FM_DirListFileStats_t, FM_DirListEntry_t */ -bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_GetDirListFileCmd(const FM_GetDirListFileCmd_t *BufPtr); /** * \brief Get Directory List to Packet Command Handler Function @@ -360,13 +358,13 @@ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_GET_DIR_LIST_PKT_CC, #FM_GetDirListPktCmd_t, #FM_DirListPkt_t */ -bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_GetDirListPktCmd(const FM_GetDirListPktCmd_t *BufPtr); /** * \brief Monitor Filesystem Command Handler Function @@ -380,13 +378,14 @@ bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval CFE_STATUS_INCORRECT_STATE File System Table Pointer is NULL + * \retval FM_ERROR Command not successful * * \sa #FM_MONITOR_FILESYSTEM_SPACE_CC, #FM_MonitorFilesystemSpaceCmd_t, #FM_MonitorReportPkt_t */ -bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_MonitorFilesystemSpaceCmd(const FM_MonitorFilesystemSpaceCmd_t *BufPtr); /** * \brief Set Table Entry State Command Handler Function @@ -399,13 +398,14 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval CFE_STATUS_INCORRECT_STATE File system table was not loaded yet or Unused Table Entry State + * \retval CFE_STATUS_RANGE_ERROR Invalid Table Entry Index or Table Entry State * * \sa #FM_SET_TABLE_STATE_CC, #FM_SetTableStateCmd_t, #FM_MonitorTableEntry_t */ -bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_SetTableStateCmd(const FM_SetTableStateCmd_t *BufPtr); /** * \brief Set File Permissions of a file @@ -417,12 +417,12 @@ bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr); * * \param [in] BufPtr Pointer to Software Bus command packet. * - * \return Boolean command success response - * \retval true Command successful - * \retval false Command not successful + * \return CFE_SUCCESS on success, or relevant error code on failure + * \retval CFE_SUCCESS Command successful + * \retval FM_ERROR Command not successful * * \sa #FM_SET_PERMISSIONS_CC, #FM_SetPermissionsCmd_t, #FM_SET_PERM_CMD_EID, #FM_SET_PERM_ERR_EID */ -bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_SetPermissionsCmd(const FM_SetPermissionsCmd_t *BufPtr); #endif diff --git a/fsw/src/fm_compression.h b/fsw/src/fm_compression.h index 9585d39..b08a218 100644 --- a/fsw/src/fm_compression.h +++ b/fsw/src/fm_compression.h @@ -28,6 +28,7 @@ #ifndef FM_COMPRESSION_H #define FM_COMPRESSION_H +#include #include #include @@ -56,7 +57,7 @@ typedef struct FM_Decompressor_State FM_Decompressor_State_t; * @returns Status code * @retval #CFE_SUCCESS if successful */ -int32 FM_CompressionService_Init(void); +CFE_Status_t FM_CompressionService_Init(void); /** * @brief Abstract file decompression routine @@ -71,7 +72,7 @@ int32 FM_CompressionService_Init(void); * @returns Status code * @retval #CFE_SUCCESS if decompression was successful */ -int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName); +CFE_Status_t FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName); /** * @brief Abstract file compression routine @@ -86,6 +87,6 @@ int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName * @returns Status code * @retval #CFE_SUCCESS if decompression was successful */ -int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName); +CFE_Status_t FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName); #endif diff --git a/fsw/src/fm_compression_fslib.c b/fsw/src/fm_compression_fslib.c index d97dd76..68dcc99 100644 --- a/fsw/src/fm_compression_fslib.c +++ b/fsw/src/fm_compression_fslib.c @@ -51,19 +51,19 @@ struct FM_Decompressor_State */ static FM_Decompressor_State_t FM_FSLIB_DecompressState; -int32 FM_CompressionService_Init(void) +CFE_Status_t FM_CompressionService_Init(void) { memset(&FM_FSLIB_DecompressState, 0, sizeof(FM_FSLIB_DecompressState)); FM_GlobalData.DecompressorStatePtr = &FM_FSLIB_DecompressState; return CFE_SUCCESS; } -int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) { return FS_LIB_Decompress(&State->LibState, SrcFileName, DstFileName); } -int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) { return CFE_STATUS_NOT_IMPLEMENTED; } diff --git a/fsw/src/fm_compression_none.c b/fsw/src/fm_compression_none.c index 28b26c4..a094649 100644 --- a/fsw/src/fm_compression_none.c +++ b/fsw/src/fm_compression_none.c @@ -30,17 +30,17 @@ #include "fm_compression.h" -int32 FM_CompressionService_Init(void) +CFE_Status_t FM_CompressionService_Init(void) { return CFE_SUCCESS; } -int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) { return CFE_STATUS_NOT_IMPLEMENTED; } -int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) { return CFE_STATUS_NOT_IMPLEMENTED; } diff --git a/fsw/src/fm_compression_zlib.c b/fsw/src/fm_compression_zlib.c index 385f1a9..66f0ea4 100644 --- a/fsw/src/fm_compression_zlib.c +++ b/fsw/src/fm_compression_zlib.c @@ -30,17 +30,17 @@ #include "fm_compression.h" -int32 FM_CompressionService_Init(void) +CFE_Status_t FM_CompressionService_Init(void) { return CFE_SUCCESS; } -int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) { return CFE_STATUS_NOT_IMPLEMENTED; } -int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) { return CFE_STATUS_NOT_IMPLEMENTED; } diff --git a/fsw/src/fm_dispatch.c b/fsw/src/fm_dispatch.c index e7b2262..747301c 100644 --- a/fsw/src/fm_dispatch.c +++ b/fsw/src/fm_dispatch.c @@ -72,12 +72,12 @@ bool FM_IsValidCmdPktLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLeng /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_NoopVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_NoopVerifyDispatch(const FM_NoopCmd_t *BufPtr) { /* Verify message length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_NoopCmd_t), FM_NOOP_PKT_ERR_EID, "No-op")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_NoopCmd_t), FM_NOOP_PKT_ERR_EID, "No-op")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_NoopCmd(BufPtr); @@ -89,12 +89,13 @@ bool FM_NoopVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_ResetCountersVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_ResetCountersVerifyDispatch(const FM_ResetCountersCmd_t *BufPtr) { /* Verify message length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_ResetCountersCmd_t), FM_RESET_PKT_ERR_EID, "Reset Counters")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_ResetCountersCmd_t), FM_RESET_PKT_ERR_EID, + "Reset Counters")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_ResetCountersCmd(BufPtr); @@ -106,12 +107,12 @@ bool FM_ResetCountersVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_CopyFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_CopyFileVerifyDispatch(const FM_CopyFileCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_CopyFileCmd_t), FM_COPY_PKT_ERR_EID, "Copy File")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_CopyFileCmd_t), FM_COPY_PKT_ERR_EID, "Copy File")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_CopyFileCmd(BufPtr); @@ -123,12 +124,12 @@ bool FM_CopyFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_MoveFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_MoveFileVerifyDispatch(const FM_MoveFileCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_MoveFileCmd_t), FM_MOVE_PKT_ERR_EID, "Move File")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_MoveFileCmd_t), FM_MOVE_PKT_ERR_EID, "Move File")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_MoveFileCmd(BufPtr); @@ -140,12 +141,13 @@ bool FM_MoveFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_RenameFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_RenameFileVerifyDispatch(const FM_RenameFileCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_RenameFileCmd_t), FM_RENAME_PKT_ERR_EID, "Rename File")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_RenameFileCmd_t), FM_RENAME_PKT_ERR_EID, + "Rename File")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_RenameFileCmd(BufPtr); @@ -157,12 +159,13 @@ bool FM_RenameFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DeleteFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteFileVerifyDispatch(const FM_DeleteFileCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteFileCmd_t), FM_DELETE_PKT_ERR_EID, "Delete File")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_DeleteFileCmd_t), FM_DELETE_PKT_ERR_EID, + "Delete File")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_DeleteFileCmd(BufPtr); @@ -174,13 +177,13 @@ bool FM_DeleteFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DeleteAllFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteAllFilesVerifyDispatch(const FM_DeleteAllFilesCmd_t *BufPtr) { /* Verify message length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteAllFilesCmd_t), FM_DELETE_ALL_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_DeleteAllFilesCmd_t), FM_DELETE_ALL_PKT_ERR_EID, "Delete All Files")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_DeleteAllFilesCmd(BufPtr); @@ -192,12 +195,13 @@ bool FM_DeleteAllFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DecompressFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DecompressFileVerifyDispatch(const FM_DecompressFileCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DecompressFileCmd_t), FM_DECOM_PKT_ERR_EID, "Decompress File")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_DecompressFileCmd_t), FM_DECOM_PKT_ERR_EID, + "Decompress File")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_DecompressFileCmd(BufPtr); @@ -209,12 +213,13 @@ bool FM_DecompressFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_ConcatFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_ConcatFilesVerifyDispatch(const FM_ConcatFilesCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_ConcatFilesCmd_t), FM_CONCAT_PKT_ERR_EID, "Concat Files")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_ConcatFilesCmd_t), FM_CONCAT_PKT_ERR_EID, + "Concat Files")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_ConcatFilesCmd(BufPtr); @@ -226,13 +231,13 @@ bool FM_ConcatFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetFileInfoVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetFileInfoVerifyDispatch(const FM_GetFileInfoCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetFileInfoCmd_t), FM_GET_FILE_INFO_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_GetFileInfoCmd_t), FM_GET_FILE_INFO_PKT_ERR_EID, "Get File Info")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_GetFileInfoCmd(BufPtr); @@ -244,13 +249,13 @@ bool FM_GetFileInfoVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetOpenFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetOpenFilesVerifyDispatch(const FM_GetOpenFilesCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetOpenFilesCmd_t), FM_GET_OPEN_FILES_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_GetOpenFilesCmd_t), FM_GET_OPEN_FILES_PKT_ERR_EID, "Get Open Files")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_GetOpenFilesCmd(BufPtr); @@ -262,13 +267,13 @@ bool FM_GetOpenFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_CreateDirectoryVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_CreateDirectoryVerifyDispatch(const FM_CreateDirectoryCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_CreateDirectoryCmd_t), FM_CREATE_DIR_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_CreateDirectoryCmd_t), FM_CREATE_DIR_PKT_ERR_EID, "Create Directory")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_CreateDirectoryCmd(BufPtr); @@ -280,13 +285,13 @@ bool FM_CreateDirectoryVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_DeleteDirectoryVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteDirectoryVerifyDispatch(const FM_DeleteDirectoryCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_DeleteDirectoryCmd_t), FM_DELETE_DIR_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_DeleteDirectoryCmd_t), FM_DELETE_DIR_PKT_ERR_EID, "Delete Directory")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_DeleteDirectoryCmd(BufPtr); @@ -298,13 +303,13 @@ bool FM_DeleteDirectoryVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetDirListFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetDirListFileVerifyDispatch(const FM_GetDirListFileCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetDirListFileCmd_t), FM_GET_DIR_FILE_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_GetDirListFileCmd_t), FM_GET_DIR_FILE_PKT_ERR_EID, "Directory List to File")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_GetDirListFileCmd(BufPtr); @@ -316,13 +321,13 @@ bool FM_GetDirListFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_GetDirListPktVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetDirListPktVerifyDispatch(const FM_GetDirListPktCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_GetDirListPktCmd_t), FM_GET_DIR_PKT_PKT_ERR_EID, + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_GetDirListPktCmd_t), FM_GET_DIR_PKT_PKT_ERR_EID, "Directory List to Packet")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_GetDirListPktCmd(BufPtr); @@ -334,13 +339,13 @@ bool FM_GetDirListPktVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_MonitorFilesystemSpaceVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_MonitorFilesystemSpaceVerifyDispatch(const FM_MonitorFilesystemSpaceCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_MonitorFilesystemSpaceCmd_t), FM_GET_FREE_SPACE_PKT_ERR_EID, - "Get Free Space")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_MonitorFilesystemSpaceCmd_t), + FM_GET_FREE_SPACE_PKT_ERR_EID, "Get Free Space")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_MonitorFilesystemSpaceCmd(BufPtr); @@ -352,13 +357,13 @@ bool FM_MonitorFilesystemSpaceVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_SetTableStateVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_SetTableStateVerifyDispatch(const FM_SetTableStateCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SetTableStateCmd_t), FM_SET_TABLE_STATE_PKT_ERR_EID, - "Set Table State")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_SetTableStateCmd_t), + FM_SET_TABLE_STATE_PKT_ERR_EID, "Set Table State")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_SetTableStateCmd(BufPtr); @@ -370,12 +375,13 @@ bool FM_SetTableStateVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -bool FM_SetPermissionsVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_SetPermissionsVerifyDispatch(const FM_SetPermissionsCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SetPermissionsCmd_t), FM_SET_PERM_ERR_EID, "Set Permissions")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_SetPermissionsCmd_t), FM_SET_PERM_ERR_EID, + "Set Permissions")) { - return false; + return CFE_STATUS_VALIDATION_FAILURE; } return FM_SetPermissionsCmd(BufPtr); @@ -387,10 +393,10 @@ bool FM_SetPermissionsVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void FM_SendHkVerifyDispatch(const CFE_SB_Buffer_t *BufPtr) +void FM_SendHkVerifyDispatch(const FM_SendHkCmd_t *BufPtr) { /* Verify command packet length */ - if (!FM_IsValidCmdPktLength(&BufPtr->Msg, sizeof(FM_SendHkCmd_t), FM_HK_REQ_ERR_EID, "HK Request")) + if (!FM_IsValidCmdPktLength(&BufPtr->CommandHeader.Msg, sizeof(FM_SendHkCmd_t), FM_HK_REQ_ERR_EID, "HK Request")) { return; } @@ -414,7 +420,7 @@ void FM_ProcessPkt(const CFE_SB_Buffer_t *BufPtr) { /* Housekeeping request */ case FM_SEND_HK_MID: - FM_SendHkVerifyDispatch(BufPtr); + FM_SendHkVerifyDispatch((FM_SendHkCmd_t *)BufPtr); break; /* FM ground commands */ @@ -437,7 +443,7 @@ void FM_ProcessPkt(const CFE_SB_Buffer_t *BufPtr) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr) { - bool Result; + CFE_Status_t Status = FM_ERROR; CFE_MSG_FcnCode_t CommandCode = 0; CFE_MSG_GetFcnCode(&BufPtr->Msg, &CommandCode); @@ -446,85 +452,84 @@ void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr) switch (CommandCode) { case FM_NOOP_CC: - Result = FM_NoopVerifyDispatch(BufPtr); + Status = FM_NoopVerifyDispatch((FM_NoopCmd_t *)BufPtr); break; case FM_RESET_COUNTERS_CC: - Result = FM_ResetCountersVerifyDispatch(BufPtr); + Status = FM_ResetCountersVerifyDispatch((FM_ResetCountersCmd_t *)BufPtr); break; case FM_COPY_FILE_CC: - Result = FM_CopyFileVerifyDispatch(BufPtr); + Status = FM_CopyFileVerifyDispatch((FM_CopyFileCmd_t *)BufPtr); break; case FM_MOVE_FILE_CC: - Result = FM_MoveFileVerifyDispatch(BufPtr); + Status = FM_MoveFileVerifyDispatch((FM_MoveFileCmd_t *)BufPtr); break; case FM_RENAME_FILE_CC: - Result = FM_RenameFileVerifyDispatch(BufPtr); + Status = FM_RenameFileVerifyDispatch((FM_RenameFileCmd_t *)BufPtr); break; case FM_DELETE_FILE_CC: - Result = FM_DeleteFileVerifyDispatch(BufPtr); + Status = FM_DeleteFileVerifyDispatch((FM_DeleteFileCmd_t *)BufPtr); break; case FM_DELETE_ALL_FILES_CC: - Result = FM_DeleteAllFilesVerifyDispatch(BufPtr); + Status = FM_DeleteAllFilesVerifyDispatch((FM_DeleteAllFilesCmd_t *)BufPtr); break; case FM_DECOMPRESS_FILE_CC: - Result = FM_DecompressFileVerifyDispatch(BufPtr); + Status = FM_DecompressFileVerifyDispatch((FM_DecompressFileCmd_t *)BufPtr); break; case FM_CONCAT_FILES_CC: - Result = FM_ConcatFilesVerifyDispatch(BufPtr); + Status = FM_ConcatFilesVerifyDispatch((FM_ConcatFilesCmd_t *)BufPtr); break; case FM_GET_FILE_INFO_CC: - Result = FM_GetFileInfoVerifyDispatch(BufPtr); + Status = FM_GetFileInfoVerifyDispatch((FM_GetFileInfoCmd_t *)BufPtr); break; case FM_GET_OPEN_FILES_CC: - Result = FM_GetOpenFilesVerifyDispatch(BufPtr); + Status = FM_GetOpenFilesVerifyDispatch((FM_GetOpenFilesCmd_t *)BufPtr); break; case FM_CREATE_DIRECTORY_CC: - Result = FM_CreateDirectoryVerifyDispatch(BufPtr); + Status = FM_CreateDirectoryVerifyDispatch((FM_CreateDirectoryCmd_t *)BufPtr); break; case FM_DELETE_DIRECTORY_CC: - Result = FM_DeleteDirectoryVerifyDispatch(BufPtr); + Status = FM_DeleteDirectoryVerifyDispatch((FM_DeleteDirectoryCmd_t *)BufPtr); break; case FM_GET_DIR_LIST_FILE_CC: - Result = FM_GetDirListFileVerifyDispatch(BufPtr); + Status = FM_GetDirListFileVerifyDispatch((FM_GetDirListFileCmd_t *)BufPtr); break; case FM_GET_DIR_LIST_PKT_CC: - Result = FM_GetDirListPktVerifyDispatch(BufPtr); + Status = FM_GetDirListPktVerifyDispatch((FM_GetDirListPktCmd_t *)BufPtr); break; case FM_MONITOR_FILESYSTEM_SPACE_CC: - Result = FM_MonitorFilesystemSpaceVerifyDispatch(BufPtr); + Status = FM_MonitorFilesystemSpaceVerifyDispatch((FM_MonitorFilesystemSpaceCmd_t *)BufPtr); break; case FM_SET_TABLE_STATE_CC: - Result = FM_SetTableStateVerifyDispatch(BufPtr); + Status = FM_SetTableStateVerifyDispatch((FM_SetTableStateCmd_t *)BufPtr); break; case FM_SET_PERMISSIONS_CC: - Result = FM_SetPermissionsVerifyDispatch(BufPtr); + Status = FM_SetPermissionsVerifyDispatch((FM_SetPermissionsCmd_t *)BufPtr); break; default: - Result = false; CFE_EVS_SendEvent(FM_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Main loop error: invalid command code: cc = %d", CommandCode); break; } - if (Result) + if (Status == CFE_SUCCESS) { /* Increment command success counter */ if (CommandCode != FM_RESET_COUNTERS_CC) diff --git a/fsw/src/fm_dispatch.h b/fsw/src/fm_dispatch.h index f998068..8db8a90 100644 --- a/fsw/src/fm_dispatch.h +++ b/fsw/src/fm_dispatch.h @@ -80,24 +80,24 @@ bool FM_IsValidCmdPktLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLeng * Internal dispatch function for each command - * These are declared here so they can be directly invoked by the unit test for coverage */ -bool FM_NoopVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_ResetCountersVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_CopyFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_MoveFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_RenameFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_DeleteFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_DeleteAllFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_DecompressFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_ConcatFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_GetFileInfoVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_GetOpenFilesVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_CreateDirectoryVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_DeleteDirectoryVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_GetDirListFileVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_GetDirListPktVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_MonitorFilesystemSpaceVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_SetTableStateVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -bool FM_SetPermissionsVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); -void FM_SendHkVerifyDispatch(const CFE_SB_Buffer_t *BufPtr); +CFE_Status_t FM_NoopVerifyDispatch(const FM_NoopCmd_t *BufPtr); +CFE_Status_t FM_ResetCountersVerifyDispatch(const FM_ResetCountersCmd_t *BufPtr); +CFE_Status_t FM_CopyFileVerifyDispatch(const FM_CopyFileCmd_t *BufPtr); +CFE_Status_t FM_MoveFileVerifyDispatch(const FM_MoveFileCmd_t *BufPtr); +CFE_Status_t FM_RenameFileVerifyDispatch(const FM_RenameFileCmd_t *BufPtr); +CFE_Status_t FM_DeleteFileVerifyDispatch(const FM_DeleteFileCmd_t *BufPtr); +CFE_Status_t FM_DeleteAllFilesVerifyDispatch(const FM_DeleteAllFilesCmd_t *BufPtr); +CFE_Status_t FM_DecompressFileVerifyDispatch(const FM_DecompressFileCmd_t *BufPtr); +CFE_Status_t FM_ConcatFilesVerifyDispatch(const FM_ConcatFilesCmd_t *BufPtr); +CFE_Status_t FM_GetFileInfoVerifyDispatch(const FM_GetFileInfoCmd_t *BufPtr); +CFE_Status_t FM_GetOpenFilesVerifyDispatch(const FM_GetOpenFilesCmd_t *BufPtr); +CFE_Status_t FM_CreateDirectoryVerifyDispatch(const FM_CreateDirectoryCmd_t *BufPtr); +CFE_Status_t FM_DeleteDirectoryVerifyDispatch(const FM_DeleteDirectoryCmd_t *BufPtr); +CFE_Status_t FM_GetDirListFileVerifyDispatch(const FM_GetDirListFileCmd_t *BufPtr); +CFE_Status_t FM_GetDirListPktVerifyDispatch(const FM_GetDirListPktCmd_t *BufPtr); +CFE_Status_t FM_MonitorFilesystemSpaceVerifyDispatch(const FM_MonitorFilesystemSpaceCmd_t *BufPtr); +CFE_Status_t FM_SetTableStateVerifyDispatch(const FM_SetTableStateCmd_t *BufPtr); +CFE_Status_t FM_SetPermissionsVerifyDispatch(const FM_SetPermissionsCmd_t *BufPtr); +void FM_SendHkVerifyDispatch(const FM_SendHkCmd_t *BufPtr); #endif diff --git a/fsw/src/fm_tbl.c b/fsw/src/fm_tbl.c index 59377a7..c740f03 100644 --- a/fsw/src/fm_tbl.c +++ b/fsw/src/fm_tbl.c @@ -38,9 +38,9 @@ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 FM_TableInit(void) +CFE_Status_t FM_TableInit(void) { - int32 Status; + CFE_Status_t Status; /* Initialize file system free space table pointer */ FM_GlobalData.MonitorTablePtr = NULL; @@ -68,11 +68,11 @@ int32 FM_TableInit(void) /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int32 FM_ValidateTable(FM_MonitorTable_t *TablePtr) +CFE_Status_t FM_ValidateTable(FM_MonitorTable_t *TablePtr) { - int32 Result = CFE_SUCCESS; - int32 NameLength; - int32 i = 0; + CFE_Status_t Result = CFE_SUCCESS; + int32 NameLength; + int32 i = 0; int32 CountGood = 0; int32 CountBad = 0; diff --git a/fsw/src/fm_tbl.h b/fsw/src/fm_tbl.h index e50b33a..5c7a1b8 100644 --- a/fsw/src/fm_tbl.h +++ b/fsw/src/fm_tbl.h @@ -49,7 +49,7 @@ * * \sa /FM_AppInit */ -int32 FM_TableInit(void); +CFE_Status_t FM_TableInit(void); /** * \brief Table Verification Function @@ -70,7 +70,7 @@ int32 FM_TableInit(void); * * \sa /FM_AppInit */ -int32 FM_ValidateTable(FM_MonitorTable_t *TablePtr); +CFE_Status_t FM_ValidateTable(FM_MonitorTable_t *TablePtr); /** * \brief Acquire Table Data Pointer Function diff --git a/unit-test/fm_cmds_tests.c b/unit-test/fm_cmds_tests.c index 4614ab7..c9e8c0d 100644 --- a/unit-test/fm_cmds_tests.c +++ b/unit-test/fm_cmds_tests.c @@ -65,12 +65,12 @@ void Test_FM_NoopCmd_Success(void) char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "%%s command: FM version %%d.%%d.%%d.%%d"); - bool Result = FM_NoopCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_NoopCmd(&UT_CmdBuf.NoopCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_NoopCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_NoopCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1); @@ -104,12 +104,12 @@ void Test_FM_ResetCountersCmd_Success(void) FM_GlobalData.ChildCmdErrCounter = 1; FM_GlobalData.ChildCmdWarnCounter = 1; - bool Result = FM_ResetCountersCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_ResetCountersCmd(&UT_CmdBuf.ResetCountersCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_ResetCountersCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_ResetCountersCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1); @@ -154,12 +154,12 @@ void Test_FM_CopyFileCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CopyFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CopyFileCmd(&UT_CmdBuf.CopyFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_CopyFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_CopyFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_COPY_FILE_CC); @@ -176,12 +176,12 @@ void Test_FM_CopyFileCmd_BadOverwrite(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CopyFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CopyFileCmd(&UT_CmdBuf.CopyFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CopyFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CopyFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -198,12 +198,12 @@ void Test_FM_CopyFileCmd_SourceNotExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CopyFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CopyFileCmd(&UT_CmdBuf.CopyFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CopyFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CopyFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -220,12 +220,12 @@ void Test_FM_CopyFileCmd_NoOverwriteTargetExists(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CopyFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CopyFileCmd(&UT_CmdBuf.CopyFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CopyFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CopyFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -247,12 +247,12 @@ void Test_FM_CopyFileCmd_OverwriteFileOpen(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CopyFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CopyFileCmd(&UT_CmdBuf.CopyFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CopyFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CopyFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -269,12 +269,12 @@ void Test_FM_CopyFileCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_CopyFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CopyFileCmd(&UT_CmdBuf.CopyFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CopyFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CopyFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -313,12 +313,12 @@ void Test_FM_MoveFileCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_MoveFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_MoveFileCmd(&UT_CmdBuf.MoveFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_MoveFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_MoveFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_MOVE_FILE_CC); @@ -335,12 +335,12 @@ void Test_FM_MoveFileCmd_BadOverwrite(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_MoveFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_MoveFileCmd(&UT_CmdBuf.MoveFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_MoveFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_MoveFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -357,12 +357,12 @@ void Test_FM_MoveFileCmd_SourceNotExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_MoveFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_MoveFileCmd(&UT_CmdBuf.MoveFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_MoveFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_MoveFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -379,12 +379,12 @@ void Test_FM_MoveFileCmd_NoOverwriteTargetExists(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_MoveFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_MoveFileCmd(&UT_CmdBuf.MoveFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_MoveFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_MoveFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -406,12 +406,12 @@ void Test_FM_MoveFileCmd_OverwriteFileOpen(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_MoveFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_MoveFileCmd(&UT_CmdBuf.MoveFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_MoveFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_MoveFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -428,12 +428,12 @@ void Test_FM_MoveFileCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_MoveFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_MoveFileCmd(&UT_CmdBuf.MoveFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_MoveFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_MoveFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -477,12 +477,12 @@ void Test_FM_RenameFileCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_RenameFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_RenameFileCmd(&UT_CmdBuf.RenameFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_RenameFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_RenameFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_RENAME_FILE_CC); @@ -497,12 +497,12 @@ void Test_FM_RenameFileCmd_SourceNotExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_RenameFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_RenameFileCmd(&UT_CmdBuf.RenameFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_RenameFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_RenameFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -517,12 +517,12 @@ void Test_FM_RenameFileCmd_TargetExists(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_RenameFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_RenameFileCmd(&UT_CmdBuf.RenameFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_RenameFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_RenameFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -537,12 +537,12 @@ void Test_FM_RenameFileCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_RenameFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_RenameFileCmd(&UT_CmdBuf.RenameFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_RenameFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_RenameFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -576,12 +576,12 @@ void Test_FM_DeleteFileCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileClosed), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DeleteFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteFileCmd(&UT_CmdBuf.DeleteFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_DeleteFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_DeleteFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_DELETE_FILE_CC); @@ -598,12 +598,12 @@ void Test_FM_DeleteFileCmd_FileNotClosed(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileClosed), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DeleteFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteFileCmd(&UT_CmdBuf.DeleteFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DeleteFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DeleteFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -620,12 +620,12 @@ void Test_FM_DeleteFileCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileClosed), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_DeleteFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteFileCmd(&UT_CmdBuf.DeleteFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DeleteFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DeleteFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -659,12 +659,12 @@ void Test_FM_DeleteAllFilesCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DeleteAllFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteAllFilesCmd(&UT_CmdBuf.DeleteAllFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_DeleteAllFilesCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_DeleteAllFilesCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_DELETE_ALL_FILES_CC); @@ -678,12 +678,12 @@ void Test_FM_DeleteAllFilesCmd_DirNoExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DeleteAllFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteAllFilesCmd(&UT_CmdBuf.DeleteAllFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DeleteAllFilesCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DeleteAllFilesCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -702,12 +702,12 @@ void Test_FM_DeleteAllFilesCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_DeleteAllFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteAllFilesCmd(&UT_CmdBuf.DeleteAllFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DeleteAllFilesCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DeleteAllFilesCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -737,12 +737,12 @@ void Test_FM_DecompressFileCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DecompressFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DecompressFileCmd(&UT_CmdBuf.DecompressFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_DecompressFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_DecompressFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_DECOMPRESS_FILE_CC); @@ -757,12 +757,12 @@ void Test_FM_DecompressFileCmd_SourceFileOpen(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DecompressFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DecompressFileCmd(&UT_CmdBuf.DecompressFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DecompressFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DecompressFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -777,12 +777,12 @@ void Test_FM_DecompressFileCmd_TargetFileExists(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DecompressFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DecompressFileCmd(&UT_CmdBuf.DecompressFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DecompressFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DecompressFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -797,12 +797,12 @@ void Test_FM_DecompressFileCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_DecompressFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DecompressFileCmd(&UT_CmdBuf.DecompressFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DecompressFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DecompressFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -843,12 +843,12 @@ void Test_FM_ConcatFilesCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_ConcatFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_ConcatFilesCmd(&UT_CmdBuf.ConcatFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_ConcatFilesCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_ConcatFilesCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_CONCAT_FILES_CC); @@ -863,11 +863,11 @@ void Test_FM_ConcatFilesCmd_SourceFile1NotClosed(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_ConcatFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_ConcatFilesCmd(&UT_CmdBuf.ConcatFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_ConcatFilesCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_ConcatFilesCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -883,11 +883,11 @@ void Test_FM_ConcatFilesCmd_SourceFile2NotClosed(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_ConcatFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_ConcatFilesCmd(&UT_CmdBuf.ConcatFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_ConcatFilesCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_ConcatFilesCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -902,11 +902,11 @@ void Test_FM_ConcatFilesCmd_TargetFileExists(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_ConcatFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_ConcatFilesCmd(&UT_CmdBuf.ConcatFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_ConcatFilesCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_ConcatFilesCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -921,11 +921,11 @@ void Test_FM_ConcatFilesCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_ConcatFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_ConcatFilesCmd(&UT_CmdBuf.ConcatFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_ConcatFilesCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_ConcatFilesCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -966,12 +966,12 @@ void Test_FM_GetFileInfoCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyNameValid), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetFileInfoCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetFileInfoCmd(&UT_CmdBuf.GetFileInfoCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_GetFileInfoCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_GetFileInfoCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_GET_FILE_INFO_CC); @@ -985,12 +985,12 @@ void Test_FM_GetFileInfoCmd_InvalidName(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyNameValid), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetFileInfoCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetFileInfoCmd(&UT_CmdBuf.GetFileInfoCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetFileInfoCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetFileInfoCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1004,12 +1004,12 @@ void Test_FM_GetFileInfoCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyNameValid), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_GetFileInfoCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetFileInfoCmd(&UT_CmdBuf.GetFileInfoCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetFileInfoCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetFileInfoCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1036,12 +1036,12 @@ void Test_FM_GetOpenFilesCmd_Success(void) char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "%%s command"); - bool Result = FM_GetOpenFilesCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetOpenFilesCmd(&UT_CmdBuf.GetOpenFilesCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_GetOpenFilesCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_GetOpenFilesCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1); @@ -1076,12 +1076,12 @@ void Test_FM_CreateDirectoryCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CreateDirectoryCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CreateDirectoryCmd(&UT_CmdBuf.CreateDirectoryCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_CreateDirectoryCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_CreateDirectoryCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_CREATE_DIRECTORY_CC); @@ -1095,12 +1095,12 @@ void Test_FM_CreateDirectoryCmd_DirExists(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirNoExist), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_CreateDirectoryCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CreateDirectoryCmd(&UT_CmdBuf.CreateDirectoryCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CreateDirectoryCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CreateDirectoryCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1114,12 +1114,12 @@ void Test_FM_CreateDirectoryCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirNoExist), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_CreateDirectoryCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_CreateDirectoryCmd(&UT_CmdBuf.CreateDirectoryCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_CreateDirectoryCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_CreateDirectoryCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1154,12 +1154,12 @@ void Test_FM_DeleteDirectoryCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DeleteDirectoryCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteDirectoryCmd(&UT_CmdBuf.DeleteDirectoryCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_DeleteDirectoryCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_DeleteDirectoryCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_DELETE_DIRECTORY_CC); @@ -1173,12 +1173,12 @@ void Test_FM_DeleteDirectoryCmd_DirNoExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_DeleteDirectoryCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteDirectoryCmd(&UT_CmdBuf.DeleteDirectoryCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DeleteDirectoryCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DeleteDirectoryCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1192,12 +1192,12 @@ void Test_FM_DeleteDirectoryCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_DeleteDirectoryCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_DeleteDirectoryCmd(&UT_CmdBuf.DeleteDirectoryCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_DeleteDirectoryCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_DeleteDirectoryCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1234,12 +1234,12 @@ void Test_FM_GetDirListFileCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetDirListFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListFileCmd(&UT_CmdBuf.GetDirListFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_GetDirListFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_GetDirListFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_GET_DIR_LIST_FILE_CC); @@ -1260,12 +1260,12 @@ void Test_FM_GetDirListFileCmd_SuccessDefaultPath(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetDirListFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListFileCmd(&UT_CmdBuf.GetDirListFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_GetDirListFileCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_GetDirListFileCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_GET_DIR_LIST_FILE_CC); @@ -1280,12 +1280,12 @@ void Test_FM_GetDirListFileCmd_SourceNotExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetDirListFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListFileCmd(&UT_CmdBuf.GetDirListFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetDirListFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetDirListFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1307,12 +1307,12 @@ void Test_FM_GetDirListFileCmd_TargetFileOpen(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetDirListFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListFileCmd(&UT_CmdBuf.GetDirListFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetDirListFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetDirListFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1334,12 +1334,12 @@ void Test_FM_GetDirListFileCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyFileNotOpen), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_GetDirListFileCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListFileCmd(&UT_CmdBuf.GetDirListFileCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetDirListFileCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetDirListFileCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1380,12 +1380,12 @@ void Test_FM_GetDirListPktCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetDirListPktCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListPktCmd(&UT_CmdBuf.GetDirListPktCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_GetDirListPktCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_GetDirListPktCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_GET_DIR_LIST_PKT_CC); @@ -1399,12 +1399,12 @@ void Test_FM_GetDirListPktCmd_SourceNotExist(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_GetDirListPktCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListPktCmd(&UT_CmdBuf.GetDirListPktCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetDirListPktCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetDirListPktCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1418,12 +1418,12 @@ void Test_FM_GetDirListPktCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), false); - bool Result = FM_GetDirListPktCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_GetDirListPktCmd(&UT_CmdBuf.GetDirListPktCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_GetDirListPktCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_GetDirListPktCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1487,7 +1487,7 @@ void Test_FM_MonitorFilesystemSpaceCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyDirExists), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - UtAssert_BOOL_TRUE(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.GetFreeSpaceCmd), CFE_SUCCESS); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_MONITOR_FILESYSTEM_SPACE_CMD_EID); @@ -1521,7 +1521,7 @@ void Test_FM_MonitorFilesystemSpaceCmd_NullFreeSpaceTable(void) FM_GlobalData.MonitorTablePtr = NULL; - UtAssert_BOOL_FALSE(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.GetFreeSpaceCmd), CFE_STATUS_INCORRECT_STATE); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); uint8 call_count_CFE_SB_TransmitMsg = UT_GetStubCount(UT_KEY(CFE_SB_TransmitMsg)); @@ -1561,7 +1561,7 @@ void Test_FM_MonitorFilesystemSpaceCmd_ImplCallFails(void) UT_SetDefaultReturnValue(UT_KEY(FM_GetVolumeFreeSpace), CFE_STATUS_EXTERNAL_RESOURCE_FAIL); /* Assert */ - UtAssert_BOOL_FALSE(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.GetFreeSpaceCmd), FM_ERROR); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); @@ -1603,7 +1603,7 @@ void Test_FM_MonitorFilesystemSpaceCmd_NotImpl(void) FM_GlobalData.MonitorTablePtr = &DummyTable; /* Assert */ - UtAssert_BOOL_FALSE(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MonitorFilesystemSpaceCmd(&UT_CmdBuf.GetFreeSpaceCmd), FM_ERROR); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); @@ -1663,7 +1663,7 @@ void Test_FM_SetTableStateCmd_Success(void) DummyTable.Entries[0].Type = FM_MonitorTableEntry_Type_VOLUME_FREE_SPACE; FM_GlobalData.MonitorTablePtr = &DummyTable; - UtAssert_BOOL_TRUE(FM_SetTableStateCmd(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_SetTableStateCmd(&UT_CmdBuf.SetTableStateCmd), CFE_SUCCESS); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_SET_TABLE_STATE_CMD_EID); @@ -1694,12 +1694,12 @@ void Test_FM_SetTableStateCmd_NullFreeSpaceTable(void) FM_GlobalData.MonitorTablePtr = NULL; - bool Result = FM_SetTableStateCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_SetTableStateCmd(&UT_CmdBuf.SetTableStateCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_SetTableStateCmd returned false"); + UtAssert_True(Result == CFE_STATUS_INCORRECT_STATE, "FM_SetTableStateCmd returned CFE_STATUS_INCORRECT_STATE"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 1); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_SET_TABLE_STATE_TBL_ERR_EID); @@ -1731,10 +1731,10 @@ void Test_FM_SetTableStateCmd_TableEntryIndexTooLarge(void) FM_GlobalData.MonitorTablePtr = &DummyTable; - bool Result = FM_SetTableStateCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_SetTableStateCmd(&UT_CmdBuf.SetTableStateCmd); /* Assert */ - UtAssert_True(Result == false, "FM_SetTableStateCmd returned false"); + UtAssert_True(Result == CFE_STATUS_RANGE_ERROR, "FM_SetTableStateCmd returned CFE_STATUS_RANGE_ERROR"); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_SET_TABLE_STATE_ARG_IDX_ERR_EID); @@ -1768,10 +1768,10 @@ void Test_FM_SetTableStateCmd_BadNewState(void) FM_GlobalData.MonitorTablePtr = &DummyTable; - bool Result = FM_SetTableStateCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_SetTableStateCmd(&UT_CmdBuf.SetTableStateCmd); /* Assert */ - UtAssert_True(Result == false, "FM_SetTableStateCmd returned false"); + UtAssert_True(Result == CFE_STATUS_RANGE_ERROR, "FM_SetTableStateCmd returned CFE_STATUS_RANGE_ERROR"); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_SET_TABLE_STATE_ARG_STATE_ERR_EID); @@ -1805,7 +1805,7 @@ void Test_FM_SetTableStateCmd_BadCurrentState(void) FM_GlobalData.MonitorTablePtr = &DummyTable; - UtAssert_BOOL_FALSE(FM_SetTableStateCmd(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_SetTableStateCmd(&UT_CmdBuf.SetTableStateCmd), CFE_STATUS_INCORRECT_STATE); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, FM_SET_TABLE_STATE_UNUSED_ERR_EID); @@ -1851,12 +1851,12 @@ void Test_FM_SetPermissionsCmd_Success(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyNameValid), true); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_SetPermissionsCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_SetPermissionsCmd(&UT_CmdBuf.SetPermissionsCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == true, "FM_SetPermissionsCmd returned true"); + UtAssert_True(Result == CFE_SUCCESS, "FM_SetPermissionsCmd returned CFE_SUCCESS"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, FM_SET_PERMISSIONS_CC); @@ -1868,12 +1868,12 @@ void Test_FM_SetPermissionsCmd_BadName(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyNameValid), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_SetPermissionsCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_SetPermissionsCmd(&UT_CmdBuf.SetPermissionsCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_SetPermissionsCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_SetPermissionsCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); @@ -1885,12 +1885,12 @@ void Test_FM_SetPermissionsCmd_NoChildTask(void) UT_SetDefaultReturnValue(UT_KEY(FM_VerifyNameValid), false); UT_SetDefaultReturnValue(UT_KEY(FM_VerifyChildTask), true); - bool Result = FM_SetPermissionsCmd(&UT_CmdBuf.Buf); + CFE_Status_t Result = FM_SetPermissionsCmd(&UT_CmdBuf.SetPermissionsCmd); call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); /* Assert */ - UtAssert_True(Result == false, "FM_SetPermissionsCmd returned false"); + UtAssert_True(Result == FM_ERROR, "FM_SetPermissionsCmd returned FM_ERROR"); UtAssert_INT32_EQ(call_count_CFE_EVS_SendEvent, 0); UtAssert_INT32_EQ(FM_GlobalData.ChildQueue[0].CommandCode, 0); diff --git a/unit-test/fm_dispatch_tests.c b/unit-test/fm_dispatch_tests.c index d813f74..3f233d3 100644 --- a/unit-test/fm_dispatch_tests.c +++ b/unit-test/fm_dispatch_tests.c @@ -63,7 +63,7 @@ void Test_FM_ProcessCmd_NoopCmdCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_NoopCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_NoopCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_NoopCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -85,7 +85,7 @@ void Test_FM_ProcessCmd_ResetCountersCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_ResetCountersCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_ResetCountersCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_ResetCountersCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -107,7 +107,7 @@ void Test_FM_ProcessCmd_CopyFileCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_CopyFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_CopyFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_CopyFileCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -129,7 +129,7 @@ void Test_FM_ProcessCmd_MoveFileCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_MoveFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_MoveFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_MoveFileCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -151,7 +151,7 @@ void Test_FM_ProcessCmd_RenameFileCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_RenameFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_RenameFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_RenameFileCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -173,7 +173,7 @@ void Test_FM_ProcessCmd_DeleteFileCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_DeleteFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_DeleteFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DeleteFileCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -195,7 +195,7 @@ void Test_FM_ProcessCmd_DeleteAllFilesCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_DeleteAllFilesCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_DeleteAllFilesCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DeleteAllFilesCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -217,7 +217,7 @@ void Test_FM_ProcessCmd_DecompressFileCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_DecompressFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_DecompressFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DecompressFileCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -239,7 +239,7 @@ void Test_FM_ProcessCmd_ConcatFilesCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_ConcatFilesCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_ConcatFilesCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_ConcatFilesCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -261,7 +261,7 @@ void Test_FM_ProcessCmd_GetFileInfoCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_GetFileInfoCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_GetFileInfoCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetFileInfoCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -283,7 +283,7 @@ void Test_FM_ProcessCmd_GetOpenFilesCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_GetOpenFilesCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_GetOpenFilesCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetOpenFilesCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -305,7 +305,7 @@ void Test_FM_ProcessCmd_CreateDirectoryCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_CreateDirectoryCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_CreateDirectoryCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_CreateDirectoryCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -327,7 +327,7 @@ void Test_FM_ProcessCmd_DeleteDirectoryCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_DeleteDirectoryCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_DeleteDirectoryCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DeleteDirectoryCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -349,7 +349,7 @@ void Test_FM_ProcessCmd_GetDirListFileCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_GetDirListFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListFileCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -371,7 +371,7 @@ void Test_FM_ProcessCmd_GetDirListPktCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_GetDirListPktCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListPktCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListPktCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -393,7 +393,7 @@ void Test_FM_ProcessCmd_MonitorFilesystemSpaceCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_MonitorFilesystemSpaceCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_MonitorFilesystemSpaceCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_MonitorFilesystemSpaceCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -415,7 +415,7 @@ void Test_FM_ProcessCmd_SetTableStateCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_SetTableStateCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_SetTableStateCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_SetTableStateCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -437,7 +437,7 @@ void Test_FM_ProcessCmd_SetPermissionsCCReturn(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &fcn_code, sizeof(fcn_code), false); length = sizeof(FM_SetPermissionsCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UT_SetDefaultReturnValue(UT_KEY(FM_SetPermissionsCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_SetPermissionsCmd), CFE_SUCCESS); /* Act */ UtAssert_VOIDCALL(FM_ProcessCmd(NULL)); @@ -632,270 +632,271 @@ void Test_FM_NoopVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_NoopCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_NoopCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_NoopVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_NoopVerifyDispatch(&UT_CmdBuf.NoopCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_NoopCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_NoopVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_NoopVerifyDispatch(&UT_CmdBuf.NoopCmd), CFE_SUCCESS); } void Test_FM_ResetCountersVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_ResetCountersCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_ResetCountersCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_ResetCountersVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_ResetCountersVerifyDispatch(&UT_CmdBuf.ResetCountersCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_ResetCountersCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_ResetCountersVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_ResetCountersVerifyDispatch(&UT_CmdBuf.ResetCountersCmd), CFE_SUCCESS); } void Test_FM_CopyFileVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_CopyFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_CopyFileCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_CopyFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_CopyFileVerifyDispatch(&UT_CmdBuf.CopyFileCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_CopyFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_CopyFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_CopyFileVerifyDispatch(&UT_CmdBuf.CopyFileCmd), CFE_SUCCESS); } void Test_FM_MoveFileVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_MoveFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_MoveFileCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_MoveFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MoveFileVerifyDispatch(&UT_CmdBuf.MoveFileCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_MoveFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_MoveFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MoveFileVerifyDispatch(&UT_CmdBuf.MoveFileCmd), CFE_SUCCESS); } void Test_FM_RenameFileVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_RenameFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_RenameFileCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_RenameFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_RenameFileVerifyDispatch(&UT_CmdBuf.RenameFileCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_RenameFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_RenameFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_RenameFileVerifyDispatch(&UT_CmdBuf.RenameFileCmd), CFE_SUCCESS); } void Test_FM_DeleteFileVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_DeleteFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DeleteFileCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_DeleteFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DeleteFileVerifyDispatch(&UT_CmdBuf.DeleteFileCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_DeleteFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_DeleteFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DeleteFileVerifyDispatch(&UT_CmdBuf.DeleteFileCmd), CFE_SUCCESS); } void Test_FM_DeleteAllFilesVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_DeleteAllFilesCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DeleteAllFilesCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_DeleteAllFilesVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DeleteAllFilesVerifyDispatch(&UT_CmdBuf.DeleteAllFilesCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_DeleteAllFilesCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_DeleteAllFilesVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DeleteAllFilesVerifyDispatch(&UT_CmdBuf.DeleteAllFilesCmd), CFE_SUCCESS); } void Test_FM_DecompressFileVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_DecompressFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DecompressFileCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_DecompressFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DecompressFileVerifyDispatch(&UT_CmdBuf.DecompressFileCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_DecompressFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_DecompressFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DecompressFileVerifyDispatch(&UT_CmdBuf.DecompressFileCmd), CFE_SUCCESS); } void Test_FM_ConcatFilesVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_ConcatFilesCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_ConcatFilesCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_ConcatFilesVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_ConcatFilesVerifyDispatch(&UT_CmdBuf.ConcatFilesCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_ConcatFilesCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_ConcatFilesVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_ConcatFilesVerifyDispatch(&UT_CmdBuf.ConcatFilesCmd), CFE_SUCCESS); } void Test_FM_GetFileInfoVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_GetFileInfoCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetFileInfoCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_GetFileInfoVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetFileInfoVerifyDispatch(&UT_CmdBuf.GetFileInfoCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_GetFileInfoCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_GetFileInfoVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetFileInfoVerifyDispatch(&UT_CmdBuf.GetFileInfoCmd), CFE_SUCCESS); } void Test_FM_GetOpenFilesVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_GetOpenFilesCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetOpenFilesCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_GetOpenFilesVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetOpenFilesVerifyDispatch(&UT_CmdBuf.GetOpenFilesCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_GetOpenFilesCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_GetOpenFilesVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetOpenFilesVerifyDispatch(&UT_CmdBuf.GetOpenFilesCmd), CFE_SUCCESS); } void Test_FM_CreateDirectoryVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_CreateDirectoryCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_CreateDirectoryCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_CreateDirectoryVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_CreateDirectoryVerifyDispatch(&UT_CmdBuf.CreateDirectoryCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_CreateDirectoryCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_CreateDirectoryVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_CreateDirectoryVerifyDispatch(&UT_CmdBuf.CreateDirectoryCmd), CFE_SUCCESS); } void Test_FM_DeleteDirectoryVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_DeleteDirectoryCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_DeleteDirectoryCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_DeleteDirectoryVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DeleteDirectoryVerifyDispatch(&UT_CmdBuf.DeleteDirectoryCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_DeleteDirectoryCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_DeleteDirectoryVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_DeleteDirectoryVerifyDispatch(&UT_CmdBuf.DeleteDirectoryCmd), CFE_SUCCESS); } void Test_FM_GetDirListFileVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListFileCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListFileCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_GetDirListFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetDirListFileVerifyDispatch(&UT_CmdBuf.GetDirListFileCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_GetDirListFileCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_GetDirListFileVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetDirListFileVerifyDispatch(&UT_CmdBuf.GetDirListFileCmd), CFE_SUCCESS); } void Test_FM_GetDirListPktVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListPktCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_GetDirListPktCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_GetDirListPktVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetDirListPktVerifyDispatch(&UT_CmdBuf.GetDirListPktCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_GetDirListPktCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_GetDirListPktVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_GetDirListPktVerifyDispatch(&UT_CmdBuf.GetDirListPktCmd), CFE_SUCCESS); } void Test_FM_MonitorFilesystemSpaceVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_MonitorFilesystemSpaceCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_MonitorFilesystemSpaceCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_MonitorFilesystemSpaceVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MonitorFilesystemSpaceVerifyDispatch(&UT_CmdBuf.GetFreeSpaceCmd), + CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_MonitorFilesystemSpaceCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_MonitorFilesystemSpaceVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_MonitorFilesystemSpaceVerifyDispatch(&UT_CmdBuf.GetFreeSpaceCmd), CFE_SUCCESS); } void Test_FM_SetTableStateVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_SetTableStateCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_SetTableStateCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_SetTableStateVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_SetTableStateVerifyDispatch(&UT_CmdBuf.SetTableStateCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_SetTableStateCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_SetTableStateVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_SetTableStateVerifyDispatch(&UT_CmdBuf.SetTableStateCmd), CFE_SUCCESS); } void Test_FM_SetPermissionsVerifyDispatch(void) { size_t length; - UT_SetDefaultReturnValue(UT_KEY(FM_SetPermissionsCmd), true); + UT_SetDefaultReturnValue(UT_KEY(FM_SetPermissionsCmd), CFE_SUCCESS); length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_FALSE(FM_SetPermissionsVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_SetPermissionsVerifyDispatch(&UT_CmdBuf.SetPermissionsCmd), CFE_STATUS_VALIDATION_FAILURE); length = sizeof(FM_SetPermissionsCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_BOOL_TRUE(FM_SetPermissionsVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_INT32_EQ(FM_SetPermissionsVerifyDispatch(&UT_CmdBuf.SetPermissionsCmd), CFE_SUCCESS); } void Test_FM_SendHkVerifyDispatch(void) @@ -904,11 +905,11 @@ void Test_FM_SendHkVerifyDispatch(void) length = 1; /* bad size for any message */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_VOIDCALL(FM_SendHkVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_VOIDCALL(FM_SendHkVerifyDispatch(&UT_CmdBuf.SendHkCmd)); length = sizeof(FM_SendHkCmd_t); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &length, sizeof(length), false); - UtAssert_VOIDCALL(FM_SendHkVerifyDispatch(&UT_CmdBuf.Buf)); + UtAssert_VOIDCALL(FM_SendHkVerifyDispatch(&UT_CmdBuf.SendHkCmd)); } /* diff --git a/unit-test/stubs/fm_app_stubs.c b/unit-test/stubs/fm_app_stubs.c index a0eff3a..e73e48c 100644 --- a/unit-test/stubs/fm_app_stubs.c +++ b/unit-test/stubs/fm_app_stubs.c @@ -31,13 +31,13 @@ * Generated stub function for FM_AppInit() * ---------------------------------------------------- */ -int32 FM_AppInit(void) +CFE_Status_t FM_AppInit(void) { - UT_GenStub_SetupReturnBuffer(FM_AppInit, int32); + UT_GenStub_SetupReturnBuffer(FM_AppInit, CFE_Status_t); UT_GenStub_Execute(FM_AppInit, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_AppInit, int32); + return UT_GenStub_GetReturnValue(FM_AppInit, CFE_Status_t); } /* @@ -56,9 +56,9 @@ void FM_AppMain(void) * Generated stub function for FM_SendHkCmd() * ---------------------------------------------------- */ -void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr) +void FM_SendHkCmd(const FM_SendHkCmd_t *BufPtr) { - UT_GenStub_AddParam(FM_SendHkCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_SendHkCmd, const FM_SendHkCmd_t *, BufPtr); 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 c9a82de..f5d1519 100644 --- a/unit-test/stubs/fm_child_stubs.c +++ b/unit-test/stubs/fm_child_stubs.c @@ -187,13 +187,13 @@ void FM_ChildFileInfoCmd(FM_ChildQueueEntry_t *CmdArgs) * Generated stub function for FM_ChildInit() * ---------------------------------------------------- */ -int32 FM_ChildInit(void) +CFE_Status_t FM_ChildInit(void) { - UT_GenStub_SetupReturnBuffer(FM_ChildInit, int32); + UT_GenStub_SetupReturnBuffer(FM_ChildInit, CFE_Status_t); UT_GenStub_Execute(FM_ChildInit, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_ChildInit, int32); + return UT_GenStub_GetReturnValue(FM_ChildInit, CFE_Status_t); } /* diff --git a/unit-test/stubs/fm_cmd_utils_stubs.c b/unit-test/stubs/fm_cmd_utils_stubs.c index 6763c38..82c2239 100644 --- a/unit-test/stubs/fm_cmd_utils_stubs.c +++ b/unit-test/stubs/fm_cmd_utils_stubs.c @@ -54,9 +54,9 @@ void FM_AppendPathSep(char *Directory, uint32 BufferSize) * Generated stub function for FM_GetDirectorySpaceEstimate() * ---------------------------------------------------- */ -int32 FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, uint64 *ByteCount) +CFE_Status_t FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, uint64 *ByteCount) { - UT_GenStub_SetupReturnBuffer(FM_GetDirectorySpaceEstimate, int32); + UT_GenStub_SetupReturnBuffer(FM_GetDirectorySpaceEstimate, CFE_Status_t); UT_GenStub_AddParam(FM_GetDirectorySpaceEstimate, const char *, Directory); UT_GenStub_AddParam(FM_GetDirectorySpaceEstimate, uint64 *, BlockCount); @@ -64,7 +64,7 @@ int32 FM_GetDirectorySpaceEstimate(const char *Directory, uint64 *BlockCount, ui UT_GenStub_Execute(FM_GetDirectorySpaceEstimate, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_GetDirectorySpaceEstimate, int32); + return UT_GenStub_GetReturnValue(FM_GetDirectorySpaceEstimate, CFE_Status_t); } /* diff --git a/unit-test/stubs/fm_cmds_stubs.c b/unit-test/stubs/fm_cmds_stubs.c index 1699822..a727da3 100644 --- a/unit-test/stubs/fm_cmds_stubs.c +++ b/unit-test/stubs/fm_cmds_stubs.c @@ -31,15 +31,15 @@ * Generated stub function for FM_ConcatFilesCmd() * ---------------------------------------------------- */ -bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_ConcatFilesCmd(const FM_ConcatFilesCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_ConcatFilesCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_ConcatFilesCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_ConcatFilesCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_ConcatFilesCmd, const FM_ConcatFilesCmd_t *, BufPtr); UT_GenStub_Execute(FM_ConcatFilesCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_ConcatFilesCmd, bool); + return UT_GenStub_GetReturnValue(FM_ConcatFilesCmd, CFE_Status_t); } /* @@ -47,15 +47,15 @@ bool FM_ConcatFilesCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_CopyFileCmd() * ---------------------------------------------------- */ -bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_CopyFileCmd(const FM_CopyFileCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_CopyFileCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_CopyFileCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_CopyFileCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_CopyFileCmd, const FM_CopyFileCmd_t *, BufPtr); UT_GenStub_Execute(FM_CopyFileCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_CopyFileCmd, bool); + return UT_GenStub_GetReturnValue(FM_CopyFileCmd, CFE_Status_t); } /* @@ -63,15 +63,15 @@ bool FM_CopyFileCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_CreateDirectoryCmd() * ---------------------------------------------------- */ -bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_CreateDirectoryCmd(const FM_CreateDirectoryCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_CreateDirectoryCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_CreateDirectoryCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_CreateDirectoryCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_CreateDirectoryCmd, const FM_CreateDirectoryCmd_t *, BufPtr); UT_GenStub_Execute(FM_CreateDirectoryCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_CreateDirectoryCmd, bool); + return UT_GenStub_GetReturnValue(FM_CreateDirectoryCmd, CFE_Status_t); } /* @@ -79,15 +79,15 @@ bool FM_CreateDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_DecompressFileCmd() * ---------------------------------------------------- */ -bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DecompressFileCmd(const FM_DecompressFileCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_DecompressFileCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_DecompressFileCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_DecompressFileCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_DecompressFileCmd, const FM_DecompressFileCmd_t *, BufPtr); UT_GenStub_Execute(FM_DecompressFileCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_DecompressFileCmd, bool); + return UT_GenStub_GetReturnValue(FM_DecompressFileCmd, CFE_Status_t); } /* @@ -95,15 +95,15 @@ bool FM_DecompressFileCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_DeleteAllFilesCmd() * ---------------------------------------------------- */ -bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteAllFilesCmd(const FM_DeleteAllFilesCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_DeleteAllFilesCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_DeleteAllFilesCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_DeleteAllFilesCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_DeleteAllFilesCmd, const FM_DeleteAllFilesCmd_t *, BufPtr); UT_GenStub_Execute(FM_DeleteAllFilesCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_DeleteAllFilesCmd, bool); + return UT_GenStub_GetReturnValue(FM_DeleteAllFilesCmd, CFE_Status_t); } /* @@ -111,15 +111,15 @@ bool FM_DeleteAllFilesCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_DeleteDirectoryCmd() * ---------------------------------------------------- */ -bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteDirectoryCmd(const FM_DeleteDirectoryCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_DeleteDirectoryCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_DeleteDirectoryCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_DeleteDirectoryCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_DeleteDirectoryCmd, const FM_DeleteDirectoryCmd_t *, BufPtr); UT_GenStub_Execute(FM_DeleteDirectoryCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_DeleteDirectoryCmd, bool); + return UT_GenStub_GetReturnValue(FM_DeleteDirectoryCmd, CFE_Status_t); } /* @@ -127,15 +127,15 @@ bool FM_DeleteDirectoryCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_DeleteFileCmd() * ---------------------------------------------------- */ -bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_DeleteFileCmd(const FM_DeleteFileCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_DeleteFileCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_DeleteFileCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_DeleteFileCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_DeleteFileCmd, const FM_DeleteFileCmd_t *, BufPtr); UT_GenStub_Execute(FM_DeleteFileCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_DeleteFileCmd, bool); + return UT_GenStub_GetReturnValue(FM_DeleteFileCmd, CFE_Status_t); } /* @@ -143,15 +143,15 @@ bool FM_DeleteFileCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_GetDirListFileCmd() * ---------------------------------------------------- */ -bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetDirListFileCmd(const FM_GetDirListFileCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_GetDirListFileCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_GetDirListFileCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_GetDirListFileCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_GetDirListFileCmd, const FM_GetDirListFileCmd_t *, BufPtr); UT_GenStub_Execute(FM_GetDirListFileCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_GetDirListFileCmd, bool); + return UT_GenStub_GetReturnValue(FM_GetDirListFileCmd, CFE_Status_t); } /* @@ -159,15 +159,15 @@ bool FM_GetDirListFileCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_GetDirListPktCmd() * ---------------------------------------------------- */ -bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetDirListPktCmd(const FM_GetDirListPktCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_GetDirListPktCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_GetDirListPktCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_GetDirListPktCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_GetDirListPktCmd, const FM_GetDirListPktCmd_t *, BufPtr); UT_GenStub_Execute(FM_GetDirListPktCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_GetDirListPktCmd, bool); + return UT_GenStub_GetReturnValue(FM_GetDirListPktCmd, CFE_Status_t); } /* @@ -175,15 +175,15 @@ bool FM_GetDirListPktCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_GetFileInfoCmd() * ---------------------------------------------------- */ -bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetFileInfoCmd(const FM_GetFileInfoCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_GetFileInfoCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_GetFileInfoCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_GetFileInfoCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_GetFileInfoCmd, const FM_GetFileInfoCmd_t *, BufPtr); UT_GenStub_Execute(FM_GetFileInfoCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_GetFileInfoCmd, bool); + return UT_GenStub_GetReturnValue(FM_GetFileInfoCmd, CFE_Status_t); } /* @@ -191,15 +191,15 @@ bool FM_GetFileInfoCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_GetOpenFilesCmd() * ---------------------------------------------------- */ -bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_GetOpenFilesCmd(const FM_GetOpenFilesCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_GetOpenFilesCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_GetOpenFilesCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_GetOpenFilesCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_GetOpenFilesCmd, const FM_GetOpenFilesCmd_t *, BufPtr); UT_GenStub_Execute(FM_GetOpenFilesCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_GetOpenFilesCmd, bool); + return UT_GenStub_GetReturnValue(FM_GetOpenFilesCmd, CFE_Status_t); } /* @@ -207,15 +207,15 @@ bool FM_GetOpenFilesCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_MonitorFilesystemSpaceCmd() * ---------------------------------------------------- */ -bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_MonitorFilesystemSpaceCmd(const FM_MonitorFilesystemSpaceCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_MonitorFilesystemSpaceCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_MonitorFilesystemSpaceCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_MonitorFilesystemSpaceCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_MonitorFilesystemSpaceCmd, const FM_MonitorFilesystemSpaceCmd_t *, BufPtr); UT_GenStub_Execute(FM_MonitorFilesystemSpaceCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_MonitorFilesystemSpaceCmd, bool); + return UT_GenStub_GetReturnValue(FM_MonitorFilesystemSpaceCmd, CFE_Status_t); } /* @@ -223,15 +223,15 @@ bool FM_MonitorFilesystemSpaceCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_MoveFileCmd() * ---------------------------------------------------- */ -bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_MoveFileCmd(const FM_MoveFileCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_MoveFileCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_MoveFileCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_MoveFileCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_MoveFileCmd, const FM_MoveFileCmd_t *, BufPtr); UT_GenStub_Execute(FM_MoveFileCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_MoveFileCmd, bool); + return UT_GenStub_GetReturnValue(FM_MoveFileCmd, CFE_Status_t); } /* @@ -239,15 +239,15 @@ bool FM_MoveFileCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_NoopCmd() * ---------------------------------------------------- */ -bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_NoopCmd(const FM_NoopCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_NoopCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_NoopCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_NoopCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_NoopCmd, const FM_NoopCmd_t *, BufPtr); UT_GenStub_Execute(FM_NoopCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_NoopCmd, bool); + return UT_GenStub_GetReturnValue(FM_NoopCmd, CFE_Status_t); } /* @@ -255,15 +255,15 @@ bool FM_NoopCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_RenameFileCmd() * ---------------------------------------------------- */ -bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_RenameFileCmd(const FM_RenameFileCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_RenameFileCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_RenameFileCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_RenameFileCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_RenameFileCmd, const FM_RenameFileCmd_t *, BufPtr); UT_GenStub_Execute(FM_RenameFileCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_RenameFileCmd, bool); + return UT_GenStub_GetReturnValue(FM_RenameFileCmd, CFE_Status_t); } /* @@ -271,15 +271,15 @@ bool FM_RenameFileCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_ResetCountersCmd() * ---------------------------------------------------- */ -bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_ResetCountersCmd(const FM_ResetCountersCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_ResetCountersCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_ResetCountersCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_ResetCountersCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_ResetCountersCmd, const FM_ResetCountersCmd_t *, BufPtr); UT_GenStub_Execute(FM_ResetCountersCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_ResetCountersCmd, bool); + return UT_GenStub_GetReturnValue(FM_ResetCountersCmd, CFE_Status_t); } /* @@ -287,15 +287,15 @@ bool FM_ResetCountersCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_SetPermissionsCmd() * ---------------------------------------------------- */ -bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_SetPermissionsCmd(const FM_SetPermissionsCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_SetPermissionsCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_SetPermissionsCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_SetPermissionsCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_SetPermissionsCmd, const FM_SetPermissionsCmd_t *, BufPtr); UT_GenStub_Execute(FM_SetPermissionsCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_SetPermissionsCmd, bool); + return UT_GenStub_GetReturnValue(FM_SetPermissionsCmd, CFE_Status_t); } /* @@ -303,13 +303,13 @@ bool FM_SetPermissionsCmd(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for FM_SetTableStateCmd() * ---------------------------------------------------- */ -bool FM_SetTableStateCmd(const CFE_SB_Buffer_t *BufPtr) +CFE_Status_t FM_SetTableStateCmd(const FM_SetTableStateCmd_t *BufPtr) { - UT_GenStub_SetupReturnBuffer(FM_SetTableStateCmd, bool); + UT_GenStub_SetupReturnBuffer(FM_SetTableStateCmd, CFE_Status_t); - UT_GenStub_AddParam(FM_SetTableStateCmd, const CFE_SB_Buffer_t *, BufPtr); + UT_GenStub_AddParam(FM_SetTableStateCmd, const FM_SetTableStateCmd_t *, BufPtr); UT_GenStub_Execute(FM_SetTableStateCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_SetTableStateCmd, bool); + return UT_GenStub_GetReturnValue(FM_SetTableStateCmd, CFE_Status_t); } diff --git a/unit-test/stubs/fm_compression_stubs.c b/unit-test/stubs/fm_compression_stubs.c index 39e6bbd..e6ce024 100644 --- a/unit-test/stubs/fm_compression_stubs.c +++ b/unit-test/stubs/fm_compression_stubs.c @@ -31,9 +31,9 @@ * Generated stub function for FM_Compress_Impl() * ---------------------------------------------------- */ -int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, const char *DstFileName) { - UT_GenStub_SetupReturnBuffer(FM_Compress_Impl, int32); + UT_GenStub_SetupReturnBuffer(FM_Compress_Impl, CFE_Status_t); UT_GenStub_AddParam(FM_Compress_Impl, FM_Compressor_State_t *, State); UT_GenStub_AddParam(FM_Compress_Impl, const char *, SrcFileName); @@ -41,7 +41,7 @@ int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, co UT_GenStub_Execute(FM_Compress_Impl, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_Compress_Impl, int32); + return UT_GenStub_GetReturnValue(FM_Compress_Impl, CFE_Status_t); } /* @@ -49,13 +49,13 @@ int32 FM_Compress_Impl(FM_Compressor_State_t *State, const char *SrcFileName, co * Generated stub function for FM_CompressionService_Init() * ---------------------------------------------------- */ -int32 FM_CompressionService_Init(void) +CFE_Status_t FM_CompressionService_Init(void) { - UT_GenStub_SetupReturnBuffer(FM_CompressionService_Init, int32); + UT_GenStub_SetupReturnBuffer(FM_CompressionService_Init, CFE_Status_t); UT_GenStub_Execute(FM_CompressionService_Init, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_CompressionService_Init, int32); + return UT_GenStub_GetReturnValue(FM_CompressionService_Init, CFE_Status_t); } /* @@ -63,9 +63,9 @@ int32 FM_CompressionService_Init(void) * Generated stub function for FM_Decompress_Impl() * ---------------------------------------------------- */ -int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) +CFE_Status_t FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName, const char *DstFileName) { - UT_GenStub_SetupReturnBuffer(FM_Decompress_Impl, int32); + UT_GenStub_SetupReturnBuffer(FM_Decompress_Impl, CFE_Status_t); UT_GenStub_AddParam(FM_Decompress_Impl, FM_Decompressor_State_t *, State); UT_GenStub_AddParam(FM_Decompress_Impl, const char *, SrcFileName); @@ -73,5 +73,5 @@ int32 FM_Decompress_Impl(FM_Decompressor_State_t *State, const char *SrcFileName UT_GenStub_Execute(FM_Decompress_Impl, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_Decompress_Impl, int32); + return UT_GenStub_GetReturnValue(FM_Decompress_Impl, CFE_Status_t); } diff --git a/unit-test/stubs/fm_tbl_stubs.c b/unit-test/stubs/fm_tbl_stubs.c index 238448e..b2cdb76 100644 --- a/unit-test/stubs/fm_tbl_stubs.c +++ b/unit-test/stubs/fm_tbl_stubs.c @@ -53,13 +53,13 @@ void FM_ReleaseTablePointers(void) * Generated stub function for FM_TableInit() * ---------------------------------------------------- */ -int32 FM_TableInit(void) +CFE_Status_t FM_TableInit(void) { - UT_GenStub_SetupReturnBuffer(FM_TableInit, int32); + UT_GenStub_SetupReturnBuffer(FM_TableInit, CFE_Status_t); UT_GenStub_Execute(FM_TableInit, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_TableInit, int32); + return UT_GenStub_GetReturnValue(FM_TableInit, CFE_Status_t); } /* @@ -67,13 +67,13 @@ int32 FM_TableInit(void) * Generated stub function for FM_ValidateTable() * ---------------------------------------------------- */ -int32 FM_ValidateTable(FM_MonitorTable_t *TablePtr) +CFE_Status_t FM_ValidateTable(FM_MonitorTable_t *TablePtr) { - UT_GenStub_SetupReturnBuffer(FM_ValidateTable, int32); + UT_GenStub_SetupReturnBuffer(FM_ValidateTable, CFE_Status_t); UT_GenStub_AddParam(FM_ValidateTable, FM_MonitorTable_t *, TablePtr); UT_GenStub_Execute(FM_ValidateTable, Basic, NULL); - return UT_GenStub_GetReturnValue(FM_ValidateTable, int32); + return UT_GenStub_GetReturnValue(FM_ValidateTable, CFE_Status_t); }