rusefi/unit_tests/tests/trigger/test_real_k20.cpp

35 lines
957 B
C++

#include "pch.h"
#include "logicdata_csv_reader.h"
static int getExhaustIndex() {
return getTriggerCentral()->vvtState[/*bankIndex*/0][/*camIndex*/1].currentCycle.current_index;
}
TEST(realk20, cranking) {
CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 2);
reader.open("tests/trigger/resources/civic-K20-cranking.csv", NORMAL_ORDER, REVERSE_ORDER);
reader.twoBanksSingleCamMode = false;
EngineTestHelper eth (engine_type_e::HONDA_K);
while (reader.haveMore()) {
reader.processLine(&eth);
float vvtI = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
if (vvtI != 0) {
EXPECT_TRUE(vvtI > -10 && vvtI < 10);
}
float vvtE = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1);
if (vvtE != 0) {
EXPECT_TRUE(vvtE > -10 && vvtE < 10) << vvtE;
}
}
EXPECT_EQ(1182, round(Sensor::getOrZero(SensorType::Rpm)));
EXPECT_TRUE(getTriggerCentral()->triggerState.hasSynchronizedPhase());
}