diff --git a/unit_tests/tests/actuators/test_antilag.cpp b/unit_tests/tests/actuators/test_antilag.cpp new file mode 100644 index 0000000000..c39865e579 --- /dev/null +++ b/unit_tests/tests/actuators/test_antilag.cpp @@ -0,0 +1,16 @@ +#include "pch.h" + +TEST(Actuators, AntiLag) { + EngineTestHelper eth(TEST_ENGINE); + + engineConfiguration->antiLagEnabled = true; + + Sensor::setMockValue(SensorType::Clt, 70); + + engine->periodicFastCallback(); + ASSERT_EQ(1, engine->antilagController.ALSMinCLTCondition); + ASSERT_EQ(1, engine->antilagController.ALSMaxCLTCondition); + + // todo: let's have this 'true' + ASSERT_EQ(0, engine->antilagController.isAntilagCondition); +} diff --git a/unit_tests/tests/tests.mk b/unit_tests/tests/tests.mk index 1ab4403409..7ac91e5737 100644 --- a/unit_tests/tests/tests.mk +++ b/unit_tests/tests/tests.mk @@ -104,6 +104,7 @@ TESTS_SRC_CPP = \ tests/sensor/test_turbocharger_speed_converter.cpp \ tests/sensor/test_vehicle_speed_converter.cpp \ tests/actuators/test_aux_valves.cpp \ + tests/actuators/test_antilag.cpp \ tests/actuators/test_boost.cpp \ tests/actuators/test_dc_motor.cpp \ tests/actuators/test_etb.cpp \