rusefi/unit_tests/tests/trigger/test_real_k20.cpp

35 lines
957 B
C++
Raw Normal View History

2022-09-24 12:37:51 -07:00
#include "pch.h"
#include "logicdata_csv_reader.h"
2022-09-24 21:26:42 -07:00
static int getExhaustIndex() {
return getTriggerCentral()->vvtState[/*bankIndex*/0][/*camIndex*/1].currentCycle.current_index;
}
2022-09-24 12:37:51 -07:00
TEST(realk20, cranking) {
CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 2);
2022-09-24 20:18:57 -07:00
reader.open("tests/trigger/resources/civic-K20-cranking.csv", NORMAL_ORDER, REVERSE_ORDER);
2022-09-24 21:26:42 -07:00
reader.twoBanksSingleCamMode = false;
2022-09-24 12:37:51 -07:00
2023-11-25 16:59:15 -08:00
EngineTestHelper eth (engine_type_e::HONDA_K);
2022-09-24 12:37:51 -07:00
2022-09-25 06:14:29 -07:00
while (reader.haveMore()) {
2022-09-24 20:18:57 -07:00
reader.processLine(&eth);
2022-09-24 12:37:51 -07:00
2023-03-29 19:57:31 -07:00
float vvtI = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
if (vvtI != 0) {
EXPECT_TRUE(vvtI > -10 && vvtI < 10);
}
2022-09-24 20:18:57 -07:00
2022-09-25 06:14:29 -07:00
float vvtE = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/1);
if (vvtE != 0) {
2023-03-28 18:42:20 -07:00
EXPECT_TRUE(vvtE > -10 && vvtE < 10) << vvtE;
2022-09-25 06:14:29 -07:00
}
2022-09-24 12:37:51 -07:00
2022-09-24 21:26:42 -07:00
}
2022-09-24 12:37:51 -07:00
2022-09-25 06:14:29 -07:00
EXPECT_EQ(1182, round(Sensor::getOrZero(SensorType::Rpm)));
EXPECT_TRUE(getTriggerCentral()->triggerState.hasSynchronizedPhase());
2022-09-24 21:26:42 -07:00
}