diff --git a/unit-test/cs_eeprom_cmds_tests.c b/unit-test/cs_eeprom_cmds_tests.c index 6eec205..582fa20 100644 --- a/unit-test/cs_eeprom_cmds_tests.c +++ b/unit-test/cs_eeprom_cmds_tests.c @@ -1,1064 +1,1064 @@ - /************************************************************************ - * NASA Docket No. GSC-18,915-1, and identified as “cFS Checksum - * Application version 2.5.1” - * - * Copyright (c) 2021 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ************************************************************************/ +/************************************************************************ + * NASA Docket No. GSC-18,915-1, and identified as “cFS Checksum + * Application version 2.5.1” + * + * Copyright (c) 2021 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ - /* - * Includes - */ +/* + * Includes + */ - #include "cs_eeprom_cmds.h" - #include "cs_msg.h" - #include "cs_msgdefs.h" - #include "cs_events.h" - #include "cs_version.h" - #include "cs_utils.h" - #include "cs_test_utils.h" - #include - #include +#include "cs_eeprom_cmds.h" +#include "cs_msg.h" +#include "cs_msgdefs.h" +#include "cs_events.h" +#include "cs_version.h" +#include "cs_utils.h" +#include "cs_test_utils.h" +#include +#include - /* UT includes */ - #include "uttest.h" - #include "utassert.h" - #include "utstubs.h" +/* UT includes */ +#include "uttest.h" +#include "utassert.h" +#include "utstubs.h" - /* cs_eeprom_cmds_tests globals */ - uint8 call_count_CFE_EVS_SendEvent; +/* cs_eeprom_cmds_tests globals */ +uint8 call_count_CFE_EVS_SendEvent; - /* - * Function Definitions - */ +/* + * Function Definitions + */ - void CS_DisableEepromCmd_Test(void) - { - CS_NoArgsCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_DisableEepromCmd_Test(void) +{ + CS_NoArgsCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Checksumming of EEPROM is Disabled"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Checksumming of EEPROM is Disabled"); - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_DisableEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_DISABLED, - "CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_DISABLED"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_DISABLED, + "CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_DISABLED"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_DisableEepromCmd_Test_OneShot(void) - { - CS_NoArgsCmd_t CmdPacket; +void CS_DisableEepromCmd_Test_OneShot(void) +{ + CS_NoArgsCmd_t CmdPacket; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); - /* Execute the function being tested */ - CS_DisableEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEepromCmd_Test(void) - { - CS_NoArgsCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_EnableEepromCmd_Test(void) +{ + CS_NoArgsCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Checksumming of EEPROM is Enabled"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Checksumming of EEPROM is Enabled"); - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_EnableEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_ENABLED, - "CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_ENABLED"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_ENABLED, + "CS_AppData.HkPacket.Payload.EepromCSState == CS_STATE_ENABLED"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEepromCmd_Test_OneShot(void) - { - CS_NoArgsCmd_t CmdPacket; +void CS_EnableEepromCmd_Test_OneShot(void) +{ + CS_NoArgsCmd_t CmdPacket; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); - /* Execute the function being tested */ - CS_EnableEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", + call_count_CFE_EVS_SendEvent); +} - void CS_ReportBaselineEntryIDEepromCmd_Test_Computed(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_ReportBaselineEntryIDEepromCmd_Test_Computed(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Report baseline of EEPROM Entry %%d is 0x%%08X"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Report baseline of EEPROM Entry %%d is 0x%%08X"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComputedYet = true; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComparisonValue = 1; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComputedYet = true; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComparisonValue = 1; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_BASELINE_EEPROM_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_BASELINE_EEPROM_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_ReportBaselineEntryIDEepromCmd_Test_NotYetComputed(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_ReportBaselineEntryIDEepromCmd_Test_NotYetComputed(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Report baseline of EEPROM Entry %%d has not been computed yet"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Report baseline of EEPROM Entry %%d has not been computed yet"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComputedYet = false; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComparisonValue = 1; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComputedYet = false; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ComparisonValue = 1; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_NO_BASELINE_EEPROM_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_NO_BASELINE_EEPROM_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "EEPROM report baseline failed, Entry ID invalid: %%d, State: %%d Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "EEPROM report baseline failed, Entry ID invalid: %%d, State: %%d Max ID: %%d"); - CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; + CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_BASELINE_INVALID_ENTRY_EEPROM_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_BASELINE_INVALID_ENTRY_EEPROM_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "EEPROM report baseline failed, Entry ID invalid: %%d, State: %%d Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "EEPROM report baseline failed, Entry ID invalid: %%d, State: %%d Max ID: %%d"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_ReportBaselineEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_BASELINE_INVALID_ENTRY_EEPROM_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_BASELINE_INVALID_ENTRY_EEPROM_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_RecomputeBaselineEepromCmd_Test_Nominal(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_RecomputeBaselineEepromCmd_Test_Nominal(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Recompute baseline of EEPROM Entry ID %%d started"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Recompute baseline of EEPROM Entry ID %%d started"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_RecomputeBaselineEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_RecomputeBaselineEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.RecomputeInProgress == true, "CS_AppData.HkPacket.Payload.RecomputeInProgress == true"); - UtAssert_True(CS_AppData.HkPacket.Payload.OneShotInProgress == false, "CS_AppData.HkPacket.Payload.OneShotInProgress == false"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.RecomputeInProgress == true, "CS_AppData.HkPacket.Payload.RecomputeInProgress == true"); + UtAssert_True(CS_AppData.HkPacket.Payload.OneShotInProgress == false, "CS_AppData.HkPacket.Payload.OneShotInProgress == false"); - UtAssert_True(CS_AppData.ChildTaskTable == CS_EEPROM_TABLE, "CS_AppData.ChildTaskTable == CS_EEPROM_TABLE"); - UtAssert_True(CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID, "CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID"); - UtAssert_True(CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID], - "CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID]"); + UtAssert_True(CS_AppData.ChildTaskTable == CS_EEPROM_TABLE, "CS_AppData.ChildTaskTable == CS_EEPROM_TABLE"); + UtAssert_True(CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID, "CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID"); + UtAssert_True(CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID], + "CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID]"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_STARTED_DBG_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_STARTED_DBG_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_DEBUG); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_RecomputeBaselineEepromCmd_Test_CreateChildTaskError(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_RecomputeBaselineEepromCmd_Test_CreateChildTaskError(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Recompute baseline of EEPROM Entry ID %%d failed, CFE_ES_CreateChildTask returned: 0x%%08X"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Recompute baseline of EEPROM Entry ID %%d failed, CFE_ES_CreateChildTask returned: 0x%%08X"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - /* Set to generate error message CS_RECOMPUTE_EEPROM_CREATE_CHDTASK_ERR_EID */ - UT_SetDeferredRetcode(UT_KEY(CFE_ES_CreateChildTask), 1, -1); + /* Set to generate error message CS_RECOMPUTE_EEPROM_CREATE_CHDTASK_ERR_EID */ + UT_SetDeferredRetcode(UT_KEY(CFE_ES_CreateChildTask), 1, -1); - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_RecomputeBaselineEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_RecomputeBaselineEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.OneShotInProgress == false, "CS_AppData.HkPacket.Payload.OneShotInProgress == false"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.OneShotInProgress == false, "CS_AppData.HkPacket.Payload.OneShotInProgress == false"); - UtAssert_True(CS_AppData.ChildTaskTable == CS_EEPROM_TABLE, "CS_AppData.ChildTaskTable == CS_EEPROM_TABLE"); - UtAssert_True(CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID, "CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID"); - UtAssert_True(CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID], - "CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID]"); + UtAssert_True(CS_AppData.ChildTaskTable == CS_EEPROM_TABLE, "CS_AppData.ChildTaskTable == CS_EEPROM_TABLE"); + UtAssert_True(CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID, "CS_AppData.ChildTaskEntryID == CmdPacket.Payload.EntryID"); + UtAssert_True(CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID], + "CS_AppData.RecomputeEepromMemoryEntryPtr == &CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID]"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_CREATE_CHDTASK_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_CREATE_CHDTASK_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - UtAssert_True(CS_AppData.HkPacket.Payload.RecomputeInProgress == false, "CS_AppData.HkPacket.Payload.RecomputeInProgress == false"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.RecomputeInProgress == false, "CS_AppData.HkPacket.Payload.RecomputeInProgress == false"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "EEPROM recompute baseline of entry failed, Entry ID invalid: %%d, State: %%d, Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "EEPROM recompute baseline of entry failed, Entry ID invalid: %%d, State: %%d, Max ID: %%d"); - CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; + CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_RecomputeBaselineEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_RecomputeBaselineEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_INVALID_ENTRY_EEPROM_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_INVALID_ENTRY_EEPROM_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorStateEmpty(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorStateEmpty(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "EEPROM recompute baseline of entry failed, Entry ID invalid: %%d, State: %%d, Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "EEPROM recompute baseline of entry failed, Entry ID invalid: %%d, State: %%d, Max ID: %%d"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_RecomputeBaselineEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_RecomputeBaselineEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_INVALID_ENTRY_EEPROM_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_INVALID_ENTRY_EEPROM_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_RecomputeBaselineEepromCmd_Test_RecomputeInProgress(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_RecomputeBaselineEepromCmd_Test_RecomputeInProgress(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Recompute baseline of EEPROM Entry ID %%d failed: child task in use"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Recompute baseline of EEPROM Entry ID %%d failed: child task in use"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.HkPacket.Payload.RecomputeInProgress = true; + CS_AppData.HkPacket.Payload.RecomputeInProgress = true; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_RecomputeBaselineEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_RecomputeBaselineEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_CHDTASK_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_CHDTASK_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_RecomputeBaselineEepromCmd_Test_OneShot(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_RecomputeBaselineEepromCmd_Test_OneShot(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Recompute baseline of EEPROM Entry ID %%d failed: child task in use"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Recompute baseline of EEPROM Entry ID %%d failed: child task in use"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.HkPacket.Payload.RecomputeInProgress = false; - CS_AppData.HkPacket.Payload.OneShotInProgress = true; + CS_AppData.HkPacket.Payload.RecomputeInProgress = false; + CS_AppData.HkPacket.Payload.OneShotInProgress = true; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_RecomputeBaselineEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_RecomputeBaselineEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_CHDTASK_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_RECOMPUTE_EEPROM_CHDTASK_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEntryIDEepromCmd_Test_Nominal(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_EnableEntryIDEepromCmd_Test_Nominal(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Checksumming of EEPROM Entry ID %%d is Enabled"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Checksumming of EEPROM Entry ID %%d is Enabled"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_EnableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED"); + /* Verify results */ + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_ENTRY_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_ENTRY_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED, - "CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED"); + UtAssert_True(CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED, + "CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED"); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[2][CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_EnableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[2][CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString[0], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Checksumming of EEPROM Entry ID %%d is Enabled"); + snprintf(ExpectedEventString[0], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Checksumming of EEPROM Entry ID %%d is Enabled"); - snprintf(ExpectedEventString[1], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "CS unable to update EEPROM definition table for entry %%d, State: %%d"); + snprintf(ExpectedEventString[1], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "CS unable to update EEPROM definition table for entry %%d, State: %%d"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_EnableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED"); + /* Verify results */ + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_ENABLED"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_ENTRY_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_ENTRY_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = - strncmp(ExpectedEventString[0], context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = + strncmp(ExpectedEventString[0], context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, CS_ENABLE_EEPROM_DEF_EMPTY_DBG_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_DEBUG); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, CS_ENABLE_EEPROM_DEF_EMPTY_DBG_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_DEBUG); - strCmpResult = - strncmp(ExpectedEventString[1], context_CFE_EVS_SendEvent[1].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = + strncmp(ExpectedEventString[1], context_CFE_EVS_SendEvent[1].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[1].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[1].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 2, "CFE_EVS_SendEvent was called %u time(s), expected 2", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 2, "CFE_EVS_SendEvent was called %u time(s), expected 2", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Enable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Enable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); - CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; + CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_EnableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_INVALID_ENTRY_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_INVALID_ENTRY_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Enable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Enable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_EnableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_INVALID_ENTRY_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_ENABLE_EEPROM_INVALID_ENTRY_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_EnableEntryIDEepromCmd_Test_OneShot(void) - { - CS_EntryCmd_t CmdPacket; +void CS_EnableEntryIDEepromCmd_Test_OneShot(void) +{ + CS_EntryCmd_t CmdPacket; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); - /* Execute the function being tested */ - CS_EnableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_EnableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", + call_count_CFE_EVS_SendEvent); +} - void CS_DisableEntryIDEepromCmd_Test_Nominal(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_DisableEntryIDEepromCmd_Test_Nominal(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Checksumming of EEPROM Entry ID %%d is Disabled"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Checksumming of EEPROM Entry ID %%d is Disabled"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_DisableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED"); - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0"); - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0"); + /* Verify results */ + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED"); + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0"); + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_ENTRY_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_ENTRY_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED, - "CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED"); + UtAssert_True(CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED, + "CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED"); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_DisableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[2][CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_DisableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[2][CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString[0], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Checksumming of EEPROM Entry ID %%d is Disabled"); + snprintf(ExpectedEventString[0], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Checksumming of EEPROM Entry ID %%d is Disabled"); - snprintf(ExpectedEventString[1], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "CS unable to update EEPROM definition table for entry %%d, State: %%d"); + snprintf(ExpectedEventString[1], CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "CS unable to update EEPROM definition table for entry %%d, State: %%d"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; - CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = 99; + CS_AppData.DefEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_DisableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED"); - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0"); - UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0, - "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0"); + /* Verify results */ + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State == CS_STATE_DISABLED"); + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].TempChecksumValue == 0"); + UtAssert_True(CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0, + "CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].ByteOffset == 0"); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_ENTRY_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_ENTRY_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = - strncmp(ExpectedEventString[0], context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = + strncmp(ExpectedEventString[0], context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, CS_DISABLE_EEPROM_DEF_EMPTY_DBG_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_DEBUG); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, CS_DISABLE_EEPROM_DEF_EMPTY_DBG_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventType, CFE_EVS_EventType_DEBUG); - strCmpResult = - strncmp(ExpectedEventString[1], context_CFE_EVS_SendEvent[1].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = + strncmp(ExpectedEventString[1], context_CFE_EVS_SendEvent[1].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[1].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[1].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 2, "CFE_EVS_SendEvent was called %u time(s), expected 2", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 2, "CFE_EVS_SendEvent was called %u time(s), expected 2", + call_count_CFE_EVS_SendEvent); +} - void CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Disable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Disable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); - CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; + CmdPacket.Payload.EntryID = CS_MAX_NUM_EEPROM_TABLE_ENTRIES; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_DisableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_INVALID_ENTRY_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_INVALID_ENTRY_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty(void) - { - CS_EntryCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty(void) +{ + CS_EntryCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, - "Disable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, + "Disable EEPROM entry failed, invalid Entry ID: %%d, State: %%d, Max ID: %%d"); - CmdPacket.Payload.EntryID = 1; + CmdPacket.Payload.EntryID = 1; - CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[CmdPacket.Payload.EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_DisableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_INVALID_ENTRY_ERR_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_DISABLE_EEPROM_INVALID_ENTRY_ERR_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdErrCounter == 1, "CS_AppData.HkPacket.Payload.CmdErrCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_DisableEntryIDEepromCmd_Test_OneShot(void) - { - CS_EntryCmd_t CmdPacket; +void CS_DisableEntryIDEepromCmd_Test_OneShot(void) +{ + CS_EntryCmd_t CmdPacket; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_CheckRecomputeOneshot), 1, true); - /* Execute the function being tested */ - CS_DisableEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_DisableEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); + /* Verify results */ + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 0, "CS_AppData.HkPacket.Payload.CmdCounter == 0"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 0, "CFE_EVS_SendEvent was called %u time(s), expected 0", + call_count_CFE_EVS_SendEvent); +} - void CS_GetEntryIDEepromCmd_Test_Nominal(void) - { - CS_GetEntryIDCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_GetEntryIDEepromCmd_Test_Nominal(void) +{ + CS_GetEntryIDCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "EEPROM Found Address 0x%%08X in Entry ID %%d"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "EEPROM Found Address 0x%%08X in Entry ID %%d"); - int16 EntryID = 1; + int16 EntryID = 1; - CS_AppData.ResEepromTblPtr[EntryID].StartAddress = 1; - CmdPacket.Payload.Address = 1; - CS_AppData.ResEepromTblPtr[EntryID].NumBytesToChecksum = 0; - CS_AppData.ResEepromTblPtr[EntryID].State = 99; + CS_AppData.ResEepromTblPtr[EntryID].StartAddress = 1; + CmdPacket.Payload.Address = 1; + CS_AppData.ResEepromTblPtr[EntryID].NumBytesToChecksum = 0; + CS_AppData.ResEepromTblPtr[EntryID].State = 99; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_GetEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_GetEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_GetEntryIDEepromCmd_Test_AddressNotFound(void) - { - CS_GetEntryIDCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_GetEntryIDEepromCmd_Test_AddressNotFound(void) +{ + CS_GetEntryIDCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Address 0x%%08X was not found in EEPROM table"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Address 0x%%08X was not found in EEPROM table"); - CmdPacket.Payload.Address = 0xFFFFFFFF; + CmdPacket.Payload.Address = 0xFFFFFFFF; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_GetEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_GetEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_NOT_FOUND_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_NOT_FOUND_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_GetEntryIDEepromCmd_Test_AddressPtr(void) - { - CS_GetEntryIDCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_GetEntryIDEepromCmd_Test_AddressPtr(void) +{ + CS_GetEntryIDCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Address 0x%%08X was not found in EEPROM table"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Address 0x%%08X was not found in EEPROM table"); - int16 EntryID = 1; + int16 EntryID = 1; - CS_AppData.ResEepromTblPtr[EntryID].StartAddress = 2; - CmdPacket.Payload.Address = 1; - CS_AppData.ResEepromTblPtr[EntryID].NumBytesToChecksum = 0; - CS_AppData.ResEepromTblPtr[EntryID].State = 99; + CS_AppData.ResEepromTblPtr[EntryID].StartAddress = 2; + CmdPacket.Payload.Address = 1; + CS_AppData.ResEepromTblPtr[EntryID].NumBytesToChecksum = 0; + CS_AppData.ResEepromTblPtr[EntryID].State = 99; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_GetEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_GetEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_NOT_FOUND_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_NOT_FOUND_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void CS_GetEntryIDEepromCmd_Test_State(void) - { - CS_GetEntryIDCmd_t CmdPacket; - int32 strCmpResult; - char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; +void CS_GetEntryIDEepromCmd_Test_State(void) +{ + CS_GetEntryIDCmd_t CmdPacket; + int32 strCmpResult; + char ExpectedEventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH]; - snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Address 0x%%08X was not found in EEPROM table"); + snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Address 0x%%08X was not found in EEPROM table"); - int16 EntryID = 1; + int16 EntryID = 1; - CS_AppData.ResEepromTblPtr[EntryID].StartAddress = 1; - CmdPacket.Payload.Address = 1; - CS_AppData.ResEepromTblPtr[EntryID].NumBytesToChecksum = 0; - CS_AppData.ResEepromTblPtr[EntryID].State = CS_STATE_EMPTY; + CS_AppData.ResEepromTblPtr[EntryID].StartAddress = 1; + CmdPacket.Payload.Address = 1; + CS_AppData.ResEepromTblPtr[EntryID].NumBytesToChecksum = 0; + CS_AppData.ResEepromTblPtr[EntryID].State = CS_STATE_EMPTY; - UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); + UT_SetDeferredRetcode(UT_KEY(CS_VerifyCmdLength), 1, true); - /* Execute the function being tested */ - CS_GetEntryIDEepromCmd(&CmdPacket); + /* Execute the function being tested */ + CS_GetEntryIDEepromCmd(&CmdPacket); - /* Verify results */ - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_NOT_FOUND_INF_EID); - UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); + /* Verify results */ + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, CS_GET_ENTRY_ID_EEPROM_NOT_FOUND_INF_EID); + UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_INFORMATION); - strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); + strCmpResult = strncmp(ExpectedEventString, context_CFE_EVS_SendEvent[0].Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH); - UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); + UtAssert_True(strCmpResult == 0, "Event string matched expected result, '%s'", context_CFE_EVS_SendEvent[0].Spec); - UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); + UtAssert_True(CS_AppData.HkPacket.Payload.CmdCounter == 1, "CS_AppData.HkPacket.Payload.CmdCounter == 1"); - call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); + call_count_CFE_EVS_SendEvent = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent)); - UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", - call_count_CFE_EVS_SendEvent); - } + UtAssert_True(call_count_CFE_EVS_SendEvent == 1, "CFE_EVS_SendEvent was called %u time(s), expected 1", + call_count_CFE_EVS_SendEvent); +} - void UtTest_Setup(void) - { - UtTest_Add(CS_DisableEepromCmd_Test, CS_Test_Setup, CS_Test_TearDown, "CS_DisableEepromCmd_Test"); - UtTest_Add(CS_DisableEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, "CS_DisableEepromCmd_Test_OneShot"); +void UtTest_Setup(void) +{ + UtTest_Add(CS_DisableEepromCmd_Test, CS_Test_Setup, CS_Test_TearDown, "CS_DisableEepromCmd_Test"); + UtTest_Add(CS_DisableEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, "CS_DisableEepromCmd_Test_OneShot"); - UtTest_Add(CS_EnableEepromCmd_Test, CS_Test_Setup, CS_Test_TearDown, "CS_EnableEepromCmd_Test"); - UtTest_Add(CS_EnableEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, "CS_EnableEepromCmd_Test_OneShot"); + UtTest_Add(CS_EnableEepromCmd_Test, CS_Test_Setup, CS_Test_TearDown, "CS_EnableEepromCmd_Test"); + UtTest_Add(CS_EnableEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, "CS_EnableEepromCmd_Test_OneShot"); - UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_Computed, CS_Test_Setup, CS_Test_TearDown, - "CS_ReportBaselineEntryIDEepromCmd_Test_Computed"); - UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_NotYetComputed, CS_Test_Setup, CS_Test_TearDown, - "CS_ReportBaselineEntryIDEepromCmd_Test_NotYetComputed"); - UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, - "CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); - UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, - "CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty"); - - UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, - "CS_RecomputeBaselineEepromCmd_Test_Nominal"); - UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_CreateChildTaskError, CS_Test_Setup, CS_Test_TearDown, - "CS_RecomputeBaselineEepromCmd_Test_CreateChildTaskError"); - UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, - "CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); - UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, - "CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorStateEmpty"); - UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_RecomputeInProgress, CS_Test_Setup, CS_Test_TearDown, - "CS_RecomputeBaselineEepromCmd_Test_RecomputeInProgress"); - UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, - "CS_RecomputeBaselineEepromCmd_Test_OneShot"); - - UtTest_Add(CS_EnableEntryIDEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, - "CS_EnableEntryIDEepromCmd_Test_Nominal"); - UtTest_Add(CS_EnableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty, CS_Test_Setup, CS_Test_TearDown, - "CS_EnableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty"); - UtTest_Add(CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, - "CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); - UtTest_Add(CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, - "CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty"); - UtTest_Add(CS_EnableEntryIDEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, - "CS_EnableEntryIDEepromCmd_Test_OneShot"); - - UtTest_Add(CS_DisableEntryIDEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, - "CS_DisableEntryIDEepromCmd_Test_Nominal"); - UtTest_Add(CS_DisableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty, CS_Test_Setup, CS_Test_TearDown, - "CS_DisableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty"); - UtTest_Add(CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, - "CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); - UtTest_Add(CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, - "CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty"); - UtTest_Add(CS_DisableEntryIDEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, - "CS_DisableEntryIDEepromCmd_Test_OneShot"); - - UtTest_Add(CS_GetEntryIDEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, - "CS_GetEntryIDEepromCmd_Test_Nominal"); - UtTest_Add(CS_GetEntryIDEepromCmd_Test_AddressNotFound, CS_Test_Setup, CS_Test_TearDown, - "CS_GetEntryIDEepromCmd_Test_AddressNotFound"); - UtTest_Add(CS_GetEntryIDEepromCmd_Test_AddressPtr, CS_Test_Setup, CS_Test_TearDown, - "CS_GetEntryIDEepromCmd_Test_AddressPtr"); - UtTest_Add(CS_GetEntryIDEepromCmd_Test_State, CS_Test_Setup, CS_Test_TearDown, "CS_GetEntryIDEepromCmd_Test_State"); - } + UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_Computed, CS_Test_Setup, CS_Test_TearDown, + "CS_ReportBaselineEntryIDEepromCmd_Test_Computed"); + UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_NotYetComputed, CS_Test_Setup, CS_Test_TearDown, + "CS_ReportBaselineEntryIDEepromCmd_Test_NotYetComputed"); + UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, + "CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); + UtTest_Add(CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, + "CS_ReportBaselineEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty"); + + UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, + "CS_RecomputeBaselineEepromCmd_Test_Nominal"); + UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_CreateChildTaskError, CS_Test_Setup, CS_Test_TearDown, + "CS_RecomputeBaselineEepromCmd_Test_CreateChildTaskError"); + UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, + "CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); + UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, + "CS_RecomputeBaselineEepromCmd_Test_InvalidEntryErrorStateEmpty"); + UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_RecomputeInProgress, CS_Test_Setup, CS_Test_TearDown, + "CS_RecomputeBaselineEepromCmd_Test_RecomputeInProgress"); + UtTest_Add(CS_RecomputeBaselineEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, + "CS_RecomputeBaselineEepromCmd_Test_OneShot"); + + UtTest_Add(CS_EnableEntryIDEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, + "CS_EnableEntryIDEepromCmd_Test_Nominal"); + UtTest_Add(CS_EnableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty, CS_Test_Setup, CS_Test_TearDown, + "CS_EnableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty"); + UtTest_Add(CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, + "CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); + UtTest_Add(CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, + "CS_EnableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty"); + UtTest_Add(CS_EnableEntryIDEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, + "CS_EnableEntryIDEepromCmd_Test_OneShot"); + + UtTest_Add(CS_DisableEntryIDEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, + "CS_DisableEntryIDEepromCmd_Test_Nominal"); + UtTest_Add(CS_DisableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty, CS_Test_Setup, CS_Test_TearDown, + "CS_DisableEntryIDEepromCmd_Test_DefEepromTblPtrStateEmpty"); + UtTest_Add(CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh, CS_Test_Setup, CS_Test_TearDown, + "CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorEntryIDTooHigh"); + UtTest_Add(CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty, CS_Test_Setup, CS_Test_TearDown, + "CS_DisableEntryIDEepromCmd_Test_InvalidEntryErrorStateEmpty"); + UtTest_Add(CS_DisableEntryIDEepromCmd_Test_OneShot, CS_Test_Setup, CS_Test_TearDown, + "CS_DisableEntryIDEepromCmd_Test_OneShot"); + + UtTest_Add(CS_GetEntryIDEepromCmd_Test_Nominal, CS_Test_Setup, CS_Test_TearDown, + "CS_GetEntryIDEepromCmd_Test_Nominal"); + UtTest_Add(CS_GetEntryIDEepromCmd_Test_AddressNotFound, CS_Test_Setup, CS_Test_TearDown, + "CS_GetEntryIDEepromCmd_Test_AddressNotFound"); + UtTest_Add(CS_GetEntryIDEepromCmd_Test_AddressPtr, CS_Test_Setup, CS_Test_TearDown, + "CS_GetEntryIDEepromCmd_Test_AddressPtr"); + UtTest_Add(CS_GetEntryIDEepromCmd_Test_State, CS_Test_Setup, CS_Test_TearDown, "CS_GetEntryIDEepromCmd_Test_State"); +} diff --git a/unit-test/cs_init_tests.c b/unit-test/cs_init_tests.c index 201f966..3b14aa3 100644 --- a/unit-test/cs_init_tests.c +++ b/unit-test/cs_init_tests.c @@ -240,10 +240,14 @@ void CS_Init_Test_TableInitErrorMemory(void) snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH, "Table initialization failed for Memory: 0x%%08X"); - UT_ResetState(UT_KEY(CS_TableInit)); - UT_SetDeferredRetcode(UT_KEY(CS_TableInit), 0, CFE_SUCCESS); - UT_SetDeferredRetcode(UT_KEY(CS_TableInit), 1, -1); + /* Set to prevent unintended error messages */ + + /* Set to generate error message CS_CR_PIPE_ERR_EID. + * Combining a SetReturnCode and a SetFunctionHook in order to return CFE_SUCCESS all runs except the one specified + */ + UT_SetDeferredRetcode(UT_KEY(CS_TableInit), 1, CFE_SUCCESS); + UT_SetDeferredRetcode(UT_KEY(CS_TableInit), 1, -1); /* Execute the function being tested */ Result = CS_InitAllTables();