Skip to content

Commit

Permalink
todo: ooops! negative advance not displayed right for 2 stroke engines!
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Mar 20, 2024
1 parent bd31825 commit 8e4f117
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

0 comments on commit 8e4f117

Please sign in to comment.