diff --git a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp index 0c6f5e91f0..12ac841f1b 100644 --- a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp +++ b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp @@ -149,7 +149,7 @@ TEST(ignition, CylinderTimingTrim) { EXPECT_NEAR(engine->engineState.timingAdvance[3], unadjusted + 4, EPS4D); } -TEST(ignition, negativeAdvance) { +TEST(ignition, negativeAdvance4stroke) { EngineTestHelper eth(engine_type_e::TEST_ENGINE); int rpm = 0; @@ -168,3 +168,23 @@ TEST(ignition, negativeAdvance) { ASSERT_NEAR(-13, engine->outputChannels.ignitionAdvance, EPS4D); } + +TEST(ignition, negativeAdvance2stroke) { + EngineTestHelper eth(engine_type_e::SACHS); + + int rpm = 0; + float load = 50; + + ASSERT_EQ(360, getEngineState()->engineCycle); + + engineConfiguration->fixedTiming = -13; + engineConfiguration->timingMode = TM_FIXED; + // run the ignition math + engine->periodicFastCallback(); + + eth.assertRpm(0); + ASSERT_EQ(347, getAdvance(rpm, load)); + + // todo: ooops! negative advance not displayed right for 2 stroke engines! + ASSERT_NEAR(347, engine->outputChannels.ignitionAdvance, EPS4D); +}