58 #include "Mockbattery_system_cfg.h"
59 #include "Mockcontactor.h"
60 #include "Mockdatabase.h"
62 #include "Mockfassert.h"
64 #include "Mockinterlock.h"
68 #include "Mockplausibility.h"
83 .numberOfFatalErrors = 0u,
124 #define NUM_PRECHARGE_TESTS 13
131 int32_t voltage_1 = 0;
132 int32_t voltage_2 = 0;
161 voltage_1 = INT32_MAX;
162 voltage_2 = INT32_MAX;
168 voltage_1 = INT32_MIN;
169 voltage_2 = INT32_MIN;
175 voltage_1 = INT32_MAX;
176 voltage_2 = INT32_MIN;
182 voltage_1 = INT32_MIN;
183 voltage_2 = INT32_MAX;
228 TEST_FAIL_MESSAGE(
"DATA_ReadBlock_Callback was called too often");
231 TEST_ASSERT_EQUAL_MESSAGE(12, (
NUM_PRECHARGE_TESTS - 1),
"Check code of stub. Something does not fit.");
234 TEST_FAIL_MESSAGE(
"This stub is fishy, prechargeExpectedResults is too short for the number of calls");
267 snprintf(buffer, 30,
"Loop iteration %d.", i);
269 TEST_ASSERT_EQUAL_MESSAGE(
285 #if (POSITIVE_DISCHARGE_CURRENT == true)
323 #if (POSITIVE_DISCHARGE_CURRENT == true)
330 #if (POSITIVE_DISCHARGE_CURRENT == true)
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
#define BS_REST_CURRENT_mA
current threshold for determing rest state of battery. If absolute current is below this limit value ...
BS_STRING_PRECHARGE_PRESENT_e
@ BS_STRING_WITH_PRECHARGE
#define BS_CS_THRESHOLD_NO_CURRENT_mA
current sensor threshold for 0 current in mA as the sensor has a jitter.
STD_RETURN_TYPE_e TEST_BMS_CheckPrecharge(uint8_t stringNumber, DATA_BLOCK_PACK_VALUES_s *pPackValues)
BMS_CURRENT_FLOW_STATE_e BMS_GetCurrentFlowDirection(int32_t current_mA)
Get current flow direction, current value as function parameter.
#define BMS_PRECHARGE_VOLTAGE_THRESHOLD_mV
#define BMS_PRECHARGE_CURRENT_THRESHOLD_mA
@ DATA_BLOCK_ID_PACK_VALUES
math library for often used math functions
Header for the configuration for the driver for the smart power switches.
DATA_BLOCK_HEADER_s header
uint8_t nrOfConfiguredDiagnosisEntries
#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
BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS]
#define NUM_PRECHARGE_TESTS
STD_RETURN_TYPE_e prechargeExpectedResults[BS_NR_OF_STRINGS][NUM_PRECHARGE_TESTS]
void testBMS_CheckPrechargeInvalidStringNumber(void)
CONT_CONTACTOR_STATE_s cont_contactorStates[]
void testCheckPrechargeIterateStub(void)
Iterate over a callback that supplies various scenarios and check if they work as expected.
void testBMS_GetCurrentFlowDirectionWithTypicalValues(void)
STD_RETURN_TYPE_e MockDATA_ReadBlock_Callback(void *pDataToReceiver, int num_calls)
void testCheckCurrentValueDirectionWithCurrentZeroMaxAndMin(void)
DIAG_ID_CFG_s diag_diagnosisIdConfiguration[]