2021-11-24 04:47:51 -08:00
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
#include "main_relay.h"
|
|
|
|
|
2022-02-02 13:36:35 -08:00
|
|
|
TEST(Actuators, MainRelay) {
|
2023-05-31 22:31:28 -07:00
|
|
|
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
2021-11-24 04:47:51 -08:00
|
|
|
|
|
|
|
MainRelayController dut;
|
|
|
|
|
2021-12-07 18:28:04 -08:00
|
|
|
// Ignition is off, MR is off
|
2021-11-24 04:47:51 -08:00
|
|
|
dut.onSlowCallback();
|
|
|
|
EXPECT_EQ(enginePins.mainRelay.getLogicValue(), false);
|
|
|
|
|
2022-02-01 21:45:11 -08:00
|
|
|
// Battery above threshold - MR is on
|
|
|
|
Sensor::setMockValue(SensorType::BatteryVoltage, 13);
|
2021-11-24 04:47:51 -08:00
|
|
|
dut.onSlowCallback();
|
|
|
|
EXPECT_EQ(enginePins.mainRelay.getLogicValue(), true);
|
|
|
|
}
|