2021-11-24 04:47:51 -08:00
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
#include "main_relay.h"
|
|
|
|
|
|
|
|
TEST(MainRelay, mr) {
|
|
|
|
EngineTestHelper eth(TEST_ENGINE);
|
|
|
|
|
|
|
|
MainRelayController dut;
|
|
|
|
|
2021-12-07 18:28:04 -08:00
|
|
|
// Ignition is off, MR is off
|
|
|
|
dut.onIgnitionStateChanged(false);
|
2021-11-24 04:47:51 -08:00
|
|
|
dut.onSlowCallback();
|
|
|
|
EXPECT_EQ(enginePins.mainRelay.getLogicValue(), false);
|
|
|
|
|
|
|
|
// Ignition is now on, MR is on
|
2021-12-07 18:28:04 -08:00
|
|
|
dut.onIgnitionStateChanged(true);
|
2021-11-24 04:47:51 -08:00
|
|
|
dut.onSlowCallback();
|
|
|
|
EXPECT_EQ(enginePins.mainRelay.getLogicValue(), true);
|
|
|
|
}
|