58 #include "Mockdatabase.h"
69 TEST_FILE(
"debug_default.c")
72 #define FAKE_CELL_VOLTAGE_mV (BC_VOLTAGE_NOMINAL_mV)
74 #define FAKE_CELL_TEMPERATURE_ddegC ((BC_TEMPERATURE_MAX_CHARGE_MOL_ddegC + BC_TEMPERATURE_MIN_CHARGE_MOL_ddegC) / 2u)
80 TEST_ASSERT_EQUAL_UINT16_MESSAGE(
83 "The data structure changed, update tests: "
84 "1: Add tests for the added/changed data structure. "
85 "2: Update the data structure length.");
88 TEST_ASSERT_EQUAL_MEMORY(
90 TEST_ASSERT_EQUAL_MEMORY(
92 TEST_ASSERT_EQUAL_MEMORY(
94 TEST_ASSERT_EQUAL_MEMORY(
96 TEST_ASSERT_EQUAL_MEMORY(
98 TEST_ASSERT_EQUAL_MEMORY(
102 TEST_ASSERT_EQUAL_UINT16(pExpected->
timer, pActual->
timer);
122 OS_EnterTaskCritical_Expect();
123 OS_ExitTaskCritical_Expect();
128 TEST_ASSERT_EQUAL_UINT8(
false, reentrance);
130 OS_EnterTaskCritical_Expect();
131 OS_ExitTaskCritical_Expect();
134 TEST_ASSERT_EQUAL_UINT8(
true, reentrance);
138 OS_EnterTaskCritical_Expect();
139 OS_ExitTaskCritical_Expect();
140 DATA_Write_2_DataBlocks_IgnoreAndReturn(
STD_OK);
141 DATA_Write_4_DataBlocks_IgnoreAndReturn(
STD_OK);
156 .firstMeasurementFinished =
false,
164 .data.allGpioVoltages = &test_fake_allGpioVoltage,
165 .data.balancingControl = &test_fake_balancingControl,
166 .data.balancingFeedback = &test_fake_balancingFeedback,
167 .data.cellTemperature = &test_fake_cellTemperature,
168 .data.cellVoltage = &test_fake_cellVoltage,
169 .data.openWire = &test_fake_openWire,
170 .data.slaveControl = &test_fake_slaveControl,
188 .firstMeasurementFinished =
true,
196 .data.allGpioVoltages = &test_fake_allGpioVoltageCompare,
197 .data.balancingControl = &test_fake_balancingControlCompare,
198 .data.balancingFeedback = &test_fake_balancingFeedbackCompare,
199 .data.cellTemperature = &test_fake_cellTemperatureCompare,
200 .data.cellVoltage = &test_fake_cellVoltageCompare,
201 .data.openWire = &test_fake_openWireCompare,
202 .data.slaveControl = &test_fake_slaveControlCompare,
207 for (uint8_t stringNumber = 0u; stringNumber <
BS_NR_OF_STRINGS; stringNumber++) {
Configuration of the battery cell (e.g., minimum and maximum cell voltage)
#define BS_NR_OF_TEMP_SENSORS_PER_STRING
#define BS_NR_OF_BAT_CELLS
@ DATA_BLOCK_ID_BALANCING_CONTROL
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
@ DATA_BLOCK_ID_SLAVE_CONTROL
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
@ DATA_BLOCK_ID_BALANCING_FEEDBACK_BASE
STD_RETURN_TYPE_e FAKE_Initialize(void)
initialize driver
void TEST_FAKE_SetFirstMeasurementCycleFinished(FAKE_STATE_s *pFakeState)
bool TEST_FAKE_CheckMultipleCalls(FAKE_STATE_s *pFakeState)
Header for the driver of the fake AFE driver.
@ FAKE_FSM_SUBSTATE_DUMMY
@ FAKE_FSM_STATE_HAS_NEVER_RUN
Header for the configuration for the fake AFE.
General macros and definitions for the whole platform.
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
int16_t cellTemperature_ddegC[BS_NR_OF_STRINGS][BS_NR_OF_TEMP_SENSORS_PER_STRING]
DATA_BLOCK_HEADER_s header
int16_t cellVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_BAT_CELLS]
DATA_BLOCK_HEADER_s header
int32_t packVoltage_mV[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
uint32_t eepromWriteAddressLastUsed
uint32_t eepromReadAddressLastUsed
uint32_t eepromReadAddressToUse
DATA_BLOCK_HEADER_s header
uint32_t eepromWriteAddressToUse
DATA_BLOCK_BALANCING_FEEDBACK_s * balancingFeedback
DATA_BLOCK_OPEN_WIRE_s * openWire
DATA_BLOCK_ALL_GPIO_VOLTAGES_s * allGpioVoltages
DATA_BLOCK_CELL_VOLTAGE_s * cellVoltage
DATA_BLOCK_BALANCING_CONTROL_s * balancingControl
DATA_BLOCK_CELL_TEMPERATURE_s * cellTemperature
DATA_BLOCK_SLAVE_CONTROL_s * slaveControl
bool firstMeasurementFinished
FAKE_FSM_SUBSTATES_e nextSubstate
FAKE_FSM_STATES_e previousState
FAKE_DATABASE_ENTRIES_s data
FAKE_FSM_SUBSTATES_e previousSubstate
FAKE_FSM_STATES_e currentState
FAKE_FSM_SUBSTATES_e currentSubstate
void testFAKE_Initialize(void)
void testTEST_FAKE_CheckMultipleCalls(void)
#define FAKE_CELL_TEMPERATURE_ddegC
#define FAKE_CELL_VOLTAGE_mV
static void TEST_assertEqualFakeState(FAKE_STATE_s *pExpected, FAKE_STATE_s *pActual)
void testFAKE_SetFirstMeasurementCycleFinished(void)
void testFAKE_TriggerAfe(void)
void testFAKE_IsFirstMeasurementCycleFinished(void)