2021-12-14 18:10:01 -08:00
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
#include "logicdata_csv_reader.h"
|
|
|
|
|
|
|
|
static void doTest(const char* testFile, int expectedRpm) {
|
2022-09-24 12:33:01 -07:00
|
|
|
CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 0);
|
2021-12-14 18:10:01 -08:00
|
|
|
|
2022-09-24 20:01:42 -07:00
|
|
|
reader.open(testFile);
|
2021-12-14 18:10:01 -08:00
|
|
|
EngineTestHelper eth(TEST_ENGINE);
|
|
|
|
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
2022-08-19 12:03:20 -07:00
|
|
|
engineConfiguration->alwaysInstantRpm = true;
|
2021-12-14 18:10:01 -08:00
|
|
|
|
2022-09-23 17:12:34 -07:00
|
|
|
eth.setTriggerType(TT_HONDA_K_CRANK_12_1);
|
2021-12-14 18:10:01 -08:00
|
|
|
|
|
|
|
while (reader.haveMore()) {
|
|
|
|
reader.processLine(ð);
|
|
|
|
|
|
|
|
engine->rpmCalculator.onSlowCallback();
|
|
|
|
}
|
|
|
|
|
|
|
|
ASSERT_EQ(0, eth.recentWarnings()->getCount())<< "warningCounter#vwRealCranking";
|
2022-01-20 20:19:48 -08:00
|
|
|
ASSERT_EQ(expectedRpm, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
|
2021-12-14 18:10:01 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(realk24, crankingNoPlugs1) {
|
2022-08-19 12:03:20 -07:00
|
|
|
doTest("tests/trigger/resources/cranking_honda_k24a2_no_plugs.csv", 188);
|
2021-12-14 18:10:01 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(realk24, crankingNoPlugs2) {
|
2022-08-19 12:03:20 -07:00
|
|
|
doTest("tests/trigger/resources/cranking_honda_k24a2_no_plugs_2.csv", 186);
|
2021-12-14 18:10:01 -08:00
|
|
|
}
|