From 564cec3ed25ef26625007a366ce1a1417b5c0b53 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sat, 31 Aug 2024 00:16:49 -0400 Subject: [PATCH] Support individually-wired wasted spark on odd cylinder engines (especially 3cyl) #4195 only:unit test skeleton --- .../test_three_cylinder.cpp | 21 +++++++++++++++++++ unit_tests/tests/tests.mk | 1 + 2 files changed, 22 insertions(+) create mode 100644 unit_tests/tests/ignition_injection/test_three_cylinder.cpp diff --git a/unit_tests/tests/ignition_injection/test_three_cylinder.cpp b/unit_tests/tests/ignition_injection/test_three_cylinder.cpp new file mode 100644 index 0000000000..92a98907d4 --- /dev/null +++ b/unit_tests/tests/ignition_injection/test_three_cylinder.cpp @@ -0,0 +1,21 @@ +#include "pch.h" + +using ::testing::_; + +static const angle_t timing = 6; // same timing cranking and running modes + +TEST(threeCylinders, crankWastedSpark) { + EngineTestHelper eth(engine_type_e::MITSUBISHI_3A92); + setTable(config->ignitionTable, timing); // this changes run mode timing + engineConfiguration->crankingTimingAngle = timing; + engine->tdcMarkEnabled = false; // reduce event queue noise TODO extract helper method + + engineConfiguration->isInjectionEnabled = false; // reduce event queue / less distraction + + // just simpler to use trivial trigger in tests, does not make a difference for actual scheduling + eth.setTriggerType(trigger_type_e::TT_HALF_MOON); + + + // see 'test_odd_firing_engine.cpp' which is the nicest relevant test at the moment + // see https://github.com/rusefi/rusefi/issues/4195#issuecomment-2322760547 +} diff --git a/unit_tests/tests/tests.mk b/unit_tests/tests/tests.mk index 466a1d650f..14a7843e3e 100644 --- a/unit_tests/tests/tests.mk +++ b/unit_tests/tests/tests.mk @@ -46,6 +46,7 @@ TESTS_SRC_CPP = \ tests/ignition_injection/test_fuel_computer.cpp \ tests/ignition_injection/test_injector_model.cpp \ tests/ignition_injection/test_odd_firing_engine.cpp \ + tests/ignition_injection/test_three_cylinder.cpp \ tests/util/test_base.cpp \ tests/ac/ac_test_base.cpp \ tests/ac/ac_pressure_test.cpp \