#include "../../../Inc/Systems/External/BMS.h"
#include "test.h"
#include <assert.h>
#include <math.h>
#include <stdbool.h>
Go to the source code of this file.
◆ BmsHz
◆ FLOAT_ERROR
◆ bms_main()
Definition at line 32 of file BMSTest.c.
32 {
35 initBms(&bms,
BmsHz,
"Tests/Systems/External/Orion_CANBUS.dbc");
39 })
40
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;
46
49 initBms(&bms,
BmsHz,
"Tests/Systems/External/Orion_CANBUS.dbc");
50 updateBmsTest(&bms,
"Tests/Systems/External/BmsFakeCanData.txt");
51
52 ASSERT(!
equal(&bms, &expectedBms),
"bms doesn't equal expected bms",
"bms equals expected bms");
53 })
54}
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
#define ASSERT_EQ(GOT, WANT, GOT_LABEL, WANT_LABEL)
#define ASSERT(BOOL, OK, ERR)
◆ equal()
bool equal |
( |
Bms * |
bms1, |
|
|
Bms * |
bms2 |
|
) |
| |
Definition at line 14 of file BMSTest.c.
14 {
25
26
27 return true;
28}
bool floatEqual(float a, float b)
float remainingPackCapacity
◆ floatEqual()
bool floatEqual |
( |
float |
a, |
|
|
float |
b |
|
) |
| |