From bdabfd7a311783f9d482b072c8babeb0cc38e901 Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Mon, 5 Jun 2023 16:07:46 +1000 Subject: [PATCH] Fix #387, Update minor out-of-family naming/consistency issues in CF --- .github/pull_request_template.md | 2 +- config/default_cf_msgstruct.h | 4 +- fsw/inc/cf_events.h | 13 +- fsw/src/cf_app.c | 68 +-- fsw/src/cf_app.h | 12 +- fsw/src/cf_cfdp.c | 2 +- fsw/src/cf_clist.c | 1 - fsw/src/cf_cmd.c | 74 +-- fsw/src/cf_cmd.h | 18 +- fsw/src/cf_codec.c | 2 +- fsw/src/cf_utils.c | 4 +- unit-test/cf_app_tests.c | 119 ++-- unit-test/cf_cfdp_sbintf_tests.c | 2 +- unit-test/cf_cmd_tests.c | 646 +++++++++++----------- unit-test/cf_utils_tests.c | 2 +- unit-test/stubs/cf_app_stubs.c | 14 +- unit-test/stubs/cf_cmd_handlers.c | 2 +- unit-test/stubs/cf_cmd_stubs.c | 56 +- unit-test/utilities/cf_test_alt_handler.c | 1 - 19 files changed, 505 insertions(+), 537 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ffa6910f..0789aebb 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,7 +10,7 @@ A clear and concise description of what the contribution is. **Testing performed** Steps taken to test the contribution: 1. Build steps '...' -1. Execution steps '...' +2. Execution steps '...' **Expected behavior changes** A clear and concise description of how this contribution will change behavior and level of impact. diff --git a/config/default_cf_msgstruct.h b/config/default_cf_msgstruct.h index b789d9f6..f9f62588 100644 --- a/config/default_cf_msgstruct.h +++ b/config/default_cf_msgstruct.h @@ -101,11 +101,11 @@ typedef struct CF_DisableEngineCmd * * For command details see #CF_RESET_CC */ -typedef struct CF_ResetCmd +typedef struct CF_ResetCountersCmd { CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */ CF_UnionArgs_Payload_t Payload; /**< \brief Generic command arguments */ -} CF_ResetCmd_t; +} CF_ResetCountersCmd_t; /** * \brief Freeze command structure diff --git a/fsw/inc/cf_events.h b/fsw/inc/cf_events.h index 8d0d51d0..64120bb5 100644 --- a/fsw/inc/cf_events.h +++ b/fsw/inc/cf_events.h @@ -166,7 +166,7 @@ * * Failure from create pipe call during engine channel initialization */ -#define CF_CR_PIPE_ERR_EID (31) +#define CF_CR_CHANNEL_PIPE_ERR_EID (31) /** * \brief CF Channel Message Subscription Failed Event ID @@ -212,6 +212,17 @@ */ #define CF_EID_ERR_INIT_OUTGOING_SIZE (35) +/** + * \brief CF Create SB Command Pipe at Initialization Failed Event ID + * + * \par Type: ERROR + * + * \par Cause: + * + * Failure from create command pipe call during application initialization + */ +#define CF_CR_PIPE_ERR_EID (36) + /************************************************************************** * CF_PDU event IDs - Protocol data unit */ diff --git a/fsw/src/cf_app.c b/fsw/src/cf_app.c index dc1bf5d0..624542f0 100644 --- a/fsw/src/cf_app.c +++ b/fsw/src/cf_app.c @@ -46,7 +46,7 @@ CF_AppData_t CF_AppData; *-----------------------------------------------------------------*/ void CF_HkCmd(void) { - CFE_MSG_SetMsgTime(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader), CFE_TIME_GetTime()); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader)); /* return value ignored */ CFE_SB_TransmitMsg(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader), true); } @@ -82,7 +82,7 @@ void CF_CheckTables(void) { CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_CHECK_REL, CFE_EVS_EventType_ERROR, "CF: error in CFE_TBL_ReleaseAddress (check), returned 0x%08lx", (unsigned long)status); - CF_AppData.run_status = CFE_ES_RunStatus_APP_ERROR; + CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR; } status = CFE_TBL_Manage(CF_AppData.config_handle); @@ -90,7 +90,7 @@ void CF_CheckTables(void) { CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_CHECK_MAN, CFE_EVS_EventType_ERROR, "CF: error in CFE_TBL_Manage (check), returned 0x%08lx", (unsigned long)status); - CF_AppData.run_status = CFE_ES_RunStatus_APP_ERROR; + CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR; } status = CFE_TBL_GetAddress((void *)&CF_AppData.config_table, CF_AppData.config_handle); @@ -98,7 +98,7 @@ void CF_CheckTables(void) { CFE_EVS_SendEvent(CF_EID_ERR_INIT_TBL_CHECK_GA, CFE_EVS_EventType_ERROR, "CF: failed to get table address (check), returned 0x%08lx", (unsigned long)status); - CF_AppData.run_status = CFE_ES_RunStatus_APP_ERROR; + CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR; } } } @@ -197,13 +197,16 @@ CFE_Status_t CF_TableInit(void) * See description in cf_app.h for argument/return detail * *-----------------------------------------------------------------*/ -CFE_Status_t CF_Init(void) +CFE_Status_t CF_AppInit(void) { CFE_Status_t status; static const CFE_SB_MsgId_Atom_t MID_VALUES[] = {CF_CMD_MID, CF_SEND_HK_MID, CF_WAKE_UP_MID}; uint32 i; - CF_AppData.run_status = CFE_ES_RunStatus_APP_RUN; + CF_AppData.RunStatus = CFE_ES_RunStatus_APP_RUN; + + /* Zero-out global data structure */ + memset(&CF_AppData, 0, sizeof(CF_AppData)); CFE_MSG_Init(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader), CFE_SB_ValueToMsgId(CF_HK_TLM_MID), sizeof(CF_AppData.hk)); @@ -214,11 +217,11 @@ CFE_Status_t CF_Init(void) } else { - status = CFE_SB_CreatePipe(&CF_AppData.cmd_pipe, CF_PIPE_DEPTH, CF_PIPE_NAME); + status = CFE_SB_CreatePipe(&CF_AppData.CmdPipe, CF_PIPE_DEPTH, CF_PIPE_NAME); if (status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("CF app: error creating pipe %s, returned 0x%08lx", CF_PIPE_NAME, - (unsigned long)status); + CFE_EVS_SendEvent(CF_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, + "CF app: error creating pipe %s, returned 0x%08lx", CF_PIPE_NAME, (unsigned long)status); } } @@ -226,7 +229,7 @@ CFE_Status_t CF_Init(void) { for (i = 0; i < (sizeof(MID_VALUES) / sizeof(MID_VALUES[0])); ++i) { - status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MID_VALUES[i]), CF_AppData.cmd_pipe); + status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MID_VALUES[i]), CF_AppData.CmdPipe); if (status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("CF app: failed to subscribe to MID 0x%04lx, returned 0x%08lx", @@ -248,13 +251,8 @@ CFE_Status_t CF_Init(void) if (status == CFE_SUCCESS) { - status = - CFE_EVS_SendEvent(CF_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d.%d", - CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV); - if (status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("CF: error sending init event, returned 0x%08lx", (unsigned long)status); - } + CFE_EVS_SendEvent(CF_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "CF Initialized. Version %d.%d.%d.%d", + CF_MAJOR_VERSION, CF_MINOR_VERSION, CF_REVISION, CF_MISSION_REV); } return status; @@ -279,16 +277,16 @@ void CF_WakeUp(void) * See description in cf_app.h for argument/return detail * *-----------------------------------------------------------------*/ -void CF_ProcessMsg(CFE_SB_Buffer_t *msg) +void CF_ProcessMsg(CFE_SB_Buffer_t *BufPtr) { - CFE_SB_MsgId_t msg_id = CFE_SB_INVALID_MSG_ID; + CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID; - CFE_MSG_GetMsgId(&msg->Msg, &msg_id); + CFE_MSG_GetMsgId(&BufPtr->Msg, &MessageID); - switch (CFE_SB_MsgIdToValue(msg_id)) + switch (CFE_SB_MsgIdToValue(MessageID)) { case CF_CMD_MID: - CF_ProcessGroundCommand(msg); + CF_ProcessGroundCommand(BufPtr); break; case CF_WAKE_UP_MID: @@ -303,7 +301,7 @@ void CF_ProcessMsg(CFE_SB_Buffer_t *msg) default: ++CF_AppData.hk.Payload.counters.err; CFE_EVS_SendEvent(CF_EID_ERR_INIT_CMD_LENGTH, CFE_EVS_EventType_ERROR, - "CF: invalid command packet id=0x%lx", (unsigned long)CFE_SB_MsgIdToValue(msg_id)); + "CF: invalid command packet id=0x%lx", (unsigned long)CFE_SB_MsgIdToValue(MessageID)); break; } } @@ -317,38 +315,32 @@ void CF_ProcessMsg(CFE_SB_Buffer_t *msg) void CF_AppMain(void) { int32 status; - CFE_SB_Buffer_t *msg; + CFE_SB_Buffer_t *BufPtr = NULL; CFE_ES_PerfLogEntry(CF_PERF_ID_APPMAIN); - status = CF_Init(); + status = CF_AppInit(); if (status != CFE_SUCCESS) { - CF_AppData.run_status = CFE_ES_RunStatus_APP_ERROR; + CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR; } - msg = NULL; - - while (CFE_ES_RunLoop(&CF_AppData.run_status)) + while (CFE_ES_RunLoop(&CF_AppData.RunStatus)) { CFE_ES_PerfLogExit(CF_PERF_ID_APPMAIN); - status = CFE_SB_ReceiveBuffer(&msg, CF_AppData.cmd_pipe, CF_RCVMSG_TIMEOUT); + status = CFE_SB_ReceiveBuffer(&BufPtr, CF_AppData.CmdPipe, CF_RCVMSG_TIMEOUT); CFE_ES_PerfLogEntry(CF_PERF_ID_APPMAIN); - /* - * note that CFE_SB_ReceiveBuffer() guarantees that a CFE_SUCCESS status is accompanied by - * a valid (non-NULL) output message pointer. However the unit test can force this condition. - */ - if (status == CFE_SUCCESS && msg != NULL) + if (status == CFE_SUCCESS) { - CF_ProcessMsg(msg); + CF_ProcessMsg(BufPtr); } else if (status != CFE_SB_TIME_OUT && status != CFE_SB_NO_MESSAGE) { CFE_EVS_SendEvent(CF_EID_ERR_INIT_MSG_RECV, CFE_EVS_EventType_ERROR, "CF: exiting due to CFE_SB_ReceiveBuffer error 0x%08lx", (unsigned long)status); - CF_AppData.run_status = CFE_ES_RunStatus_APP_ERROR; + CF_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR; } else { @@ -357,5 +349,5 @@ void CF_AppMain(void) } CFE_ES_PerfLogExit(CF_PERF_ID_APPMAIN); - CFE_ES_ExitApp(CF_AppData.run_status); + CFE_ES_ExitApp(CF_AppData.RunStatus); } diff --git a/fsw/src/cf_app.h b/fsw/src/cf_app.h index c79170d7..c231f862 100644 --- a/fsw/src/cf_app.h +++ b/fsw/src/cf_app.h @@ -80,9 +80,9 @@ typedef struct { CF_HkPacket_t hk; - uint32 run_status; + uint32 RunStatus; - CFE_SB_PipeId_t cmd_pipe; + CFE_SB_PipeId_t CmdPipe; CFE_TBL_Handle_t config_handle; CF_ConfigTable_t *config_table; @@ -173,7 +173,7 @@ CFE_Status_t CF_TableInit(void); * @retval Returns anything else on error. * */ -CFE_Status_t CF_Init(void); +CFE_Status_t CF_AppInit(void); /************************************************************************/ /** @brief CF wakeup function @@ -194,12 +194,12 @@ void CF_WakeUp(void); * Process message packets received via the Software Bus command pipe * * @par Assumptions, External Events, and Notes: - * msg must not be NULL. + * BufPtr must not be NULL. * - * @param[in] msg Software Bus message pointer + * @param[in] BufPtr Software Bus message pointer * */ -void CF_ProcessMsg(CFE_SB_Buffer_t *msg); +void CF_ProcessMsg(CFE_SB_Buffer_t *BufPtr); /************************************************************************/ /** @brief CF app entry point diff --git a/fsw/src/cf_cfdp.c b/fsw/src/cf_cfdp.c index 83a1078d..ff5d1a47 100644 --- a/fsw/src/cf_cfdp.c +++ b/fsw/src/cf_cfdp.c @@ -969,7 +969,7 @@ CFE_Status_t CF_CFDP_InitEngine(void) nbuf); if (ret != CFE_SUCCESS) { - CFE_EVS_SendEvent(CF_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, + CFE_EVS_SendEvent(CF_CR_CHANNEL_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "CF: failed to create pipe %s, returned 0x%08lx", nbuf, (unsigned long)ret); break; } diff --git a/fsw/src/cf_clist.c b/fsw/src/cf_clist.c index b7c99007..64162f10 100644 --- a/fsw/src/cf_clist.c +++ b/fsw/src/cf_clist.c @@ -28,7 +28,6 @@ * This file is intended to be a generic class that can be used in other apps. */ -#include "cf_verify.h" #include "cf_clist.h" #include "cf_assert.h" diff --git a/fsw/src/cf_cmd.c b/fsw/src/cf_cmd.c index d44f23e9..52d82e3f 100644 --- a/fsw/src/cf_cmd.c +++ b/fsw/src/cf_cmd.c @@ -57,7 +57,7 @@ void CF_NoopCmd(const CF_NoopCmd_t *msg) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -void CF_ResetCmd(const CF_ResetCmd_t *msg) +void CF_ResetCountersCmd(const CF_ResetCountersCmd_t *msg) { const CF_UnionArgs_Payload_t *data = &msg->Payload; static const char * names[5] = {"all", "cmd", "fault", "up", "down"}; @@ -467,7 +467,7 @@ void CF_ResumeCmd(const CF_ResumeCmd_t *msg) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -void CF_CmdCancel_Txn(CF_Transaction_t *txn, void *ignored) +void CF_Cancel_TxnCmd(CF_Transaction_t *txn, void *ignored) { CF_CFDP_CancelTransaction(txn); } @@ -480,7 +480,7 @@ void CF_CmdCancel_Txn(CF_Transaction_t *txn, void *ignored) *-----------------------------------------------------------------*/ void CF_CancelCmd(const CF_CancelCmd_t *msg) { - if (CF_TsnChanAction(&msg->Payload, "cancel", CF_CmdCancel_Txn, NULL) > 0) + if (CF_TsnChanAction(&msg->Payload, "cancel", CF_Cancel_TxnCmd, NULL) > 0) { CFE_EVS_SendEvent(CF_EID_INF_CMD_CANCEL, CFE_EVS_EventType_INFORMATION, "CF: cancel transaction successfully initiated"); @@ -500,7 +500,7 @@ void CF_CancelCmd(const CF_CancelCmd_t *msg) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -void CF_CmdAbandon_Txn(CF_Transaction_t *txn, void *ignored) +void CF_Abandon_TxnCmd(CF_Transaction_t *txn, void *ignored) { CF_CFDP_ResetTransaction(txn, 0); } @@ -513,7 +513,7 @@ void CF_CmdAbandon_Txn(CF_Transaction_t *txn, void *ignored) *-----------------------------------------------------------------*/ void CF_AbandonCmd(const CF_AbandonCmd_t *msg) { - if (CF_TsnChanAction(&msg->Payload, "abandon", CF_CmdAbandon_Txn, NULL) > 0) + if (CF_TsnChanAction(&msg->Payload, "abandon", CF_Abandon_TxnCmd, NULL) > 0) { CFE_EVS_SendEvent(CF_EID_INF_CMD_ABANDON, CFE_EVS_EventType_INFORMATION, "CF: abandon successful"); ++CF_AppData.hk.Payload.counters.cmd; @@ -906,7 +906,7 @@ void CF_WriteQueueCmd(const CF_WriteQueueCmd_t *msg) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num /* ignored */) +CFE_Status_t CF_ValidateChunkSizeCmd(uint32 val, uint8 chan_num /* ignored */) { CFE_Status_t ret = CFE_SUCCESS; if (val > sizeof(CF_CFDP_PduFileDataContent_t)) @@ -922,7 +922,7 @@ CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num /* ignored */) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -CFE_Status_t CF_CmdValidateMaxOutgoing(uint32 val, uint8 chan_num) +CFE_Status_t CF_ValidateMaxOutgoingCmd(uint32 val, uint8 chan_num) { CFE_Status_t ret = CFE_SUCCESS; @@ -982,7 +982,7 @@ void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, case CF_GetSet_ValueID_outgoing_file_chunk_size: item.ptr = &config->outgoing_file_chunk_size; item.size = sizeof(config->outgoing_file_chunk_size); - item.fn = CF_CmdValidateChunkSize; + item.fn = CF_ValidateChunkSizeCmd; break; case CF_GetSet_ValueID_ack_limit: item.ptr = &config->chan[chan_num].ack_limit; @@ -999,7 +999,7 @@ void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, case CF_GetSet_ValueID_chan_max_outgoing_messages_per_wakeup: item.ptr = &config->chan[chan_num].max_outgoing_messages_per_wakeup; item.size = sizeof(config->chan[chan_num].max_outgoing_messages_per_wakeup); - item.fn = CF_CmdValidateMaxOutgoing; + item.fn = CF_ValidateMaxOutgoingCmd; break; default: break; @@ -1174,23 +1174,23 @@ void CF_DisableEngineCmd(const CF_DisableEngineCmd_t *msg) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -void CF_ProcessGroundCommand(CFE_SB_Buffer_t *msg) +void CF_ProcessGroundCommand(CFE_SB_Buffer_t *BufPtr) { typedef void (*const handler_fn_t)(const void *); static handler_fn_t fns[CF_NUM_COMMANDS] = { - (handler_fn_t)CF_NoopCmd, /* CF_NOOP_CC */ - (handler_fn_t)CF_ResetCmd, /* CF_RESET_CC */ - (handler_fn_t)CF_TxFileCmd, /* CF_TX_FILE_CC */ - (handler_fn_t)CF_PlaybackDirCmd, /* CF_PLAYBACK_DIR_CC */ - (handler_fn_t)CF_FreezeCmd, /* CF_FREEZE_CC */ - (handler_fn_t)CF_ThawCmd, /* CF_THAW_CC */ - (handler_fn_t)CF_SuspendCmd, /* CF_SUSPEND_CC */ - (handler_fn_t)CF_ResumeCmd, /* CF_RESUME_CC */ - (handler_fn_t)CF_CancelCmd, /* CF_CANCEL_CC */ - (handler_fn_t)CF_AbandonCmd, /* CF_ABANDON_CC */ - (handler_fn_t)CF_SetParamCmd, /* CF_SET_MIB_PARAM_CC */ - (handler_fn_t)CF_GetParamCmd, /* CF_GET_MIB_PARAM_CC */ + (handler_fn_t)CF_NoopCmd, /* CF_NOOP_CC */ + (handler_fn_t)CF_ResetCountersCmd, /* CF_RESET_CC */ + (handler_fn_t)CF_TxFileCmd, /* CF_TX_FILE_CC */ + (handler_fn_t)CF_PlaybackDirCmd, /* CF_PLAYBACK_DIR_CC */ + (handler_fn_t)CF_FreezeCmd, /* CF_FREEZE_CC */ + (handler_fn_t)CF_ThawCmd, /* CF_THAW_CC */ + (handler_fn_t)CF_SuspendCmd, /* CF_SUSPEND_CC */ + (handler_fn_t)CF_ResumeCmd, /* CF_RESUME_CC */ + (handler_fn_t)CF_CancelCmd, /* CF_CANCEL_CC */ + (handler_fn_t)CF_AbandonCmd, /* CF_ABANDON_CC */ + (handler_fn_t)CF_SetParamCmd, /* CF_SET_MIB_PARAM_CC */ + (handler_fn_t)CF_GetParamCmd, /* CF_GET_MIB_PARAM_CC */ NULL, NULL, NULL, @@ -1206,18 +1206,18 @@ void CF_ProcessGroundCommand(CFE_SB_Buffer_t *msg) }; static const uint16 expected_lengths[CF_NUM_COMMANDS] = { - sizeof(CF_NoopCmd_t), /* CF_NOOP_CC */ - sizeof(CF_ResetCmd_t), /* CF_RESET_CC */ - sizeof(CF_TxFileCmd_t), /* CF_TX_FILE_CC */ - sizeof(CF_PlaybackDirCmd_t), /* CF_PLAYBACK_DIR_CC */ - sizeof(CF_FreezeCmd_t), /* CF_FREEZE_CC */ - sizeof(CF_ThawCmd_t), /* CF_THAW_CC */ - sizeof(CF_SuspendCmd_t), /* CF_SUSPEND_CC */ - sizeof(CF_ResumeCmd_t), /* CF_RESUME_CC */ - sizeof(CF_CancelCmd_t), /* CF_CANCEL_CC */ - sizeof(CF_AbandonCmd_t), /* CF_ABANDON_CC */ - sizeof(CF_SetParamCmd_t), /* CF_SET_MIB_PARAM_CC */ - sizeof(CF_GetParamCmd_t), /* CF_GET_MIB_PARAM_CC */ + sizeof(CF_NoopCmd_t), /* CF_NOOP_CC */ + sizeof(CF_ResetCountersCmd_t), /* CF_RESET_CC */ + sizeof(CF_TxFileCmd_t), /* CF_TX_FILE_CC */ + sizeof(CF_PlaybackDirCmd_t), /* CF_PLAYBACK_DIR_CC */ + sizeof(CF_FreezeCmd_t), /* CF_FREEZE_CC */ + sizeof(CF_ThawCmd_t), /* CF_THAW_CC */ + sizeof(CF_SuspendCmd_t), /* CF_SUSPEND_CC */ + sizeof(CF_ResumeCmd_t), /* CF_RESUME_CC */ + sizeof(CF_CancelCmd_t), /* CF_CANCEL_CC */ + sizeof(CF_AbandonCmd_t), /* CF_ABANDON_CC */ + sizeof(CF_SetParamCmd_t), /* CF_SET_MIB_PARAM_CC */ + sizeof(CF_GetParamCmd_t), /* CF_GET_MIB_PARAM_CC */ 0, 0, 0, @@ -1235,11 +1235,11 @@ void CF_ProcessGroundCommand(CFE_SB_Buffer_t *msg) CFE_MSG_FcnCode_t cmd = 0; size_t len = 0; - CFE_MSG_GetFcnCode(&msg->Msg, &cmd); + CFE_MSG_GetFcnCode(&BufPtr->Msg, &cmd); if (cmd < CF_NUM_COMMANDS) { - CFE_MSG_GetSize(&msg->Msg, &len); + CFE_MSG_GetSize(&BufPtr->Msg, &len); /* first, verify command length */ if (len == expected_lengths[cmd]) @@ -1247,7 +1247,7 @@ void CF_ProcessGroundCommand(CFE_SB_Buffer_t *msg) /* if valid, process command */ if (fns[cmd]) { - fns[cmd](msg); + fns[cmd](BufPtr); } } else diff --git a/fsw/src/cf_cmd.h b/fsw/src/cf_cmd.h index b1aad7ab..f3e000bd 100644 --- a/fsw/src/cf_cmd.h +++ b/fsw/src/cf_cmd.h @@ -116,7 +116,7 @@ void CF_NoopCmd(const CF_NoopCmd_t *msg); * * @param msg Pointer to command message */ -void CF_ResetCmd(const CF_ResetCmd_t *msg); +void CF_ResetCountersCmd(const CF_ResetCountersCmd_t *msg); /************************************************************************/ /** @brief Ground command to start a file transfer. @@ -297,7 +297,7 @@ void CF_ResumeCmd(const CF_ResumeCmd_t *msg); * @param txn Pointer to transaction object * @param ignored Not used by this function */ -void CF_CmdCancel_Txn(CF_Transaction_t *txn, void *ignored); +void CF_Cancel_TxnCmd(CF_Transaction_t *txn, void *ignored); /************************************************************************/ /** @brief Handle a cancel ground command. @@ -315,12 +315,12 @@ void CF_CancelCmd(const CF_CancelCmd_t *msg); * This helper function is used with CF_TsnChanAction() to abandon matched transactions * * @par Assumptions, External Events, and Notes: - * msg must not be NULL. + * txn must not be NULL. * * @param txn Pointer to transaction object * @param ignored Not used by this function */ -void CF_CmdAbandon_Txn(CF_Transaction_t *txn, void *ignored); +void CF_Abandon_TxnCmd(CF_Transaction_t *txn, void *ignored); /************************************************************************/ /** @brief Handle an abandon ground command. @@ -484,7 +484,7 @@ void CF_WriteQueueCmd(const CF_WriteQueueCmd_t *msg); * @retval CF_ERROR if failed (val is greater than max PDU) * */ -CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num); +CFE_Status_t CF_ValidateChunkSizeCmd(uint32 val, uint8 chan_num); /************************************************************************/ /** @brief Checks if the value is within allowable range as outgoing packets per wakeup @@ -500,7 +500,7 @@ CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num); * @retval CF_ERROR if failed (val is not allowed) * */ -CFE_Status_t CF_CmdValidateMaxOutgoing(uint32 val, uint8 chan_num); +CFE_Status_t CF_ValidateMaxOutgoingCmd(uint32 val, uint8 chan_num); /************************************************************************/ /** @brief Perform a configuration get/set operation. @@ -566,10 +566,10 @@ void CF_DisableEngineCmd(const CF_DisableEngineCmd_t *msg); /** @brief Process any ground command contained in the given message. * * @par Assumptions, External Events, and Notes: - * msg must not be NULL. + * BufPtr must not be NULL. * - * @param msg Pointer to command message + * @param BufPtr Pointer to command message */ -void CF_ProcessGroundCommand(CFE_SB_Buffer_t *msg); +void CF_ProcessGroundCommand(CFE_SB_Buffer_t *BufPtr); #endif diff --git a/fsw/src/cf_codec.c b/fsw/src/cf_codec.c index 979e5d03..1e4b48a9 100644 --- a/fsw/src/cf_codec.c +++ b/fsw/src/cf_codec.c @@ -117,7 +117,7 @@ static const CF_Codec_BitField_t CF_CFDP_PduMd_CHECKSUM_TYPE = CF_INIT_FIELD static const CF_Codec_BitField_t CF_CFDP_PduFileData_RECORD_CONTINUATION_STATE = CF_INIT_FIELD(2, 6); static const CF_Codec_BitField_t CF_CFDP_PduFileData_SEGMENT_METADATA_LENGTH = CF_INIT_FIELD(6, 0); -/* NOTE: get/set will handle endianess */ +/* NOTE: get/set will handle endianness */ /* * ALSO NOTE: These store/set inline functions/macros are used with * literal integers as well as variables. So they operate on value, where diff --git a/fsw/src/cf_utils.c b/fsw/src/cf_utils.c index b2a91d01..e059134e 100644 --- a/fsw/src/cf_utils.c +++ b/fsw/src/cf_utils.c @@ -503,8 +503,8 @@ CFE_Status_t CF_WrappedLseek(osal_id_t fd, off_t offset, int mode) bool CF_TxnStatus_IsError(CF_TxnStatus_t txn_stat) { /* The value of CF_TxnStatus_UNDEFINED (-1) indicates a transaction is in progress and no error - * has occurred yet. This will be will be set to CF_TxnStatus_NO_ERROR (0) after successful - * completion of the transaction (FIN/EOF). Anything else indicates a problem has occurred. */ + * has occurred yet. This will be set to CF_TxnStatus_NO_ERROR (0) after successful completion + * of the transaction (FIN/EOF). Anything else indicates a problem has occurred. */ return (txn_stat > CF_TxnStatus_NO_ERROR); } diff --git a/unit-test/cf_app_tests.c b/unit-test/cf_app_tests.c index 712b23a7..4227be5c 100644 --- a/unit-test/cf_app_tests.c +++ b/unit-test/cf_app_tests.c @@ -71,9 +71,8 @@ void Test_CF_HkCmd(void) CF_HkCmd(); /* Assert */ - UtAssert_STUB_COUNT(CFE_MSG_SetMsgTime, 1); + UtAssert_STUB_COUNT(CFE_SB_TimeStampMsg, 1); UtAssert_STUB_COUNT(CFE_SB_TransmitMsg, 1); - UtAssert_STUB_COUNT(CFE_TIME_GetTime, 1); } /******************************************************************************* @@ -259,7 +258,7 @@ void Test_CF_ValidateConfigTable_FailBecauseOutgoingFileChunkSmallerThanDataArra void Test_CF_ValidateConfigTable_Success(void) { - /* Arange */ + /* Arrange */ CF_ConfigTable_t *arg_table = &table; int32 result; @@ -361,18 +360,18 @@ void Test_CF_TableInit_When_CFE_TBL_GetAddress_Returns_CFE_TBL_INFO_UPDATED_Succ /******************************************************************************* ** -** CF_Init tests - full coverage +** CF_AppInit tests - full coverage ** *******************************************************************************/ -void Test_CF_Init_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus(void) +void Test_CF_AppInit_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus(void) { int32 result = -1; UT_SetDefaultReturnValue(UT_KEY(CFE_EVS_Register), result); /* Act */ - UtAssert_INT32_EQ(CF_Init(), result); + UtAssert_INT32_EQ(CF_AppInit(), result); /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_Init, 1); @@ -380,7 +379,7 @@ void Test_CF_Init_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_Wri UtAssert_STUB_COUNT(CFE_ES_WriteToSysLog, 1); } -void Test_CF_Init_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus(void) +void Test_CF_AppInit_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Return_Pipe_Creation_Error_EID(void) { /* Arrange */ int32 result = -1; @@ -388,16 +387,17 @@ void Test_CF_Init_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_Wr UT_SetDefaultReturnValue(UT_KEY(CFE_SB_CreatePipe), result); /* Act */ - UtAssert_INT32_EQ(CF_Init(), result); + UtAssert_INT32_EQ(CF_AppInit(), result); /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_Init, 1); UtAssert_STUB_COUNT(CFE_EVS_Register, 1); UtAssert_STUB_COUNT(CFE_SB_CreatePipe, 1); - UtAssert_STUB_COUNT(CFE_ES_WriteToSysLog, 1); + UT_CF_AssertEventID(CF_CR_PIPE_ERR_EID); } -void Test_CF_Init_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus(void) +void Test_CF_AppInit_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus( + void) { /* Arrange */ int32 result = -1; @@ -405,7 +405,7 @@ void Test_CF_Init_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_E UT_SetDefaultReturnValue(UT_KEY(CFE_SB_Subscribe), result); /* Act */ - UtAssert_INT32_EQ(CF_Init(), result); + UtAssert_INT32_EQ(CF_AppInit(), result); /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_Init, 1); @@ -417,7 +417,7 @@ void Test_CF_Init_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_E /* NOTE: multi call test for CFE_SB_Subscribe would be helpful but not necessary for coverage */ -void Test_CF_Init_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus(void) +void Test_CF_AppInit_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus(void) { /* Arrange */ int32 result = -1; @@ -426,7 +426,7 @@ void Test_CF_Init_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus(v UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_Register), result); /* Act */ - UtAssert_INT32_EQ(CF_Init(), result); + UtAssert_INT32_EQ(CF_AppInit(), result); /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_Init, 1); @@ -436,7 +436,7 @@ void Test_CF_Init_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus(v UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); } -void Test_CF_Init_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus(void) +void Test_CF_AppInit_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus(void) { /* Arrange */ int32 result = -1; @@ -444,25 +444,7 @@ void Test_CF_Init_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorSt UT_SetDefaultReturnValue(UT_KEY(CF_CFDP_InitEngine), result); /* Act */ - UtAssert_INT32_EQ(CF_Init(), result); - - /* Assert */ - UtAssert_STUB_COUNT(CFE_MSG_Init, 1); - UtAssert_STUB_COUNT(CFE_EVS_Register, 1); - UtAssert_STUB_COUNT(CFE_SB_CreatePipe, 1); - UtAssert_STUB_COUNT(CFE_SB_Subscribe, 3); - UtAssert_STUB_COUNT(CF_CFDP_InitEngine, 1); -} - -void Test_CF_Init_CallTo_CFE_EVS_SendEvent_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus(void) -{ - /* Arrange */ - int32 result = -1; - - UT_SetDefaultReturnValue(UT_KEY(CFE_EVS_SendEvent), result); - - /* Act */ - UtAssert_INT32_EQ(CF_Init(), result); + UtAssert_INT32_EQ(CF_AppInit(), result); /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_Init, 1); @@ -470,13 +452,12 @@ void Test_CF_Init_CallTo_CFE_EVS_SendEvent_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_Wr UtAssert_STUB_COUNT(CFE_SB_CreatePipe, 1); UtAssert_STUB_COUNT(CFE_SB_Subscribe, 3); UtAssert_STUB_COUNT(CF_CFDP_InitEngine, 1); - UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); } -void Test_CF_Init_Success(void) +void Test_CF_AppInit_Success(void) { /* Act */ - UtAssert_INT32_EQ(CF_Init(), CFE_SUCCESS); + UtAssert_INT32_EQ(CF_AppInit(), CFE_SUCCESS); /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_Init, 1); @@ -560,7 +541,7 @@ void Test_CF_ProcessMsg_SendHk(void) /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_GetMsgId, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); - UtAssert_STUB_COUNT(CFE_MSG_SetMsgTime, 1); /* Confirms CF_HkCmd path was taken */ + UtAssert_STUB_COUNT(CFE_SB_TimeStampMsg, 1); /* Confirms CF_HkCmd path was taken */ } void Test_CF_ProcessMsg_UnrecognizedCommandEnterDefaultPath(void) @@ -586,7 +567,7 @@ void Test_CF_ProcessMsg_UnrecognizedCommandEnterDefaultPath(void) ** *******************************************************************************/ -void Test_CF_AppMain_CallTo_CF_Init_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_run_status_To_CFE_ES_RunStatus_APP_ERROR( +void Test_CF_AppMain_CallTo_CF_AppInit_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_RunStatus_To_CFE_ES_RunStatus_APP_ERROR( void) { /* Arrange */ @@ -601,7 +582,7 @@ void Test_CF_AppMain_CallTo_CF_Init_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_run_s UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 2); UtAssert_STUB_COUNT(CFE_ES_RunLoop, 1); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); - UtAssert_UINT32_EQ(CF_AppData.run_status, CFE_ES_RunStatus_APP_ERROR); + UtAssert_UINT32_EQ(CF_AppData.RunStatus, CFE_ES_RunStatus_APP_ERROR); } void Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases(void) @@ -628,19 +609,7 @@ void Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases(void) UtAssert_STUB_COUNT(CFE_ES_RunLoop, 2); UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1); - /* Event from CF_Init and CF_AppMain */ - UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2); - UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_INIT_INF_EID); - UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[1], CF_EID_ERR_INIT_MSG_RECV); - - /* Reset, return CFE_SUCCESS from CFE_SB_ReceiveBuffer and buffer NULL */ - UT_CF_ResetEventCapture(); - UT_SetDataBuffer(UT_KEY(CFE_SB_ReceiveBuffer), &sbbufptr, sizeof(sbbufptr), false); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true); - - UtAssert_VOIDCALL(CF_AppMain()); - - /* Event from CF_Init and CF_AppMain */ + /* Event from CF_AppInit and CF_AppMain */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2); UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_INIT_INF_EID); UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[1], CF_EID_ERR_INIT_MSG_RECV); @@ -657,7 +626,7 @@ void Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases(void) UtAssert_VOIDCALL(CF_AppMain()); - /* Event from CF_Init */ + /* Event from CF_AppInit */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); UtAssert_UINT32_EQ(UT_CF_CapturedEventIDs[0], CF_INIT_INF_EID); UtAssert_STUB_COUNT(CFE_ES_RunLoop, 3); @@ -668,13 +637,13 @@ void Test_CF_AppMain_RunLoopCallTo_CFE_SB_ReceiveBuffer_Returns_CFE_SUCCESS_AndV /* Arrange */ CFE_SB_MsgId_t forced_MsgID = CFE_SB_INVALID_MSG_ID; CFE_SB_Buffer_t fake_msg; - CFE_SB_Buffer_t *msg = &fake_msg; + CFE_SB_Buffer_t *BufPtr = &fake_msg; UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true); UT_SetDefaultReturnValue(UT_KEY(CFE_ES_RunLoop), false); /* Actual data not used, just address is needed */ - UT_SetDataBuffer(UT_KEY(CFE_SB_ReceiveBuffer), &msg, sizeof(msg), false); + UT_SetDataBuffer(UT_KEY(CFE_SB_ReceiveBuffer), &BufPtr, sizeof(BufPtr), false); /* Arrange unstubbable: CF_ProcessMsg, invalid ID */ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &forced_MsgID, sizeof(forced_MsgID), false); @@ -686,7 +655,7 @@ void Test_CF_AppMain_RunLoopCallTo_CFE_SB_ReceiveBuffer_Returns_CFE_SUCCESS_AndV UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 4); UtAssert_STUB_COUNT(CFE_ES_RunLoop, 2); UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1); - /* Assert for CF_Init call and CF_ProcessMsg */ + /* Assert for CF_AppInit call and CF_ProcessMsg */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2); /* Assert for CF_ProcessMsg */ UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, 1); @@ -756,30 +725,26 @@ void add_CF_TableInit_tests(void) "Test_CF_TableInit_When_CFE_TBL_GetAddress_Returns_CFE_TBL_INFO_UPDATED_SuccessAndDoNotSendEvent"); } -void add_CF_Init_tests(void) +void add_CF_AppInit_tests(void) { UtTest_Add( - Test_CF_Init_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus, - cf_app_tests_Setup, CF_App_Tests_Teardown, - "Test_CF_Init_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus"); - UtTest_Add( - Test_CF_Init_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus, + Test_CF_AppInit_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus, cf_app_tests_Setup, CF_App_Tests_Teardown, - "Test_CF_Init_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus"); + "Test_CF_AppInit_CallTo_CFE_EVS_Register_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus"); + UtTest_Add(Test_CF_AppInit_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Return_Pipe_Creation_Error_EID, + cf_app_tests_Setup, CF_App_Tests_Teardown, + "Test_CF_AppInit_CallTo_CFE_SB_CreatePipe_ReturnsNot_CFE_SUCCESS_Return_Pipe_Creation_Error_EID"); UtTest_Add( - Test_CF_Init_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus, + Test_CF_AppInit_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus, cf_app_tests_Setup, CF_App_Tests_Teardown, - "Test_CF_Init_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus"); - UtTest_Add(Test_CF_Init_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus, cf_app_tests_Setup, - CF_App_Tests_Teardown, "Test_CF_Init_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus"); - UtTest_Add(Test_CF_Init_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus, cf_app_tests_Setup, + "Test_CF_AppInit_FirstCallTo_CFE_SB_Subscribe_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_" + "ReturnErrorStatus"); + UtTest_Add(Test_CF_AppInit_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus, cf_app_tests_Setup, + CF_App_Tests_Teardown, "Test_CF_AppInit_CallTo_CF_TableInit_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus"); + UtTest_Add(Test_CF_AppInit_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus, cf_app_tests_Setup, CF_App_Tests_Teardown, - "Test_CF_Init_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus"); - UtTest_Add( - Test_CF_Init_CallTo_CFE_EVS_SendEvent_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus, - cf_app_tests_Setup, CF_App_Tests_Teardown, - "Test_CF_Init_CallTo_CFE_EVS_SendEvent_ReturnsNot_CFE_SUCCESS_Call_CFE_ES_WriteToSysLog_ReturnErrorStatus"); - UtTest_Add(Test_CF_Init_Success, cf_app_tests_Setup, CF_App_Tests_Teardown, "Test_CF_Init_Success"); + "Test_CF_AppInit_CallTo_CF_CFDP_InitEngine_ReturnsNot_CFE_SUCCESS_ReturnErrorStatus"); + UtTest_Add(Test_CF_AppInit_Success, cf_app_tests_Setup, CF_App_Tests_Teardown, "Test_CF_AppInit_Success"); } void add_CF_WakeUp_tests(void) @@ -800,9 +765,9 @@ void add_CF_ProcessMsg_tests(void) void add_CF_AppMain_tests(void) { UtTest_Add( - Test_CF_AppMain_CallTo_CF_Init_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_run_status_To_CFE_ES_RunStatus_APP_ERROR, + Test_CF_AppMain_CallTo_CF_AppInit_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_RunStatus_To_CFE_ES_RunStatus_APP_ERROR, cf_app_tests_Setup, CF_App_Tests_Teardown, - "Test_CF_AppMain_CallTo_CF_Init_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_run_status_To_CFE_ES_RunStatus_APP_" + "Test_CF_AppMain_CallTo_CF_AppInit_DoNotReturn_CFE_SUCCESS_Set_CF_AppData_RunStatus_To_CFE_ES_RunStatus_APP_" "ERROR"); UtTest_Add(Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases, cf_app_tests_Setup, CF_App_Tests_Teardown, "Test_CF_AppMain_CFE_SB_ReceiveBuffer_Cases"); @@ -830,7 +795,7 @@ void UtTest_Setup(void) add_CF_TableInit_tests(); - add_CF_Init_tests(); + add_CF_AppInit_tests(); add_CF_WakeUp_tests(); diff --git a/unit-test/cf_cfdp_sbintf_tests.c b/unit-test/cf_cfdp_sbintf_tests.c index c4a16049..b72f782a 100644 --- a/unit-test/cf_cfdp_sbintf_tests.c +++ b/unit-test/cf_cfdp_sbintf_tests.c @@ -258,7 +258,7 @@ void Test_CF_CFDP_ReceiveMessage(void) UT_SetDeferredRetcode(UT_KEY(CF_CFDP_RecvPh), 1, -1); UtAssert_VOIDCALL(CF_CFDP_ReceiveMessage(chan)); - /* Test the path where the function recieves a telemetry packet on it's pipe */ + /* Test the path where the function receives a telemetry packet on it's pipe */ UT_CFDP_SetupBasicTestState(UT_CF_Setup_RX, NULL, &chan, NULL, &txn, &config); UT_SetDeferredRetcode(UT_KEY(CF_CFDP_RecvPh), 1, -1); /* Override message type to take the command branch of the if then/else clause */ diff --git a/unit-test/cf_cmd_tests.c b/unit-test/cf_cmd_tests.c index 0e6858f2..f51cf135 100644 --- a/unit-test/cf_cmd_tests.c +++ b/unit-test/cf_cmd_tests.c @@ -119,11 +119,11 @@ void Dummy_CF_TsnChanAction_fn_t(CF_Transaction_t *txn, void *context) /******************************************************************************* ** -** CF_CmdNoop tests +** CF_NoopCmd tests ** *******************************************************************************/ -void Test_CF_CmdNoop_SendNoopEventAndAcceptCommand(void) +void Test_CF_NoopCmd_SendNoopEventAndAcceptCommand(void) { /* Arrange */ CF_NoopCmd_t utbuf; @@ -145,14 +145,14 @@ void Test_CF_CmdNoop_SendNoopEventAndAcceptCommand(void) /******************************************************************************* ** -** CF_CmdReset tests +** CF_ResetCountersCmd tests ** *******************************************************************************/ -void Test_CF_CmdReset_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand(void) +void Test_CF_ResetCountersCmd_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; uint16 initial_hk_err_counter = Any_uint16(); @@ -163,7 +163,7 @@ void Test_CF_CmdReset_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand(vo CF_AppData.hk.Payload.counters.err = initial_hk_err_counter; /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -172,10 +172,10 @@ void Test_CF_CmdReset_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand(vo UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdReset_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCommand(void) +void Test_CF_ResetCountersCmd_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCommand(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; uint16 initial_hk_err_counter = Any_uint16(); @@ -186,7 +186,7 @@ void Test_CF_CmdReset_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCom CF_AppData.hk.Payload.counters.err = initial_hk_err_counter; /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -195,10 +195,10 @@ void Test_CF_CmdReset_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCom UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdReset_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSendEvent(void) +void Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSendEvent(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; memset(&utbuf, 0, sizeof(utbuf)); @@ -208,7 +208,7 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSe CF_AppData.hk.Payload.counters.err = Any_uint16_Except(0); /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -217,10 +217,10 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSe UtAssert_ZERO(CF_AppData.hk.Payload.counters.err); } -void Test_CF_CmdReset_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEventAndAcceptCommand(void) +void Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEventAndAcceptCommand(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; int i = 0; uint16 initial_hk_cmd_counter = Any_uint16(); @@ -248,7 +248,7 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEven CF_AppData.hk.Payload.counters.cmd = initial_hk_cmd_counter; /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -276,10 +276,10 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEven UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdReset_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEventAndAcceptCommand(void) +void Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEventAndAcceptCommand(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; int i = 0; uint16 initial_hk_cmd_counter = Any_uint16(); @@ -301,7 +301,7 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEvent CF_AppData.hk.Payload.counters.cmd = initial_hk_cmd_counter; /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -323,10 +323,10 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEvent UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdReset_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEventAcceptCommand(void) +void Test_CF_ResetCountersCmd_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEventAcceptCommand(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; uint8 i = 0; uint16 initial_hk_cmd_counter = Any_uint16(); @@ -345,7 +345,7 @@ void Test_CF_CmdReset_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEve CF_AppData.hk.Payload.counters.cmd = initial_hk_cmd_counter; /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -364,10 +364,10 @@ void Test_CF_CmdReset_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEve UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdReset_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent(void) +void Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent(void) { /* Arrange */ - CF_ResetCmd_t utbuf; + CF_ResetCountersCmd_t utbuf; CF_UnionArgs_Payload_t *data = &utbuf.Payload; int i = 0; @@ -412,7 +412,7 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent( } /* Act */ - CF_ResetCmd(&utbuf); + CF_ResetCountersCmd(&utbuf); /* Assert */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); @@ -442,11 +442,11 @@ void Test_CF_CmdReset_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent( /******************************************************************************* ** -** CF_CmdTxFile tests +** CF_TxFileCmd tests ** *******************************************************************************/ -void Test_CF_CmdTxFile(void) +void Test_CF_TxFileCmd(void) { /* Test case for: * void CF_TxFileCmd(CFE_SB_Buffer_t *msg); @@ -514,11 +514,11 @@ void Test_CF_CmdTxFile(void) /******************************************************************************* ** -** CF_CmdPlaybackDir tests +** CF_PlaybackDirCmd tests ** *******************************************************************************/ -void Test_CF_CmdPlaybackDir(void) +void Test_CF_PlaybackDirCmd(void) { /* Test case for: * void CF_PlaybackDirCmd(CFE_SB_Buffer_t *msg); @@ -838,11 +838,11 @@ void Test_CF_DoFreezeThaw_Set_frozen_ToGiven_context_barg_AndReturn_0(void) /************************************************************************** ** -** CF_CmdFreeze tests +** CF_FreezeCmd tests ** *******************************************************************************/ -void Test_CF_CmdFreeze_Set_frozen_To_1_AndAcceptCommand(void) +void Test_CF_FreezeCmd_Set_frozen_To_1_AndAcceptCommand(void) { /* Arrange */ CF_FreezeCmd_t utbuf; @@ -874,7 +874,7 @@ void Test_CF_CmdFreeze_Set_frozen_To_1_AndAcceptCommand(void) UT_CF_AssertEventID(CF_EID_INF_CMD_FREEZE); } -void Test_CF_CmdFreeze_Set_frozen_To_1_AndRejectCommand(void) +void Test_CF_FreezeCmd_Set_frozen_To_1_AndRejectCommand(void) { /* Arrange */ CF_FreezeCmd_t utbuf; @@ -899,11 +899,11 @@ void Test_CF_CmdFreeze_Set_frozen_To_1_AndRejectCommand(void) /******************************************************************************* ** -** CF_CmdThaw tests +** CF_ThawCmd tests ** *******************************************************************************/ -void Test_CF_CmdThaw_Set_frozen_To_0_AndAcceptCommand(void) +void Test_CF_ThawCmd_Set_frozen_To_0_AndAcceptCommand(void) { /* Arrange */ CF_ThawCmd_t utbuf; @@ -935,7 +935,7 @@ void Test_CF_CmdThaw_Set_frozen_To_0_AndAcceptCommand(void) UT_CF_AssertEventID(CF_EID_INF_CMD_THAW); } -void Test_CF_CmdThaw_Set_frozen_To_0_AndRejectCommand(void) +void Test_CF_ThawCmd_Set_frozen_To_0_AndRejectCommand(void) { /* Arrange */ CF_ThawCmd_t utbuf; @@ -1321,12 +1321,12 @@ void Test_CF_DoSuspRes(void) /******************************************************************************* ** -** CF_CmdSuspend tests +** CF_SuspendCmd tests ** *******************************************************************************/ -/* Test_CF_CmdSuspend_Call_CF_DoSuspRes_WithGiven_msg_And_action_1 */ -void Test_CF_CmdSuspend_Call_CF_DoSuspRes_WithGiven_msg_And_action_1(void) +/* Test_CF_SuspendCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_1 */ +void Test_CF_SuspendCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_1(void) { /* Arrange */ CF_SuspendCmd_t utbuf; @@ -1350,12 +1350,12 @@ void Test_CF_CmdSuspend_Call_CF_DoSuspRes_WithGiven_msg_And_action_1(void) /******************************************************************************* ** -** CF_CmdResume tests +** CF_ResumeCmd tests ** *******************************************************************************/ -/* Test_CF_CmdResume_Call_CF_DoSuspRes_WithGiven_msg_And_action_0 */ -void Test_CF_CmdResume_Call_CF_DoSuspRes_WithGiven_msg_And_action_0(void) +/* Test_CF_ResumeCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_0 */ +void Test_CF_ResumeCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_0(void) { CF_ResumeCmd_t utbuf; @@ -1378,11 +1378,11 @@ void Test_CF_CmdResume_Call_CF_DoSuspRes_WithGiven_msg_And_action_0(void) /******************************************************************************* ** -** CF_CmdCancel_Txn tests +** CF_Cancel_TxnCmd tests ** *******************************************************************************/ -void Test_CF_CmdCancel_Txn_Call_CF_CFDP_CancelTransaction_WithGiven_t(void) +void Test_CF_Cancel_TxnCmd_Call_CF_CFDP_CancelTransaction_WithGiven_t(void) { /* Arrange */ CF_Transaction_t txn; @@ -1394,7 +1394,7 @@ void Test_CF_CmdCancel_Txn_Call_CF_CFDP_CancelTransaction_WithGiven_t(void) sizeof(context_CF_CFDP_CancelTransaction), false); /* Act */ - CF_CmdCancel_Txn(arg_t, arg_ignored); + CF_Cancel_TxnCmd(arg_t, arg_ignored); /* Assert */ UtAssert_ADDRESS_EQ(context_CF_CFDP_CancelTransaction, arg_t); @@ -1402,11 +1402,11 @@ void Test_CF_CmdCancel_Txn_Call_CF_CFDP_CancelTransaction_WithGiven_t(void) /******************************************************************************* ** -** CF_CmdCancel tests +** CF_CancelCmd tests ** *******************************************************************************/ -void Test_CF_CmdCancel_Success(void) +void Test_CF_CancelCmd_Success(void) { CF_CancelCmd_t utbuf; @@ -1425,7 +1425,7 @@ void Test_CF_CmdCancel_Success(void) UT_CF_AssertEventID(CF_EID_INF_CMD_CANCEL); } -void Test_CF_CmdCancel_Failure(void) +void Test_CF_CancelCmd_Failure(void) { CF_CancelCmd_t utbuf; @@ -1445,11 +1445,11 @@ void Test_CF_CmdCancel_Failure(void) /******************************************************************************* ** -** CF_CmdAbandon_Txn tests +** CF_Abandon_TxnCmd tests ** *******************************************************************************/ -void Test_CF_CmdAbandon_Txn_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0(void) +void Test_CF_Abandon_TxnCmd_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0(void) { /* Arrange */ CF_Transaction_t txn; @@ -1461,7 +1461,7 @@ void Test_CF_CmdAbandon_Txn_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0(void sizeof(context_CF_CFDP_ResetTransaction), false); /* Act */ - CF_CmdAbandon_Txn(arg_t, arg_ignored); + CF_Abandon_TxnCmd(arg_t, arg_ignored); /* Assert */ UtAssert_ADDRESS_EQ(context_CF_CFDP_ResetTransaction.txn, arg_t); @@ -1472,11 +1472,11 @@ void Test_CF_CmdAbandon_Txn_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0(void /******************************************************************************* ** -** CF_CmdAbandon tests +** CF_AbandonCmd tests ** *******************************************************************************/ -void Test_CF_CmdAbandon_Success(void) +void Test_CF_AbandonCmd_Success(void) { CF_AbandonCmd_t utbuf; @@ -1495,7 +1495,7 @@ void Test_CF_CmdAbandon_Success(void) UT_CF_AssertEventID(CF_EID_INF_CMD_ABANDON); } -void Test_CF_CmdAbandon_Failure(void) +void Test_CF_AbandonCmd_Failure(void) { CF_AbandonCmd_t utbuf; @@ -1543,11 +1543,11 @@ void Test_CF_DoEnableDisableDequeue_Set_chan_num_EnabledFlagTo_context_barg(void /******************************************************************************* ** -** CF_CmdEnableDequeue tests +** CF_EnableDequeueCmd tests ** *******************************************************************************/ -void Test_CF_CmdEnableDequeue_Success(void) +void Test_CF_EnableDequeueCmd_Success(void) { CF_EnableDequeueCmd_t utbuf; @@ -1575,7 +1575,7 @@ void Test_CF_CmdEnableDequeue_Success(void) /* Assert */ /* Assert for CF_DoFreezeThaw */ UtAssert_True(CF_AppData.config_table->chan[chan_num].dequeue_enabled == 1, - "CF_CmdEnableDequeue set dequeue_enabled to %d and should be 1 (barg = 1))", + "CF_EnableDequeueCmd set dequeue_enabled to %d and should be 1 (barg = 1))", CF_AppData.config_table->chan[chan_num].dequeue_enabled); /* Assert for incremented counter */ UtAssert_True( @@ -1587,7 +1587,7 @@ void Test_CF_CmdEnableDequeue_Success(void) UT_CF_AssertEventID(CF_EID_INF_CMD_ENABLE_DEQUEUE); } -void Test_CF_CmdEnableDequeue_Failure(void) +void Test_CF_EnableDequeueCmd_Failure(void) { /* Arrange */ CF_EnableDequeueCmd_t utbuf; @@ -1618,11 +1618,11 @@ void Test_CF_CmdEnableDequeue_Failure(void) /******************************************************************************* ** -** CF_CmdDisableDequeue tests +** CF_DisableDequeueCmd tests ** *******************************************************************************/ -void Test_CF_CmdDisableDequeue_Success(void) +void Test_CF_DisableDequeueCmd_Success(void) { CF_DisableDequeueCmd_t utbuf; @@ -1649,7 +1649,7 @@ void Test_CF_CmdDisableDequeue_Success(void) /* Assert */ /* Assert for CF_DoFreezeThaw */ UtAssert_True(CF_AppData.config_table->chan[chan_num].dequeue_enabled == 0, - "CF_CmdEnableDequeue set dequeue_enabled to %d and should be 0 (barg = 0))", + "CF_EnableDequeueCmd set dequeue_enabled to %d and should be 0 (barg = 0))", CF_AppData.config_table->chan[chan_num].dequeue_enabled); /* Assert for incremented counter */ UtAssert_True(CF_AppData.hk.Payload.counters.cmd == (uint16)(initial_hk_cmd_counter + 1), @@ -1659,7 +1659,7 @@ void Test_CF_CmdDisableDequeue_Success(void) UT_CF_AssertEventID(CF_EID_INF_CMD_DISABLE_DEQUEUE); } -void Test_CF_CmdDisableDequeue_Failure(void) +void Test_CF_DisableDequeueCmd_Failure(void) { /* Arrange */ CF_DisableDequeueCmd_t utbuf; @@ -1830,11 +1830,11 @@ void Test_CF_DoEnableDisablePolldir_FailAnyBadPolldirSendEvent(void) /******************************************************************************* ** -** CF_CmdEnablePolldir tests +** CF_EnablePolldirCmd tests ** *******************************************************************************/ -void Test_CF_CmdEnablePolldir_SuccessWhenActionSuccess(void) +void Test_CF_EnablePolldirCmd_SuccessWhenActionSuccess(void) { /* Arrange */ CF_ConfigTable_t config_table; @@ -1874,7 +1874,7 @@ void Test_CF_CmdEnablePolldir_SuccessWhenActionSuccess(void) UT_CF_AssertEventID(CF_EID_INF_CMD_ENABLE_POLLDIR); } -void Test_CF_CmdEnablePolldir_FailWhenActionFail(void) +void Test_CF_EnablePolldirCmd_FailWhenActionFail(void) { /* Arrange */ uint8 channel = Any_cf_channel(); @@ -1907,11 +1907,11 @@ void Test_CF_CmdEnablePolldir_FailWhenActionFail(void) /******************************************************************************* ** -** CF_CmdDisablePolldir tests +** CF_DisablePolldirCmd tests ** *******************************************************************************/ -void Test_CF_CmdDisablePolldir_SuccessWhenActionSuccess(void) +void Test_CF_DisablePolldirCmd_SuccessWhenActionSuccess(void) { /* Arrange */ CF_ConfigTable_t config_table; @@ -1950,7 +1950,7 @@ void Test_CF_CmdDisablePolldir_SuccessWhenActionSuccess(void) UT_CF_AssertEventID(CF_EID_INF_CMD_DISABLE_POLLDIR); } -void Test_CF_CmdDisablePolldir_FailWhenActionFail(void) +void Test_CF_DisablePolldirCmd_FailWhenActionFail(void) { /* Arrange */ uint8 channel = Any_cf_channel(); @@ -2223,11 +2223,11 @@ void Test_CF_DoPurgeQueue_AnyGivenBad_data_byte_1_SendEventAndReturn_neg1(void) /******************************************************************************* ** -** CF_CmdPurgeQueue tests +** CF_PurgeQueueCmd tests ** *******************************************************************************/ -void Test_CF_CmdPurgeQueue_FailWhenActionFail(void) +void Test_CF_PurgeQueueCmd_FailWhenActionFail(void) { /* Arrange */ uint8 channel = Any_cf_channel(); @@ -2258,7 +2258,7 @@ void Test_CF_CmdPurgeQueue_FailWhenActionFail(void) UT_CF_AssertEventID(CF_EID_ERR_CMD_PURGE_QUEUE); } -void Test_CF_CmdPurgeQueue_SuccessWhenActionSuccess(void) +void Test_CF_PurgeQueueCmd_SuccessWhenActionSuccess(void) { /* Arrange */ uint8 channel = Any_cf_channel(); @@ -2285,11 +2285,11 @@ void Test_CF_CmdPurgeQueue_SuccessWhenActionSuccess(void) /******************************************************************************* ** -** CF_CmdWriteQueue tests +** CF_WriteQueueCmd tests ** *******************************************************************************/ -void Test_CF_CmdWriteQueue_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectCommand(void) +void Test_CF_WriteQueueCmd_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectCommand(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2313,7 +2313,7 @@ void Test_CF_CmdWriteQueue_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectComman UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRejectCommand(void) +void Test_CF_WriteQueueCmd_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRejectCommand(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2338,7 +2338,7 @@ void Test_CF_CmdWriteQueue_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRej UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_WhenUpAndPendingQueueSendEventAndRejectCommand(void) +void Test_CF_WriteQueueCmd_WhenUpAndPendingQueueSendEventAndRejectCommand(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2367,7 +2367,7 @@ void Test_CF_CmdWriteQueue_WhenUpAndPendingQueueSendEventAndRejectCommand(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_IsNot_q_pend_SendEventAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_IsNot_q_pend_SendEventAndRejectCommand( void) { /* Arrange */ @@ -2408,7 +2408,7 @@ void Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_ UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_queue_Is_q_pend_SendEventAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_queue_Is_q_pend_SendEventAndRejectCommand( void) { /* Arrange */ @@ -2449,7 +2449,7 @@ void Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_que UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedClose_SendEventCloseAndRejectCommandWhen_CF_WriteTxnQueueDataToFile_Fails( +void Test_CF_WriteQueueCmd_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedClose_SendEventCloseAndRejectCommandWhen_CF_WriteTxnQueueDataToFile_Fails( void) { /* Arrange */ @@ -2497,7 +2497,7 @@ void Test_CF_CmdWriteQueue_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedC UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventClosesAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventClosesAndRejectCommand( void) { /* Arrange */ @@ -2548,7 +2548,7 @@ void Test_CF_CmdWriteQueue_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_q UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( void) { /* Arrange */ @@ -2599,7 +2599,7 @@ void Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpA UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( void) { /* Arrange */ @@ -2650,7 +2650,7 @@ void Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( void) { /* Arrange */ @@ -2703,7 +2703,7 @@ void Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_w UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsPend_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsPend_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( void) { /* Arrange */ @@ -2754,7 +2754,7 @@ void Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDow UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( +void Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand( void) { /* Arrange */ @@ -2805,7 +2805,7 @@ void Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDow UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_All(void) +void Test_CF_WriteQueueCmd_Success_type_AllAnd_q_All(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2854,7 +2854,7 @@ void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_All(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_History(void) +void Test_CF_WriteQueueCmd_Success_type_AllAnd_q_History(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2899,7 +2899,7 @@ void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_History(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Active(void) +void Test_CF_WriteQueueCmd_Success_type_AllAnd_q_Active(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2944,7 +2944,7 @@ void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Active(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Pend(void) +void Test_CF_WriteQueueCmd_Success_type_AllAnd_q_Pend(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -2989,7 +2989,7 @@ void Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Pend(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_UpAnd_q_All(void) +void Test_CF_WriteQueueCmd_Success_type_UpAnd_q_All(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3038,7 +3038,7 @@ void Test_CF_CmdWriteQueue_Success_type_UpAnd_q_All(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_UpAnd_q_History(void) +void Test_CF_WriteQueueCmd_Success_type_UpAnd_q_History(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3083,7 +3083,7 @@ void Test_CF_CmdWriteQueue_Success_type_UpAnd_q_History(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_UpAnd_q_Active(void) +void Test_CF_WriteQueueCmd_Success_type_UpAnd_q_Active(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3128,9 +3128,9 @@ void Test_CF_CmdWriteQueue_Success_type_UpAnd_q_Active(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -/* Test_CF_CmdWriteQueue_Success_type_UpAnd_q_Pend IS an error and is handled by a previous test */ +/* Test_CF_WriteQueueCmd_Success_type_UpAnd_q_Pend IS an error and is handled by a previous test */ -void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_All(void) +void Test_CF_WriteQueueCmd_Success_type_DownAnd_q_All(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3175,7 +3175,7 @@ void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_All(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_History(void) +void Test_CF_WriteQueueCmd_Success_type_DownAnd_q_History(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3220,7 +3220,7 @@ void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_History(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Active(void) +void Test_CF_WriteQueueCmd_Success_type_DownAnd_q_Active(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3265,7 +3265,7 @@ void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Active(void) UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Pend(void) +void Test_CF_WriteQueueCmd_Success_type_DownAnd_q_Pend(void) { /* Arrange */ CF_WriteQueueCmd_t utbuf; @@ -3312,11 +3312,11 @@ void Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Pend(void) /******************************************************************************* ** -** CF_CmdValidateChunkSize tests +** CF_ValidateChunkSizeCmd tests ** *******************************************************************************/ -void Test_CF_CmdValidateChunkSize_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1(void) +void Test_CF_ValidateChunkSizeCmd_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1(void) { /* Arrange */ uint8 arg_chan_num = Any_uint8(); /* value labeled as 'ignored' in func def */ @@ -3324,14 +3324,14 @@ void Test_CF_CmdValidateChunkSize_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1( CFE_Status_t local_result; /* Act */ - local_result = CF_CmdValidateChunkSize(arg_val, arg_chan_num); + local_result = CF_ValidateChunkSizeCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CF_ERROR, "CF_CmdValidateChunkSize returned %d and should be -1 (CF_ERROR)", + UtAssert_True(local_result == CF_ERROR, "CF_ValidateChunkSizeCmd returned %d and should be -1 (CF_ERROR)", local_result); } -void Test_CF_CmdValidateChunkSize_Any_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1(void) +void Test_CF_ValidateChunkSizeCmd_Any_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1(void) { /* Arrange */ uint8 arg_chan_num = Any_uint8(); /* value labeled as 'ignored' in func def */ @@ -3339,14 +3339,14 @@ void Test_CF_CmdValidateChunkSize_Any_val_GreaterThan_pdu_fd_data_t_FailAndRetur CFE_Status_t local_result; /* Act */ - local_result = CF_CmdValidateChunkSize(arg_val, arg_chan_num); + local_result = CF_ValidateChunkSizeCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CF_ERROR, "CF_CmdValidateChunkSize returned %d and should be -1 (CF_ERROR)", + UtAssert_True(local_result == CF_ERROR, "CF_ValidateChunkSizeCmd returned %d and should be -1 (CF_ERROR)", local_result); } -void Test_CF_CmdValidateChunkSize_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0(void) +void Test_CF_ValidateChunkSizeCmd_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0(void) { /* Arrange */ uint8 arg_chan_num = Any_uint8(); /* value labeled as 'ignored' in func def */ @@ -3354,14 +3354,14 @@ void Test_CF_CmdValidateChunkSize_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0(vo CFE_Status_t local_result; /* Act */ - local_result = CF_CmdValidateChunkSize(arg_val, arg_chan_num); + local_result = CF_ValidateChunkSizeCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CFE_SUCCESS, "CF_CmdValidateChunkSize returned %d and should be 0 (CFE_SUCCESS)", + UtAssert_True(local_result == CFE_SUCCESS, "CF_ValidateChunkSizeCmd returned %d and should be 0 (CFE_SUCCESS)", local_result); } -void Test_CF_CmdValidateChunkSize_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAndReturn_0(void) +void Test_CF_ValidateChunkSizeCmd_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAndReturn_0(void) { /* Arrange */ uint8 arg_chan_num = Any_uint8(); /* value labeled as 'ignored' in func def */ @@ -3369,20 +3369,20 @@ void Test_CF_CmdValidateChunkSize_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAn CFE_Status_t local_result; /* Act */ - local_result = CF_CmdValidateChunkSize(arg_val, arg_chan_num); + local_result = CF_ValidateChunkSizeCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CFE_SUCCESS, "CF_CmdValidateChunkSize returned %d and should be 0 (CFE_SUCCESS)", + UtAssert_True(local_result == CFE_SUCCESS, "CF_ValidateChunkSizeCmd returned %d and should be 0 (CFE_SUCCESS)", local_result); } /******************************************************************************* ** -** CF_CmdValidateMaxOutgoing tests +** CF_ValidateMaxOutgoingCmd tests ** *******************************************************************************/ -void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_IsNot_0_Return_0_Success(void) +void Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_IsNot_0_Return_0_Success(void) { /* Arrange */ uint32 arg_val = Any_uint32_Except(0); @@ -3390,14 +3390,14 @@ void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_IsNot_0_Return_0_Success(void) CFE_Status_t local_result; /* Act */ - local_result = CF_CmdValidateMaxOutgoing(arg_val, arg_chan_num); + local_result = CF_ValidateMaxOutgoingCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CFE_SUCCESS, "CF_CmdValidateMaxOutgoing returned %d and should be 0 (CFE_SUCCESS)", + UtAssert_True(local_result == CFE_SUCCESS, "CF_ValidateMaxOutgoingCmd returned %d and should be 0 (CFE_SUCCESS)", local_result); } -void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_Return_0_Success(void) +void Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_Return_0_Success(void) { /* Arrange */ uint32 arg_val = 0; @@ -3409,14 +3409,14 @@ void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_R memset(CF_AppData.config_table->chan[arg_chan_num].sem_name, (char)Any_uint8_Except(0), 1); /* Act */ - local_result = CF_CmdValidateMaxOutgoing(arg_val, arg_chan_num); + local_result = CF_ValidateMaxOutgoingCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CFE_SUCCESS, "CF_CmdValidateMaxOutgoing returned %d and should be 0 (CFE_SUCCESS)", + UtAssert_True(local_result == CFE_SUCCESS, "CF_ValidateMaxOutgoingCmd returned %d and should be 0 (CFE_SUCCESS)", local_result); } -void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Return_1_Fail(void) +void Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Return_1_Fail(void) { /* Arrange */ uint32 arg_val = 0; @@ -3428,20 +3428,20 @@ void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Retu memset(CF_AppData.config_table->chan[arg_chan_num].sem_name, (char)0, 1); /* Act */ - local_result = CF_CmdValidateMaxOutgoing(arg_val, arg_chan_num); + local_result = CF_ValidateMaxOutgoingCmd(arg_val, arg_chan_num); /* Assert */ - UtAssert_True(local_result == CF_ERROR, "CF_CmdValidateMaxOutgoing returned %d and should be -1 (CF_ERROR)", + UtAssert_True(local_result == CF_ERROR, "CF_ValidateMaxOutgoingCmd returned %d and should be -1 (CF_ERROR)", local_result); } /******************************************************************************* ** -** CF_CmdGetSetParam tests +** CF_GetSetParamCmd tests ** *******************************************************************************/ -void Test_CF_CmdGetSetParam(void) +void Test_CF_GetSetParamCmd(void) { /* Test cases for: * void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num); @@ -3509,11 +3509,11 @@ void Test_CF_CmdGetSetParam(void) /******************************************************************************* ** -** CF_CmdSetParam tests +** CF_SetParamCmd tests ** *******************************************************************************/ -void Test_CF_CmdSetParam_Call_CF_CmdGetSetParam_With_cmd_key_And_cmd_value(void) +void Test_CF_SetParamCmd_Call_CF_GetSetParamCmd_With_cmd_key_And_cmd_value(void) { /* Arrange */ CF_SetParamCmd_t utbuf; @@ -3541,11 +3541,11 @@ void Test_CF_CmdSetParam_Call_CF_CmdGetSetParam_With_cmd_key_And_cmd_value(void) /******************************************************************************* ** -** CF_CmdGetParam tests +** CF_GetParamCmd tests ** *******************************************************************************/ -void Test_CF_CmdGetParam_Call_CF_CmdGetSetParam_With_cmd_data_byte_0_AndConstantValue_0(void) +void Test_CF_GetParamCmd_Call_CF_GetSetParamCmd_With_cmd_data_byte_0_AndConstantValue_0(void) { /* Arrange */ CF_GetParamCmd_t utbuf; @@ -3572,11 +3572,11 @@ void Test_CF_CmdGetParam_Call_CF_CmdGetSetParam_With_cmd_data_byte_0_AndConstant /******************************************************************************* ** -** CF_CmdEnableEngine tests +** CF_EnableEngineCmd tests ** *******************************************************************************/ -void Test_CF_CmdEnableEngine_WithEngineNotEnableInitSuccessAndIncrementCmdCounter(void) +void Test_CF_EnableEngineCmd_WithEngineNotEnableInitSuccessAndIncrementCmdCounter(void) { /* Arrange */ CF_EnableEngineCmd_t utbuf; @@ -3604,7 +3604,7 @@ void Test_CF_CmdEnableEngine_WithEngineNotEnableInitSuccessAndIncrementCmdCounte UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter(void) +void Test_CF_EnableEngineCmd_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter(void) { /* Arrange */ CF_EnableEngineCmd_t utbuf; @@ -3632,7 +3632,7 @@ void Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementEr UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, (initial_hk_err_counter + 1) & 0xFFFF); } -void Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounter(void) +void Test_CF_EnableEngineCmd_WithEngineEnableFailsSendEventAndIncrementErrCounter(void) { /* Arrange */ CF_EnableEngineCmd_t utbuf; @@ -3659,11 +3659,11 @@ void Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounte /******************************************************************************* ** -** CF_CmdDisableEngine tests +** CF_DisableEngineCmd tests ** *******************************************************************************/ -void Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter(void) +void Test_CF_DisableEngineCmd_SuccessWhenEngineEnabledAndIncrementCmdCounter(void) { /* Arrange */ CF_DisableEngineCmd_t utbuf; @@ -3687,7 +3687,7 @@ void Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter(voi UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, (initial_hk_cmd_counter + 1) & 0xFFFF); } -void Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail(void) +void Test_CF_DisableEngineCmd_WhenEngineDisabledAndIncrementErrCounterThenFail(void) { /* Arrange */ CF_DisableEngineCmd_t utbuf; @@ -3793,7 +3793,7 @@ void Test_CF_ProcessGroundCommand_Receives_cmd_AndLengthDoesNotMatchExpectedForT UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, 1); } -void Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_CmdNoop_With_msg(void) +void Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_NoopCmd_With_msg(void) { /* Arrange */ CFE_SB_Buffer_t utbuf; @@ -3813,7 +3813,7 @@ void Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_CmdNoop_With_m /* Assert */ UtAssert_STUB_COUNT(CFE_MSG_GetFcnCode, 1); UtAssert_STUB_COUNT(CFE_MSG_GetSize, 1); - /* Assert for CF_CmdNoop */ + /* Assert for CF_NoopCmd */ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1); UT_CF_AssertEventID(CF_NOOP_INF_EID); /* Assert for incremented counter */ @@ -3853,43 +3853,45 @@ void Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x0C_AndDoNothingBecause_fns_1 ** *******************************************************************************/ -void add_CF_CmdNoop_tests(void) +void add_CF_NoopCmd_tests(void) { - UtTest_Add(Test_CF_CmdNoop_SendNoopEventAndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdNoop_SendNoopEventAndAcceptCommand"); + UtTest_Add(Test_CF_NoopCmd_SendNoopEventAndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_NoopCmd_SendNoopEventAndAcceptCommand"); } -void add_CF_CmdReset_tests(void) +void add_CF_ResetCountersCmd_tests(void) { - UtTest_Add(Test_CF_CmdReset_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdReset_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand"); - UtTest_Add(Test_CF_CmdReset_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCommand, cf_cmd_tests_Setup, + UtTest_Add(Test_CF_ResetCountersCmd_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdReset_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCommand"); - UtTest_Add(Test_CF_CmdReset_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSendEvent, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, - "Test_CF_CmdReset_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSendEvent"); - UtTest_Add(Test_CF_CmdReset_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEventAndAcceptCommand, + "Test_CF_ResetCountersCmd_tests_WhenCommandByteIsEqTo_5_SendEventAndRejectCommand"); + UtTest_Add(Test_CF_ResetCountersCmd_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCommand, + cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_ResetCountersCmd_tests_WhenCommandByteIsGreaterThan_5_SendEventAndRejectCommand"); + UtTest_Add(Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSendEvent, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdReset_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEventAndAcceptCommand"); - UtTest_Add(Test_CF_CmdReset_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEventAndAcceptCommand, + "Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_command_AndResetHkCmdAndErrCountSendEvent"); + UtTest_Add(Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEventAndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdReset_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEventAndAcceptCommand"); - UtTest_Add(Test_CF_CmdReset_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEventAcceptCommand, + "Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_fault_ResetAllHkFaultCountSendEventAndAcceptCommand"); + UtTest_Add(Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEventAndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdReset_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEventAcceptCommand"); - UtTest_Add(Test_CF_CmdReset_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdReset_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent"); + "Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_up_AndResetAllHkRecvCountSendEventAndAcceptCommand"); + UtTest_Add(Test_CF_ResetCountersCmd_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEventAcceptCommand, + cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_ResetCountersCmd_tests_SWhenCommandByteIs_down_AndResetAllHkSentCountendEventAcceptCommand"); + UtTest_Add(Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, + "Test_CF_ResetCountersCmd_tests_WhenCommandByteIs_all_AndResetAllMemValuesSendEvent"); } -void add_CF_CmdTxFile_tests(void) +void add_CF_TxFileCmd_tests(void) { - UtTest_Add(Test_CF_CmdTxFile, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_CmdTxFile"); + UtTest_Add(Test_CF_TxFileCmd, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_TxFileCmd"); } -void add_CF_CmdPlaybackDir_tests(void) +void add_CF_PlaybackDirCmd_tests(void) { - UtTest_Add(Test_CF_CmdPlaybackDir, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_CmdPlaybackDir"); + UtTest_Add(Test_CF_PlaybackDirCmd, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_PlaybackDirCmd"); } void add_CF_DoChanAction_tests(void) @@ -3917,20 +3919,20 @@ void add_CF_DoFreezeThaw_tests(void) cf_cmd_tests_Teardown, "Test_CF_DoFreezeThaw_Set_frozen_ToGiven_context_barg_AndReturn_0"); } -void add_CF_CmdFreeze_tests(void) +void add_CF_FreezeCmd_tests(void) { - UtTest_Add(Test_CF_CmdFreeze_Set_frozen_To_1_AndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdFreeze_Set_frozen_To_1_AndAcceptCommand"); - UtTest_Add(Test_CF_CmdFreeze_Set_frozen_To_1_AndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdFreeze_Set_frozen_To_1_AndRejectCommand"); + UtTest_Add(Test_CF_FreezeCmd_Set_frozen_To_1_AndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_FreezeCmd_Set_frozen_To_1_AndAcceptCommand"); + UtTest_Add(Test_CF_FreezeCmd_Set_frozen_To_1_AndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_FreezeCmd_Set_frozen_To_1_AndRejectCommand"); } -void add_CF_CmdThaw_tests(void) +void add_CF_ThawCmd_tests(void) { - UtTest_Add(Test_CF_CmdThaw_Set_frozen_To_0_AndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdThaw_Set_frozen_To_0_AndAcceptCommand"); - UtTest_Add(Test_CF_CmdThaw_Set_frozen_To_0_AndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdThaw_Set_frozen_To_0_AndRejectCommand"); + UtTest_Add(Test_CF_ThawCmd_Set_frozen_To_0_AndAcceptCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_ThawCmd_Set_frozen_To_0_AndAcceptCommand"); + UtTest_Add(Test_CF_ThawCmd_Set_frozen_To_0_AndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_ThawCmd_Set_frozen_To_0_AndRejectCommand"); } void add_CF_FindTransactionBySequenceNumberAllChannels_tests(void) @@ -3972,40 +3974,40 @@ void add_CF_DoSuspRes_tests(void) UtTest_Add(Test_CF_DoSuspRes, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_DoSuspRes"); } -void add_CF_CmdSuspend_tests(void) +void add_CF_SuspendCmd_tests(void) { - UtTest_Add(Test_CF_CmdSuspend_Call_CF_DoSuspRes_WithGiven_msg_And_action_1, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdSuspend_Call_CF_DoSuspRes_WithGiven_msg_And_action_1"); + UtTest_Add(Test_CF_SuspendCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_1, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_SuspendCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_1"); } -void add_CF_CmdResume_tests(void) +void add_CF_ResumeCmd_tests(void) { - UtTest_Add(Test_CF_CmdResume_Call_CF_DoSuspRes_WithGiven_msg_And_action_0, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdResume_Call_CF_DoSuspRes_WithGiven_msg_And_action_0"); + UtTest_Add(Test_CF_ResumeCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_0, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_ResumeCmd_Call_CF_DoSuspRes_WithGiven_msg_And_action_0"); } -void add_CF_CmdCancel_Txn_tests(void) +void add_CF_Cancel_TxnCmd_tests(void) { - UtTest_Add(Test_CF_CmdCancel_Txn_Call_CF_CFDP_CancelTransaction_WithGiven_t, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdCancel_Txn_Call_CF_CFDP_CancelTransaction_WithGiven_t"); + UtTest_Add(Test_CF_Cancel_TxnCmd_Call_CF_CFDP_CancelTransaction_WithGiven_t, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_Cancel_TxnCmd_Call_CF_CFDP_CancelTransaction_WithGiven_t"); } -void add_CF_CmdCancel_tests(void) +void add_CF_CancelCmd_tests(void) { - UtTest_Add(Test_CF_CmdCancel_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CmdCancel_Failure"); - UtTest_Add(Test_CF_CmdCancel_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CmdCancel_Success"); + UtTest_Add(Test_CF_CancelCmd_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CancelCmd_Failure"); + UtTest_Add(Test_CF_CancelCmd_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CancelCmd_Success"); } -void add_CF_CmdAbandon_Txn_tests(void) +void add_CF_Abandon_TxnCmd_tests(void) { - UtTest_Add(Test_CF_CmdAbandon_Txn_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdAbandon_Txn_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0"); + UtTest_Add(Test_CF_Abandon_TxnCmd_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_Abandon_TxnCmd_Call_CF_CFDP_ResetTransaction_WithGiven_t_And_0"); } -void add_CF_CmdAbandon_tests(void) +void add_CF_AbandonCmd_tests(void) { - UtTest_Add(Test_CF_CmdAbandon_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CmdAbandon_Failure"); - UtTest_Add(Test_CF_CmdAbandon_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_CmdAbandon_Success"); + UtTest_Add(Test_CF_AbandonCmd_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_AbandonCmd_Failure"); + UtTest_Add(Test_CF_AbandonCmd_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_AbandonCmd_Success"); } void add_CF_DoEnableDisableDequeue_tests(void) @@ -4014,20 +4016,20 @@ void add_CF_DoEnableDisableDequeue_tests(void) cf_cmd_tests_Teardown, "Test_CF_DoEnableDisableDequeue_Set_chan_num_EnabledFlagTo_context_barg"); } -void add_CF_CmdEnableDequeue_tests(void) +void add_CF_EnableDequeueCmd_tests(void) { - UtTest_Add(Test_CF_CmdEnableDequeue_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdEnableDequeue_Success"); - UtTest_Add(Test_CF_CmdEnableDequeue_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdEnableDequeue_Failure"); + UtTest_Add(Test_CF_EnableDequeueCmd_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_EnableDequeueCmd_Success"); + UtTest_Add(Test_CF_EnableDequeueCmd_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_EnableDequeueCmd_Failure"); } -void add_CF_CmdDisableDequeue_tests(void) +void add_CF_DisableDequeueCmd_tests(void) { - UtTest_Add(Test_CF_CmdDisableDequeue_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdDisableDequeue_Success"); - UtTest_Add(Test_CF_CmdDisableDequeue_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdDisableDequeue_Failure"); + UtTest_Add(Test_CF_DisableDequeueCmd_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_DisableDequeueCmd_Success"); + UtTest_Add(Test_CF_DisableDequeueCmd_Failure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_DisableDequeueCmd_Failure"); } void add_CF_DoEnableDisablePolldir_tests(void) @@ -4046,20 +4048,20 @@ void add_CF_DoEnableDisablePolldir_tests(void) "Test_CF_DoEnableDisablePolldir_FailAnyBadPolldirSendEvent"); } -void add_CF_CmdEnablePolldir_tests(void) +void add_CF_EnablePolldirCmd_tests(void) { - UtTest_Add(Test_CF_CmdEnablePolldir_SuccessWhenActionSuccess, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdEnablePolldir_SuccessWhenActionSuccess"); - UtTest_Add(Test_CF_CmdEnablePolldir_FailWhenActionFail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdEnablePolldir_FailWhenActionFail"); + UtTest_Add(Test_CF_EnablePolldirCmd_SuccessWhenActionSuccess, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_EnablePolldirCmd_SuccessWhenActionSuccess"); + UtTest_Add(Test_CF_EnablePolldirCmd_FailWhenActionFail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_EnablePolldirCmd_FailWhenActionFail"); } -void add_CF_CmdDisablePolldir_tests(void) +void add_CF_DisablePolldirCmd_tests(void) { - UtTest_Add(Test_CF_CmdDisablePolldir_SuccessWhenActionSuccess, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdDisablePolldir_SuccessWhenActionSuccess"); - UtTest_Add(Test_CF_CmdDisablePolldir_FailWhenActionFail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdDisablePolldir_FailWhenActionFail"); + UtTest_Add(Test_CF_DisablePolldirCmd_SuccessWhenActionSuccess, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_DisablePolldirCmd_SuccessWhenActionSuccess"); + UtTest_Add(Test_CF_DisablePolldirCmd_FailWhenActionFail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_DisablePolldirCmd_FailWhenActionFail"); } void add_CF_PurgeHistory_tests(void) @@ -4087,154 +4089,154 @@ void add_CF_DoPurgeQueue_tests(void) cf_cmd_tests_Teardown, "Test_CF_DoPurgeQueue_AnyGivenBad_data_byte_1_SendEventAndReturn_neg1"); } -void add_CF_CmdPurgeQueue_tests(void) +void add_CF_PurgeQueueCmd_tests(void) { - UtTest_Add(Test_CF_CmdPurgeQueue_FailWhenActionFail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdPurgeQueue_FailWhenActionFail"); - UtTest_Add(Test_CF_CmdPurgeQueue_SuccessWhenActionSuccess, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdPurgeQueue_SuccessWhenActionSuccess"); + UtTest_Add(Test_CF_PurgeQueueCmd_FailWhenActionFail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_PurgeQueueCmd_FailWhenActionFail"); + UtTest_Add(Test_CF_PurgeQueueCmd_SuccessWhenActionSuccess, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_PurgeQueueCmd_SuccessWhenActionSuccess"); } -void add_CF_CmdWriteQueue_tests(void) +void add_CF_WriteQueueCmd_tests(void) { - UtTest_Add(Test_CF_CmdWriteQueue_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectCommand, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdWriteQueue_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectCommand"); - UtTest_Add(Test_CF_CmdWriteQueue_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRejectCommand, + UtTest_Add(Test_CF_WriteQueueCmd_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectCommand, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_WriteQueueCmd_When_chan_Eq_CF_NUM_CAHNNELS_SendEventAndRejectCommand"); + UtTest_Add(Test_CF_WriteQueueCmd_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRejectCommand"); - UtTest_Add(Test_CF_CmdWriteQueue_WhenUpAndPendingQueueSendEventAndRejectCommand, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdWriteQueue_WhenUpAndPendingQueueSendEventAndRejectCommand"); + "Test_CF_WriteQueueCmd_When_chan_GreaterThan_CF_NUM_CAHNNELS_SendEventAndRejectCommand"); + UtTest_Add(Test_CF_WriteQueueCmd_WhenUpAndPendingQueueSendEventAndRejectCommand, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_WriteQueueCmd_WhenUpAndPendingQueueSendEventAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_IsNot_q_pend_SendEventAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_IsNot_q_pend_SendEventAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_IsNot_q_pend_" + "Test_CF_WriteQueueCmd_When_CF_WrappedCreat_Fails_type_Is_type_up_And_queue_IsNot_q_pend_" "SendEventAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_queue_Is_q_pend_SendEventAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_queue_Is_q_pend_SendEventAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_queue_Is_q_pend_" + "Test_CF_WriteQueueCmd_When_CF_WrappedCreat_Fails_type_IsNot_type_up_And_queue_Is_q_pend_" "SendEventAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedClose_SendEventCloseAndRejectCommandWhen_CF_WriteTxnQueueDataToFile_Fails, + Test_CF_WriteQueueCmd_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedClose_SendEventCloseAndRejectCommandWhen_CF_WriteTxnQueueDataToFile_Fails, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedClose_" + "Test_CF_WriteQueueCmd_When_wq_IsAllAnd_queue_IsAll_fd_Is_0_Call_CF_WrappedClose_" "SendEventCloseAndRejectCommandWhen_CF_WriteTxnQueueDataToFile_Fails"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventClosesAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventClosesAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsActive_fd_IsPositive_Call_" + "Test_CF_WriteQueueCmd_When_CF_WriteTxnQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsActive_fd_IsPositive_Call_" "CF_" "WrappedClose_SendEventClosesAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsHistory_fd_IsPositive_" + "Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsUpAnd_queue_IsHistory_fd_IsPositive_" "Call_CF_WrappedClose_SendEventCloseAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq_IsDownAnd_queue_IsActive_fd_" + "Test_CF_WriteQueueCmd_When_CF_WriteHistoryDataToFile_FailsOnFirstCallAnd_wq_IsDownAnd_queue_IsActive_fd_" "IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_wq_IsDownAnd_queue_IsActive_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_wq_IsDownAnd_queue_IsActive_fd_" + "Test_CF_WriteQueueCmd_When_CF_WriteHistoryDataToFile_FailsOnSecondCallAnd_wq_IsDownAnd_queue_IsActive_fd_" "IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsPend_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsPend_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsPend_fd_IsPositive_" + "Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsPend_fd_IsPositive_" "Call_CF_WrappedClose_SendEventCloseAndRejectCommand"); UtTest_Add( - Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, + Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsHistory_fd_IsPositive_Call_CF_WrappedClose_SendEventCloseAndRejectCommand, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsHistory_fd_IsPositive_" + "Test_CF_WriteQueueCmd_When_CF_WriteHistoryQueueDataToFile_FailsAnd_wq_IsDownAnd_queue_IsHistory_fd_IsPositive_" "Call_CF_WrappedClose_SendEventCloseAndRejectCommand"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_AllAnd_q_All, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_AllAnd_q_All"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_AllAnd_q_History, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_AllAnd_q_History"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Active, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Active"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Pend, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_AllAnd_q_Pend"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_UpAnd_q_All, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_UpAnd_q_All"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_UpAnd_q_History, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_UpAnd_q_History"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_UpAnd_q_Active, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_UpAnd_q_Active"); - /* see Test_CF_CmdWriteQueue_WhenUpAndPendingQueueSendEventAndRejectCommand */ - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_DownAnd_q_All, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_DownAnd_q_All"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_DownAnd_q_History, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_DownAnd_q_History"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Active, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Active"); - UtTest_Add(Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Pend, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdWriteQueue_Success_type_DownAnd_q_Pend"); -} - -void add_CF_CmdValidateChunkSize_tests(void) -{ - UtTest_Add(Test_CF_CmdValidateChunkSize_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdValidateChunkSize_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1"); - UtTest_Add(Test_CF_CmdValidateChunkSize_Any_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdValidateChunkSize_Any_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1"); - UtTest_Add(Test_CF_CmdValidateChunkSize_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdValidateChunkSize_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0"); - UtTest_Add(Test_CF_CmdValidateChunkSize_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAndReturn_0, cf_cmd_tests_Setup, + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_AllAnd_q_All, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_AllAnd_q_All"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_AllAnd_q_History, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_AllAnd_q_History"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_AllAnd_q_Active, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_AllAnd_q_Active"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_AllAnd_q_Pend, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_AllAnd_q_Pend"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_UpAnd_q_All, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_UpAnd_q_All"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_UpAnd_q_History, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_UpAnd_q_History"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_UpAnd_q_Active, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_UpAnd_q_Active"); + /* see Test_CF_WriteQueueCmd_WhenUpAndPendingQueueSendEventAndRejectCommand */ + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_DownAnd_q_All, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_DownAnd_q_All"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_DownAnd_q_History, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_DownAnd_q_History"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_DownAnd_q_Active, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_DownAnd_q_Active"); + UtTest_Add(Test_CF_WriteQueueCmd_Success_type_DownAnd_q_Pend, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, + "Test_CF_WriteQueueCmd_Success_type_DownAnd_q_Pend"); +} + +void add_CF_ValidateChunkSizeCmd_tests(void) +{ + UtTest_Add(Test_CF_ValidateChunkSizeCmd_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_ValidateChunkSizeCmd_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1"); + UtTest_Add(Test_CF_ValidateChunkSizeCmd_Any_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_ValidateChunkSizeCmd_Any_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1"); + UtTest_Add(Test_CF_ValidateChunkSizeCmd_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_ValidateChunkSizeCmd_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0"); + UtTest_Add(Test_CF_ValidateChunkSizeCmd_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAndReturn_0, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdValidateChunkSize_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAndReturn_0"); + "Test_CF_ValidateChunkSizeCmd_val_LessThanOrEqSizeOf_pdu_fd_data_t_SuccessAndReturn_0"); } -void add_CF_CmdValidateMaxOutgoing_tests(void) +void add_CF_ValidateMaxOutgoingCmd_tests(void) { - UtTest_Add(Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_IsNot_0_Return_0_Success, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_IsNot_0_Return_0_Success"); - UtTest_Add(Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_Return_0_Success, + UtTest_Add(Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_IsNot_0_Return_0_Success, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_IsNot_0_Return_0_Success"); + UtTest_Add(Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_Return_0_Success, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_Return_0_Success"); - UtTest_Add(Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Return_1_Fail, cf_cmd_tests_Setup, + "Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_Is_0_But_sem_name_IsNot_NULL_Return_0_Success"); + UtTest_Add(Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Return_1_Fail, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Return_1_Fail"); + "Test_CF_ValidateMaxOutgoingCmd_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Return_1_Fail"); } -void add_CF_CmdGetSetParam_tests(void) +void add_CF_GetSetParamCmd_tests(void) { - UtTest_Add(Test_CF_CmdGetSetParam, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_CmdGetSetParam"); + UtTest_Add(Test_CF_GetSetParamCmd, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "CF_GetSetParamCmd"); } -void add_CF_CmdSetParam_tests(void) +void add_CF_SetParamCmd_tests(void) { - UtTest_Add(Test_CF_CmdSetParam_Call_CF_CmdGetSetParam_With_cmd_key_And_cmd_value, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdSetParam_Call_CF_CmdGetSetParam_With_cmd_key_And_cmd_value"); + UtTest_Add(Test_CF_SetParamCmd_Call_CF_GetSetParamCmd_With_cmd_key_And_cmd_value, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_SetParamCmd_Call_CF_GetSetParamCmd_With_cmd_key_And_cmd_value"); } -void add_CF_CmdGetParam_tests(void) +void add_CF_GetParamCmd_tests(void) { - UtTest_Add(Test_CF_CmdGetParam_Call_CF_CmdGetSetParam_With_cmd_data_byte_0_AndConstantValue_0, cf_cmd_tests_Setup, + UtTest_Add(Test_CF_GetParamCmd_Call_CF_GetSetParamCmd_With_cmd_data_byte_0_AndConstantValue_0, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdGetParam_Call_CF_CmdGetSetParam_With_cmd_data_byte_0_AndConstantValue_0"); + "Test_CF_GetParamCmd_Call_CF_GetSetParamCmd_With_cmd_data_byte_0_AndConstantValue_0"); } -void add_CF_CmdEnableEngine_tests(void) +void add_CF_EnableEngineCmd_tests(void) { - UtTest_Add(Test_CF_CmdEnableEngine_WithEngineNotEnableInitSuccessAndIncrementCmdCounter, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdEnableEngine_WithEngineNotEnableInitSuccessAndIncrementCmdCounter"); - UtTest_Add(Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter, cf_cmd_tests_Setup, + UtTest_Add(Test_CF_EnableEngineCmd_WithEngineNotEnableInitSuccessAndIncrementCmdCounter, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_EnableEngineCmd_WithEngineNotEnableInitSuccessAndIncrementCmdCounter"); + UtTest_Add(Test_CF_EnableEngineCmd_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, - "Test_CF_CmdEnableEngine_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter"); - UtTest_Add(Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounter, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdEnableEngine_WithEngineEnableFailsSendEventAndIncrementErrCounter"); + "Test_CF_EnableEngineCmd_WithEngineNotEnableFailsInitSendEventAndIncrementErrCounter"); + UtTest_Add(Test_CF_EnableEngineCmd_WithEngineEnableFailsSendEventAndIncrementErrCounter, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_EnableEngineCmd_WithEngineEnableFailsSendEventAndIncrementErrCounter"); } -void add_CF_CmdDisableEngine_tests(void) +void add_CF_DisableEngineCmd_tests(void) { - UtTest_Add(Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdDisableEngine_SuccessWhenEngineEnabledAndIncrementCmdCounter"); - UtTest_Add(Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_CmdDisableEngine_WhenEngineDisabledAndIncrementErrCounterThenFail"); + UtTest_Add(Test_CF_DisableEngineCmd_SuccessWhenEngineEnabledAndIncrementCmdCounter, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_DisableEngineCmd_SuccessWhenEngineEnabledAndIncrementCmdCounter"); + UtTest_Add(Test_CF_DisableEngineCmd_WhenEngineDisabledAndIncrementErrCounterThenFail, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_DisableEngineCmd_WhenEngineDisabledAndIncrementErrCounterThenFail"); } void add_CF_ProcessGroundCommand_tests(void) @@ -4248,8 +4250,8 @@ void add_CF_ProcessGroundCommand_tests(void) Test_CF_ProcessGroundCommand_Receives_cmd_AndLengthDoesNotMatchExpectedForThatCommandSendEventAndFailure, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_ProcessGroundCommand_Receives_cmd_AndLengthDoesNotMatchExpectedForThatCommandSendEventAndFailure"); - UtTest_Add(Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_CmdNoop_With_msg, cf_cmd_tests_Setup, - cf_cmd_tests_Teardown, "Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_CmdNoop_With_msg"); + UtTest_Add(Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_NoopCmd_With_msg, cf_cmd_tests_Setup, + cf_cmd_tests_Teardown, "Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x00_AndCall_CF_NoopCmd_With_msg"); UtTest_Add(Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x0C_AndDoNothingBecause_fns_12_Is_NULL, cf_cmd_tests_Setup, cf_cmd_tests_Teardown, "Test_CF_ProcessGroundCommand_ReceivesCmdCode_0x0C_AndDoNothingBecause_fns_12_Is_NULL"); @@ -4265,21 +4267,21 @@ void UtTest_Setup(void) { TestUtil_InitializeRandomSeed(); - add_CF_CmdNoop_tests(); + add_CF_NoopCmd_tests(); - add_CF_CmdReset_tests(); + add_CF_ResetCountersCmd_tests(); - add_CF_CmdTxFile_tests(); + add_CF_TxFileCmd_tests(); - add_CF_CmdPlaybackDir_tests(); + add_CF_PlaybackDirCmd_tests(); add_CF_DoChanAction_tests(); add_CF_DoFreezeThaw_tests(); - add_CF_CmdFreeze_tests(); + add_CF_FreezeCmd_tests(); - add_CF_CmdThaw_tests(); + add_CF_ThawCmd_tests(); add_CF_FindTransactionBySequenceNumberAllChannels_tests(); @@ -4289,29 +4291,29 @@ void UtTest_Setup(void) add_CF_DoSuspRes_tests(); - add_CF_CmdSuspend_tests(); + add_CF_SuspendCmd_tests(); - add_CF_CmdResume_tests(); + add_CF_ResumeCmd_tests(); - add_CF_CmdCancel_Txn_tests(); + add_CF_Cancel_TxnCmd_tests(); - add_CF_CmdCancel_tests(); + add_CF_CancelCmd_tests(); - add_CF_CmdAbandon_Txn_tests(); + add_CF_Abandon_TxnCmd_tests(); - add_CF_CmdAbandon_tests(); + add_CF_AbandonCmd_tests(); add_CF_DoEnableDisableDequeue_tests(); - add_CF_CmdEnableDequeue_tests(); + add_CF_EnableDequeueCmd_tests(); - add_CF_CmdDisableDequeue_tests(); + add_CF_DisableDequeueCmd_tests(); add_CF_DoEnableDisablePolldir_tests(); - add_CF_CmdEnablePolldir_tests(); + add_CF_EnablePolldirCmd_tests(); - add_CF_CmdDisablePolldir_tests(); + add_CF_DisablePolldirCmd_tests(); add_CF_PurgeHistory_tests(); @@ -4319,23 +4321,23 @@ void UtTest_Setup(void) add_CF_DoPurgeQueue_tests(); - add_CF_CmdPurgeQueue_tests(); + add_CF_PurgeQueueCmd_tests(); - add_CF_CmdWriteQueue_tests(); + add_CF_WriteQueueCmd_tests(); - add_CF_CmdValidateChunkSize_tests(); + add_CF_ValidateChunkSizeCmd_tests(); - add_CF_CmdValidateMaxOutgoing_tests(); + add_CF_ValidateMaxOutgoingCmd_tests(); - add_CF_CmdGetSetParam_tests(); + add_CF_GetSetParamCmd_tests(); - add_CF_CmdSetParam_tests(); + add_CF_SetParamCmd_tests(); - add_CF_CmdGetParam_tests(); + add_CF_GetParamCmd_tests(); - add_CF_CmdEnableEngine_tests(); + add_CF_EnableEngineCmd_tests(); - add_CF_CmdDisableEngine_tests(); + add_CF_DisableEngineCmd_tests(); add_CF_ProcessGroundCommand_tests(); } diff --git a/unit-test/cf_utils_tests.c b/unit-test/cf_utils_tests.c index 6707fc45..42925397 100644 --- a/unit-test/cf_utils_tests.c +++ b/unit-test/cf_utils_tests.c @@ -316,7 +316,7 @@ void Test_cf_move_transaction_Call_CF_CList_InsertBack_AndSet_q_index_ToGiven_q( expected_insert_back_head = &CF_AppData.engine.channels[arg_t->chan_num].qs[arg_q]; expected_insert_back_node = &arg_t->cl_node; - /* Queue size needes to be >= 1 */ + /* Queue size needs to be >= 1 */ CF_AppData.hk.Payload.channel_hk[arg_t->chan_num].q_size[arg_t->flags.com.q_index] = 1; /* Act */ diff --git a/unit-test/stubs/cf_app_stubs.c b/unit-test/stubs/cf_app_stubs.c index bceb5843..414cad87 100644 --- a/unit-test/stubs/cf_app_stubs.c +++ b/unit-test/stubs/cf_app_stubs.c @@ -61,16 +61,16 @@ void CF_HkCmd(void) /* * ---------------------------------------------------- - * Generated stub function for CF_Init() + * Generated stub function for CF_AppInit() * ---------------------------------------------------- */ -CFE_Status_t CF_Init(void) +CFE_Status_t CF_AppInit(void) { - UT_GenStub_SetupReturnBuffer(CF_Init, CFE_Status_t); + UT_GenStub_SetupReturnBuffer(CF_AppInit, CFE_Status_t); - UT_GenStub_Execute(CF_Init, Basic, NULL); + UT_GenStub_Execute(CF_AppInit, Basic, NULL); - return UT_GenStub_GetReturnValue(CF_Init, CFE_Status_t); + return UT_GenStub_GetReturnValue(CF_AppInit, CFE_Status_t); } /* @@ -78,9 +78,9 @@ CFE_Status_t CF_Init(void) * Generated stub function for CF_ProcessMsg() * ---------------------------------------------------- */ -void CF_ProcessMsg(CFE_SB_Buffer_t *msg) +void CF_ProcessMsg(CFE_SB_Buffer_t *BufPtr) { - UT_GenStub_AddParam(CF_ProcessMsg, CFE_SB_Buffer_t *, msg); + UT_GenStub_AddParam(CF_ProcessMsg, CFE_SB_Buffer_t *, BufPtr); UT_GenStub_Execute(CF_ProcessMsg, Basic, NULL); } diff --git a/unit-test/stubs/cf_cmd_handlers.c b/unit-test/stubs/cf_cmd_handlers.c index e8cacef4..819315b1 100644 --- a/unit-test/stubs/cf_cmd_handlers.c +++ b/unit-test/stubs/cf_cmd_handlers.c @@ -46,6 +46,6 @@ void UT_DefaultHandler_CF_ProcessGroundCommand(void *UserObj, UT_EntryKey_t Func if (ctxt) { - *ctxt = UT_Hook_GetArgValueByName(Context, "msg", CFE_SB_Buffer_t *); + *ctxt = UT_Hook_GetArgValueByName(Context, "BufPtr", CFE_SB_Buffer_t *); } } diff --git a/unit-test/stubs/cf_cmd_stubs.c b/unit-test/stubs/cf_cmd_stubs.c index 48cbf833..8ce70fba 100644 --- a/unit-test/stubs/cf_cmd_stubs.c +++ b/unit-test/stubs/cf_cmd_stubs.c @@ -54,62 +54,62 @@ void CF_CancelCmd(const CF_CancelCmd_t *msg) /* * ---------------------------------------------------- - * Generated stub function for CF_CmdAbandon_Txn() + * Generated stub function for CF_Abandon_TxnCmd() * ---------------------------------------------------- */ -void CF_CmdAbandon_Txn(CF_Transaction_t *txn, void *ignored) +void CF_Abandon_TxnCmd(CF_Transaction_t *txn, void *ignored) { - UT_GenStub_AddParam(CF_CmdAbandon_Txn, CF_Transaction_t *, txn); - UT_GenStub_AddParam(CF_CmdAbandon_Txn, void *, ignored); + UT_GenStub_AddParam(CF_Abandon_TxnCmd, CF_Transaction_t *, txn); + UT_GenStub_AddParam(CF_Abandon_TxnCmd, void *, ignored); - UT_GenStub_Execute(CF_CmdAbandon_Txn, Basic, NULL); + UT_GenStub_Execute(CF_Abandon_TxnCmd, Basic, NULL); } /* * ---------------------------------------------------- - * Generated stub function for CF_CmdCancel_Txn() + * Generated stub function for CF_Cancel_TxnCmd() * ---------------------------------------------------- */ -void CF_CmdCancel_Txn(CF_Transaction_t *txn, void *ignored) +void CF_Cancel_TxnCmd(CF_Transaction_t *txn, void *ignored) { - UT_GenStub_AddParam(CF_CmdCancel_Txn, CF_Transaction_t *, txn); - UT_GenStub_AddParam(CF_CmdCancel_Txn, void *, ignored); + UT_GenStub_AddParam(CF_Cancel_TxnCmd, CF_Transaction_t *, txn); + UT_GenStub_AddParam(CF_Cancel_TxnCmd, void *, ignored); - UT_GenStub_Execute(CF_CmdCancel_Txn, Basic, NULL); + UT_GenStub_Execute(CF_Cancel_TxnCmd, Basic, NULL); } /* * ---------------------------------------------------- - * Generated stub function for CF_CmdValidateChunkSize() + * Generated stub function for CF_ValidateChunkSizeCmd() * ---------------------------------------------------- */ -CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num) +CFE_Status_t CF_ValidateChunkSizeCmd(uint32 val, uint8 chan_num) { - UT_GenStub_SetupReturnBuffer(CF_CmdValidateChunkSize, CFE_Status_t); + UT_GenStub_SetupReturnBuffer(CF_ValidateChunkSizeCmd, CFE_Status_t); - UT_GenStub_AddParam(CF_CmdValidateChunkSize, uint32, val); - UT_GenStub_AddParam(CF_CmdValidateChunkSize, uint8, chan_num); + UT_GenStub_AddParam(CF_ValidateChunkSizeCmd, uint32, val); + UT_GenStub_AddParam(CF_ValidateChunkSizeCmd, uint8, chan_num); - UT_GenStub_Execute(CF_CmdValidateChunkSize, Basic, NULL); + UT_GenStub_Execute(CF_ValidateChunkSizeCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(CF_CmdValidateChunkSize, CFE_Status_t); + return UT_GenStub_GetReturnValue(CF_ValidateChunkSizeCmd, CFE_Status_t); } /* * ---------------------------------------------------- - * Generated stub function for CF_CmdValidateMaxOutgoing() + * Generated stub function for CF_ValidateMaxOutgoingCmd() * ---------------------------------------------------- */ -CFE_Status_t CF_CmdValidateMaxOutgoing(uint32 val, uint8 chan_num) +CFE_Status_t CF_ValidateMaxOutgoingCmd(uint32 val, uint8 chan_num) { - UT_GenStub_SetupReturnBuffer(CF_CmdValidateMaxOutgoing, CFE_Status_t); + UT_GenStub_SetupReturnBuffer(CF_ValidateMaxOutgoingCmd, CFE_Status_t); - UT_GenStub_AddParam(CF_CmdValidateMaxOutgoing, uint32, val); - UT_GenStub_AddParam(CF_CmdValidateMaxOutgoing, uint8, chan_num); + UT_GenStub_AddParam(CF_ValidateMaxOutgoingCmd, uint32, val); + UT_GenStub_AddParam(CF_ValidateMaxOutgoingCmd, uint8, chan_num); - UT_GenStub_Execute(CF_CmdValidateMaxOutgoing, Basic, NULL); + UT_GenStub_Execute(CF_ValidateMaxOutgoingCmd, Basic, NULL); - return UT_GenStub_GetReturnValue(CF_CmdValidateMaxOutgoing, CFE_Status_t); + return UT_GenStub_GetReturnValue(CF_ValidateMaxOutgoingCmd, CFE_Status_t); } /* @@ -438,14 +438,14 @@ CFE_Status_t CF_PurgeTransaction(CF_CListNode_t *node, void *ignored) /* * ---------------------------------------------------- - * Generated stub function for CF_ResetCmd() + * Generated stub function for CF_ResetCountersCmd() * ---------------------------------------------------- */ -void CF_ResetCmd(const CF_ResetCmd_t *msg) +void CF_ResetCountersCmd(const CF_ResetCountersCmd_t *msg) { - UT_GenStub_AddParam(CF_ResetCmd, const CF_ResetCmd_t *, msg); + UT_GenStub_AddParam(CF_ResetCountersCmd, const CF_ResetCountersCmd_t *, msg); - UT_GenStub_Execute(CF_ResetCmd, Basic, NULL); + UT_GenStub_Execute(CF_ResetCountersCmd, Basic, NULL); } /* diff --git a/unit-test/utilities/cf_test_alt_handler.c b/unit-test/utilities/cf_test_alt_handler.c index 4852caa9..c435360f 100644 --- a/unit-test/utilities/cf_test_alt_handler.c +++ b/unit-test/utilities/cf_test_alt_handler.c @@ -19,7 +19,6 @@ #include #include -#include /* UT includes */ #include "uttest.h"