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"
85 .numberOfFatalErrors = 0u,
126 #define NUM_PRECHARGE_TESTS 13
133 int32_t voltage_1 = 0;
134 int32_t voltage_2 = 0;
163 voltage_1 = INT32_MAX;
164 voltage_2 = INT32_MAX;
170 voltage_1 = INT32_MIN;
171 voltage_2 = INT32_MIN;
177 voltage_1 = INT32_MAX;
178 voltage_2 = INT32_MIN;
184 voltage_1 = INT32_MIN;
185 voltage_2 = INT32_MAX;
230 TEST_FAIL_MESSAGE(
"DATA_ReadBlock_Callback was called too often");
233 TEST_ASSERT_EQUAL_MESSAGE(12, (
NUM_PRECHARGE_TESTS - 1),
"Check code of stub. Something does not fit.");
236 TEST_FAIL_MESSAGE(
"This stub is fishy, prechargeExpectedResults is too short for the number of calls");
269 snprintf(buffer, 30,
"Loop iteration %d.", i);
273 TEST_ASSERT_EQUAL_MESSAGE(
289 #if (BS_POSITIVE_DISCHARGE_CURRENT == true)
327 #if (BS_POSITIVE_DISCHARGE_CURRENT == true)
334 #if (BS_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 determining rest state of battery. If absolute current is below this limit valu...
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[]