rusefi/unit_tests/tests/trigger/test_real_k20.cpp

36 lines
964 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
2022-09-24 20:45:09 -07:00
EngineTestHelper eth (PROTEUS_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
2022-09-25 06:14:29 -07:00
// TODO
// 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) {
EXPECT_TRUE(vvtE > -10 && vvtE < 10);
}
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
}