diff --git a/fsw/src/cf_cmd.c b/fsw/src/cf_cmd.c index f7fe592b..c7f31b99 100644 --- a/fsw/src/cf_cmd.c +++ b/fsw/src/cf_cmd.c @@ -981,7 +981,7 @@ CF_ChanAction_Status_t CF_CmdValidateMaxOutgoing(uint32 val, uint8 chan_num) * See description in cf_cmd.h for argument/return detail * *-----------------------------------------------------------------*/ -void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num) +void CF_GetSetParamCmd(bool is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num) { CF_ConfigTable_t *config; CFE_Status_t status = CF_ERROR; @@ -1140,7 +1140,7 @@ CFE_Status_t CF_SetParamCmd(const CF_SetParamCmd_t *msg) { const CF_SetParam_Payload_t *cmd = &msg->Payload; - CF_GetSetParamCmd(1, cmd->key, cmd->value, cmd->chan_num); + CF_GetSetParamCmd(true, cmd->key, cmd->value, cmd->chan_num); return CFE_SUCCESS; } @@ -1155,7 +1155,7 @@ CFE_Status_t CF_GetParamCmd(const CF_GetParamCmd_t *msg) { const CF_GetParam_Payload_t *cmd = &msg->Payload; - CF_GetSetParamCmd(0, cmd->key, 0, cmd->chan_num); + CF_GetSetParamCmd(false, cmd->key, 0, cmd->chan_num); return CFE_SUCCESS; } diff --git a/fsw/src/cf_cmd.h b/fsw/src/cf_cmd.h index 59fa9395..5aa387ed 100644 --- a/fsw/src/cf_cmd.h +++ b/fsw/src/cf_cmd.h @@ -554,13 +554,13 @@ CF_ChanAction_Status_t CF_CmdValidateMaxOutgoing(uint32 val, uint8 chan_num); * @par Assumptions, External Events, and Notes: * None * - * @param is_set Whether to get (0) or set (1) + * @param is_set Whether to get (false) or set (true) * @param param_id Parameter ID * @param value Value to get/set * @param chan_num Channel number to operate on * */ -void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num); +void CF_GetSetParamCmd(bool is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num); /************************************************************************/ /** @brief Ground command to set a configuration parameter. diff --git a/unit-test/cf_cmd_tests.c b/unit-test/cf_cmd_tests.c index c04f5b13..a4ca928b 100644 --- a/unit-test/cf_cmd_tests.c +++ b/unit-test/cf_cmd_tests.c @@ -3421,7 +3421,7 @@ void Test_CF_CmdValidateMaxOutgoing_WhenGiven_val_Is_0_And_sem_name_Is_NULL_Retu void Test_CF_CmdGetSetParam(void) { /* Test cases for: - * void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num); + * void CF_GetSetParamCmd(bool is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num); */ /* Arrange */ @@ -3438,7 +3438,7 @@ void Test_CF_CmdGetSetParam(void) for (param_id = 0; param_id < CF_GetSet_ValueID_MAX; ++param_id) { UT_CF_ResetEventCapture(); - UtAssert_VOIDCALL(CF_GetSetParamCmd(1, param_id, 1 + param_id, UT_CFDP_CHANNEL)); + UtAssert_VOIDCALL(CF_GetSetParamCmd(true, param_id, 1 + param_id, UT_CFDP_CHANNEL)); UT_CF_AssertEventID(CF_EID_INF_CMD_GETSET1); UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, ++expected_count); } @@ -3459,26 +3459,26 @@ void Test_CF_CmdGetSetParam(void) for (param_id = 0; param_id < CF_GetSet_ValueID_MAX; ++param_id) { UT_CF_ResetEventCapture(); - UtAssert_VOIDCALL(CF_GetSetParamCmd(0, param_id, 1, UT_CFDP_CHANNEL)); + UtAssert_VOIDCALL(CF_GetSetParamCmd(false, param_id, 1, UT_CFDP_CHANNEL)); UT_CF_AssertEventID(CF_EID_INF_CMD_GETSET2); UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.cmd, ++expected_count); } /* Bad param ID */ UT_CF_ResetEventCapture(); - UtAssert_VOIDCALL(CF_GetSetParamCmd(0, CF_GetSet_ValueID_MAX, 0, UT_CFDP_CHANNEL)); + UtAssert_VOIDCALL(CF_GetSetParamCmd(false, CF_GetSet_ValueID_MAX, 0, UT_CFDP_CHANNEL)); UT_CF_AssertEventID(CF_EID_ERR_CMD_GETSET_PARAM); UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, 1); /* Bad channel ID */ UT_CF_ResetEventCapture(); - UtAssert_VOIDCALL(CF_GetSetParamCmd(0, 0, 0, CF_NUM_CHANNELS + 1)); + UtAssert_VOIDCALL(CF_GetSetParamCmd(false, 0, 0, CF_NUM_CHANNELS + 1)); UT_CF_AssertEventID(CF_EID_ERR_CMD_GETSET_CHAN); UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, 2); /* Validation fail */ UT_CF_ResetEventCapture(); - UtAssert_VOIDCALL(CF_GetSetParamCmd(1, CF_GetSet_ValueID_outgoing_file_chunk_size, + UtAssert_VOIDCALL(CF_GetSetParamCmd(true, CF_GetSet_ValueID_outgoing_file_chunk_size, 100 + sizeof(CF_CFDP_PduFileDataContent_t), UT_CFDP_CHANNEL)); UT_CF_AssertEventID(CF_EID_ERR_CMD_GETSET_VALIDATE); UtAssert_UINT32_EQ(CF_AppData.hk.Payload.counters.err, 3); diff --git a/unit-test/stubs/cf_cmd_stubs.c b/unit-test/stubs/cf_cmd_stubs.c index ab750404..8595e24a 100644 --- a/unit-test/stubs/cf_cmd_stubs.c +++ b/unit-test/stubs/cf_cmd_stubs.c @@ -382,9 +382,9 @@ CFE_Status_t CF_GetParamCmd(const CF_GetParamCmd_t *msg) * Generated stub function for CF_GetSetParamCmd() * ---------------------------------------------------- */ -void CF_GetSetParamCmd(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num) +void CF_GetSetParamCmd(bool is_set, CF_GetSet_ValueID_t param_id, uint32 value, uint8 chan_num) { - UT_GenStub_AddParam(CF_GetSetParamCmd, uint8, is_set); + UT_GenStub_AddParam(CF_GetSetParamCmd, bool, is_set); UT_GenStub_AddParam(CF_GetSetParamCmd, CF_GetSet_ValueID_t, param_id); UT_GenStub_AddParam(CF_GetSetParamCmd, uint32, value); UT_GenStub_AddParam(CF_GetSetParamCmd, uint8, chan_num);