58 #include "Mockdatabase.h"
59 #include "Mockdatabase_helper.h"
62 #include "Mockplausibility.h"
72 TEST_SOURCE_FILE(
"redundancy.c")
74 TEST_INCLUDE_PATH("../../src/app/application/bms")
75 TEST_INCLUDE_PATH("../../src/app/application/plausibility")
76 TEST_INCLUDE_PATH("../../src/app/application/redundancy")
77 TEST_INCLUDE_PATH("../../src/app/driver/config")
78 TEST_INCLUDE_PATH("../../src/app/driver/contactor")
79 TEST_INCLUDE_PATH("../../src/app/driver/foxmath")
80 TEST_INCLUDE_PATH("../../src/app/driver/sps")
81 TEST_INCLUDE_PATH("../../src/app/engine/database")
82 TEST_INCLUDE_PATH("../../src/app/engine/
diag")
83 TEST_INCLUDE_PATH("../../src/app/task/config")
95 DATA_Read4DataBlocks_ExpectAndReturn(
101 DATA_Read4DataBlocks_IgnoreArg_pDataToReceiver0();
102 DATA_Read4DataBlocks_IgnoreArg_pDataToReceiver1();
103 DATA_Read4DataBlocks_IgnoreArg_pDataToReceiver2();
104 DATA_Read4DataBlocks_IgnoreArg_pDataToReceiver3();
127 uint32_t timestamp = 10u;
128 uint32_t previousTimestamp = 0u;
133 previousTimestamp = 10u;
138 previousTimestamp = 60u;
143 previousTimestamp = 0u;
149 uint32_t timeDifference = 100u;
152 uint32_t timestamp = 50u;
153 uint32_t previousTimestamp = 0u;
154 OS_GetTickCount_ExpectAndReturn(100u);
159 OS_GetTickCount_ExpectAndReturn(100u);
164 OS_GetTickCount_ExpectAndReturn(101u);
169 OS_GetTickCount_ExpectAndReturn(5000u);
173 timestamp = UINT32_MAX;
174 OS_GetTickCount_ExpectAndReturn(50u);
178 timestamp = UINT32_MAX - 50u;
179 OS_GetTickCount_ExpectAndReturn(49u);
183 timestamp = UINT32_MAX - 50u;
184 OS_GetTickCount_ExpectAndReturn(50u);
189 OS_GetTickCount_ExpectAndReturn(UINT32_MAX);
239 DATA_EntryUpdatedWithinInterval_IgnoreAndReturn(
false);
240 DATA_DatabaseEntryUpdatedAtLeastOnce_IgnoreAndReturn(
false);
243 OS_GetTickCount_IgnoreAndReturn(0);
245 DIAG_Handler_IgnoreAndReturn(
STD_OK);
@ DATA_BLOCK_ID_CELL_VOLTAGE_REDUNDANCY0
@ DATA_BLOCK_ID_CELL_VOLTAGE
@ DATA_BLOCK_ID_CELL_TEMPERATURE_REDUNDANCY0
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
@ DATA_BLOCK_ID_CELL_TEMPERATURE
static DIAG_DIAGNOSIS_STATE_s diag
math library for often used math functions
#define NULL_PTR
Null pointer.
STD_RETURN_TYPE_e TEST_MRC_CalculateCellTemperatureMinMaxAverage(DATA_BLOCK_CELL_TEMPERATURE_s *pValidatedTemperatures, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues)
STD_RETURN_TYPE_e TEST_MRC_CalculateCellVoltageMinMaxAverage(DATA_BLOCK_CELL_VOLTAGE_s *pValidatedVoltages, DATA_BLOCK_MIN_MAX_s *pMinMaxAverageValues)
STD_RETURN_TYPE_e TEST_MRC_UpdateCellTemperatureValidation(DATA_BLOCK_CELL_TEMPERATURE_s *pCellTemperature, DATA_BLOCK_CELL_TEMPERATURE_s *pValidatedTemperature)
bool TEST_MRC_MeasurementUpdatedAtLeastOnce(uint32_t timestamp, uint32_t previousTimestamp)
STD_RETURN_TYPE_e MRC_ValidateAfeMeasurement(void)
Function to validate the measurement between redundant measurement values for cell voltage and cell t...
STD_RETURN_TYPE_e TEST_MRC_ValidateCellTemperature(DATA_BLOCK_CELL_TEMPERATURE_s *pCelltemperatureBase, DATA_BLOCK_CELL_TEMPERATURE_s *pCelltemperatureRedundancy0, DATA_BLOCK_CELL_TEMPERATURE_s *pValidatedTemperatures)
STD_RETURN_TYPE_e TEST_MRC_UpdateCellVoltageValidation(DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltage, DATA_BLOCK_CELL_VOLTAGE_s *pValidatedVoltages)
STD_RETURN_TYPE_e TEST_MRC_MeasurementUpdatedRecently(uint32_t timestamp, uint32_t previousTimestamp, uint32_t timeInterval)
STD_RETURN_TYPE_e TEST_MRC_ValidateCellVoltage(DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltageBase, DATA_BLOCK_CELL_VOLTAGE_s *pCellVoltageRedundancy0, DATA_BLOCK_CELL_VOLTAGE_s *pValidatedVoltages)
Header fileS for handling redundancy between redundant cell voltage and cell temperature measurements...
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
DATA_BLOCK_HEADER_s header
#define TEST_ASSERT_PASS_ASSERT(_code_under_test)
assert whether assert macro has passed
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
void testMRC_UpdateCellVoltageValidationNullPointer(void)
DATA_BLOCK_CELL_VOLTAGE_s testCellVoltageRedundancy0
void testMRC_CalculateCellVoltageMinMaxAverageNullPointer(void)
DATA_BLOCK_CELL_VOLTAGE_s testCellVoltageBase
void testMRC_CalculateCellTemperatureMinMaxAverageNullPointer(void)
void testMRC_ValidateCellVoltageNullPointer(void)
DATA_BLOCK_CELL_TEMPERATURE_s testCellTemperatureBase
void testMRC_ValidateCellTemperatureNullPointer(void)
void testMRC_MeasurementUpdatedAtLeastOnce(void)
void testMRC_MeasurementUpdatedRecently(void)
void testMRC_AfeMeasurementValidationTickZeroNothingToDo(void)
void testMRC_UpdateCellTemperatureValidationNullPointer(void)
DATA_BLOCK_CELL_TEMPERATURE_s testCellTemperatureRedundancy0
static void injectDatabaseEntries(void)