1#include "../../../Inc/Systems/External/BMS.h"
9#define FLOAT_ERROR 1e-5
35 initBms(&bms,
BmsHz,
"Tests/Systems/External/Orion_CANBUS.dbc");
42 initBms(&expectedBms,
BmsHz,
"Tests/Systems/External/Orion_CANBUS.dbc");
43 expectedBms.packVoltage = 600.0f;
44 expectedBms.packVoltage = 400.0f;
45 expectedBms.stateOfCharge = 80.0f;
49 initBms(&bms,
BmsHz,
"Tests/Systems/External/Orion_CANBUS.dbc");
50 updateBmsTest(&bms,
"Tests/Systems/External/BmsFakeCanData.txt");
52 ASSERT(!
equal(&bms, &expectedBms),
"bms doesn't equal expected bms",
"bms equals expected bms");
bool floatEqual(float a, float b)
bool equal(Bms *bms1, Bms *bms2)
void updateBmsTest(void *bms, const char *canDataFn)
Updates the BMS data.
void initBms(Bms *bms, int hz, const char *dbcFn)
Initializes the BMS with the given frequency.
BmsChargeStatus chargeStatus
float remainingPackCapacity
#define ASSERT_EQ(GOT, WANT, GOT_LABEL, WANT_LABEL)
#define ASSERT(BOOL, OK, ERR)