From 149428c8b95b9d428206fdeb9aa6f51866728af4 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 20 Feb 2023 20:37:33 -0500 Subject: [PATCH] just more test, does not help :( --- unit_tests/tests/trigger/test_real_4g93.cpp | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/unit_tests/tests/trigger/test_real_4g93.cpp b/unit_tests/tests/trigger/test_real_4g93.cpp index dd6a83859b..d3520ec753 100644 --- a/unit_tests/tests/trigger/test_real_4g93.cpp +++ b/unit_tests/tests/trigger/test_real_4g93.cpp @@ -46,6 +46,8 @@ TEST(real4g93, cranking) { EXPECT_EQ(reader.lineIndex(), 17); EXPECT_NEAR(rpm, 204.01f, 0.1); } +// float instantRpm = engine->triggerCentral.instantRpm.getInstantRpm(); +// not looking too bad horrible printf("rpm=%f instant=%f\n", rpm, instantRpm); } ASSERT_TRUE(gotRpm); @@ -54,6 +56,36 @@ TEST(real4g93, cranking) { ASSERT_EQ(0, eth.recentWarnings()->getCount()); } +TEST(real4g93, crankingOn11) { + CsvReader reader(2, /* vvtCount */ 0); + + reader.open("tests/trigger/resources/4g93-cranking.csv"); + EngineTestHelper eth(TEST_ENGINE); + engineConfiguration->isFasterEngineSpinUpEnabled = true; + engineConfiguration->alwaysInstantRpm = true; + + engineConfiguration->isPhaseSyncRequiredForIgnition = true; + + eth.setTriggerType(TT_MITSUBISHI_4G93); + + bool gotRpm = false; + while (reader.haveMore()) { + reader.processLine(ð); + + auto rpm = Sensor::getOrZero(SensorType::Rpm); + if (!gotRpm && rpm) { + gotRpm = true; + + // We should get first RPM on exactly the first sync point - this means the instant RPM pre-sync event copy all worked OK + EXPECT_EQ(reader.lineIndex(), 7); + EXPECT_NEAR(rpm, 168.43f, 0.1); + } + + float instantRpm = engine->triggerCentral.instantRpm.getInstantRpm(); + printf("%d rpm=%f instant=%f\n", reader.lineIndex(), rpm, instantRpm); + } +} + TEST(real4g93, crankingCamOnly) { CsvReader reader(1, /* vvtCount */ 0);