57 #include "Mockbattery_system_cfg.h"
58 #include "Mockcontactor.h"
59 #include "Mockdatabase.h"
61 #include "Mockfassert.h"
62 #include "Mockinterlock.h"
66 #include "Mockplausibility.h"
79 .numberOfFatalErrors = 0u,
96 #define NUM_PRECHARGE_TESTS 13
103 int32_t voltage_1 = 0;
104 int32_t voltage_2 = 0;
133 voltage_1 = INT32_MAX;
134 voltage_2 = INT32_MAX;
140 voltage_1 = INT32_MIN;
141 voltage_2 = INT32_MIN;
147 voltage_1 = INT32_MAX;
148 voltage_2 = INT32_MIN;
154 voltage_1 = INT32_MIN;
155 voltage_2 = INT32_MAX;
200 TEST_FAIL_MESSAGE(
"DATA_ReadBlock_Callback was called too often");
203 TEST_ASSERT_EQUAL_MESSAGE(12, (
NUM_PRECHARGE_TESTS - 1),
"Check code of stub. Something does not fit.");
206 TEST_FAIL_MESSAGE(
"This stub is fishy, prechargeExpectedResults is too short for the number of calls");
239 snprintf(buffer, 30,
"Loop iteration %d.", i);
241 TEST_ASSERT_EQUAL_MESSAGE(
257 #if (POSITIVE_DISCHARGE_CURRENT == true)
295 #if (POSITIVE_DISCHARGE_CURRENT == true)
302 #if (POSITIVE_DISCHARGE_CURRENT == true)
#define BS_REST_CURRENT_mA
current threshold for determing rest state of battery. If absolute current is below this limit value ...
enum BS_STRING_PRECHARGE_PRESENT 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
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
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
BS_STRING_PRECHARGE_PRESENT_e bs_stringsWithPrecharge[BS_NR_OF_STRINGS]
#define NUM_PRECHARGE_TESTS
STD_RETURN_TYPE_e MockDATA_ReadBlock_Callback(void *dataptrtoReceiver, int num_calls)
STD_RETURN_TYPE_e prechargeExpectedResults[BS_NR_OF_STRINGS][NUM_PRECHARGE_TESTS]
void testBMS_CheckPrechargeInvalidStringNumber(void)
void testCheckPrechargeIterateStub(void)
Iterate over a callback that supplies various scenarios and check if they work as expected.
void testBMS_GetCurrentFlowDirectionWithTypicalValues(void)
void testCheckCurrentValueDirectionWithCurrentZeroMaxAndMin(void)
DIAG_ID_CFG_s DIAG_ID_cfg[]