|
foxBMS-UnitTests
1.0.0
The foxBMS Unit Tests API Documentation
|
Go to the documentation of this file.
58 #include "Mockdatabase.h"
59 #include "Mockfassert.h"
60 #include "Mockmxm_17841b.h"
61 #include "Mockmxm_41b_register_map.h"
62 #include "Mockmxm_battery_management.h"
63 #include "Mockmxm_cfg.h"
64 #include "Mockmxm_crc8.h"
65 #include "Mockmxm_registry.h"
80 .allowStartup =
false,
81 .operationRequested =
false,
82 .firstMeasurementDone =
false,
83 .stopRequested =
false,
84 .openwireRequested =
false,
85 .undervoltageAlert =
false,
87 .mxmVoltageCellCounter = 0,
95 .deviceAddress = 0x00,
134 uint8_t volt_rx_buffer = 0;
166 MXM_5XSetStateRequest_ExpectAndReturn(
205 const uint8_t registerAddress = 21u;
208 .regAddress = registerAddress,
212 MXM_5XSetStateRequest_ExpectAndReturn(
214 bool functionReturnValue;
216 TEST_ASSERT_EQUAL(
false, functionReturnValue);
221 bool functionReturnValue;
223 TEST_ASSERT_EQUAL(
false, functionReturnValue);
228 bool functionReturnValue;
230 TEST_ASSERT_EQUAL(
false, functionReturnValue);
238 bool functionReturnValue;
240 TEST_ASSERT_EQUAL(
true, functionReturnValue);
259 DATA_Write_1_DataBlock_IgnoreAndReturn(
STD_OK);
263 for (uint8_t i = 0u; i < 8; i = i + 2) {
266 for (uint8_t i = 1u; i < 8; i = i + 2) {
#define MXM_MAXIMUM_NR_OF_CELLS_PER_MODULE
Maximum number of cells per module.
void testTEST_MXM_ParseVoltageReadallNullPointer(void)
void testMXM_HandleStateReadallError(void)
void testMXM_ProcessOpenWireNullPointer(void)
MXM_5X_INSTANCE_s * pInstance5X
bool TEST_MXM_HandleStateReadall(MXM_MONITORING_INSTANCE_s *pInstance, MXM_REG_NAME_e registerName, MXM_STATEMACHINE_OPERATION_STATES_e nextState)
uint16_t commandBuffer[10]
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
void testMXM_HandleStateWriteallProcessed(void)
void testMXM_ProcessOpenWire1SatelliteAlternatingPattern(void)
void testMXM_HandleStateReadallInvalidRequestStatus(void)
MXM_5X_COMMAND_PAYLOAD_s batteryCmdBuffer
STD_RETURN_TYPE_e TEST_MXM_ParseVoltageReadallTest(MXM_MONITORING_INSTANCE_s *pInstance)
void testMXM_HandleStateWriteallNullPointer(void)
uint8_t rxBuffer[MXM_RX_BUFFER_LENGTH]
void testMXM_ParseVoltageReadallTestNullPointer(void)
@ MXM_5X_STATE_UNPROCESSED
@ MXM_STATEMACH_5X_WRITEALL
void testTEST_MXM_MonGetVoltagesNullPointer(void)
void testMXM_StateMachineNullPointer(void)
void testMXM_HandleStateReadallNullPointer(void)
MXM_STATEMACHINE_STATES_e state
static DATA_BLOCK_OPEN_WIRE_s mxm_openwire
STD_RETURN_TYPE_e TEST_MXM_ParseVoltagesIntoDB(MXM_MONITORING_INSTANCE_s *pInstance)
void testMXM_HandleStateWriteallUnprocessed(void)
void testMXM_HandleStateWriteallEntry(void)
void MXM_StateMachine(MXM_MONITORING_INSTANCE_s *pInstance)
Battery monitoring driver for MAX1785x battery monitoring ICs.
void TEST_MXM_ProcessOpenWire(MXM_MONITORING_INSTANCE_s *pInstance, DATA_BLOCK_OPEN_WIRE_s *pDataOpenWire)
void TEST_MXM_HandleStateWriteall(MXM_MONITORING_INSTANCE_s *pInstance, MXM_STATEMACHINE_OPERATION_STATES_e nextState)
enum MXM_REG_NAME MXM_REG_NAME_e
MAX1785x register names.
MXM_STATEMACHINE_OPERATION_STATES_e operationSubstate
static MXM_MONITORING_INSTANCE_s mxm_instance
uint8_t openwire[BS_NR_OF_STRINGS][BS_NR_OF_MODULES *(BS_NR_OF_CELLS_PER_MODULE+1)]
void testMXM_HandleStateWriteallError(void)
@ MXM_STATEMACH_5X_READALL
#define NULL_PTR
Null pointer.
STD_RETURN_TYPE_e TEST_MXM_ParseVoltageReadall(uint8_t *volt_rx_buffer, uint16_t volt_rx_buffer_len, MXM_DATA_STORAGE_s *datastorage, MXM_CONVERSION_TYPE_e conversionType)
void testMXM_HandleStateReadallProcessed(void)
void testMXM_ParseVoltageReadallTest(void)
MXM_5X_STATE_REQUEST_STATUS_e requestStatus5x
MXM_MONINTORING_STATE_e TEST_MXM_MonGetVoltages(MXM_MONITORING_INSTANCE_s *pInstance, MXM_REG_NAME_e regAddress)
Headers for the driver for the MAX17841B ASCI and MAX1785x monitoring chip.
void testMXM_HandleStateReadallUnsent(void)
void testMXM_HandleStateWriteallInvalidRequestStatus(void)
DATA_BLOCK_HEADER_s header
void testMXM_ParseVoltagesIntoDBNullPointer(void)
#define TEST_ASSERT_FAIL_ASSERT(_code_under_test)
assert whether assert macro has failed
void testMXM_HandleStateReadallUnprocessed(void)
Database configuration header.
#define TEST_ASSERT_PASS_ASSERT(_code_under_test)
assert whether assert macro has passed