2021-07-21 20:08:56 -07:00
|
|
|
/*
|
|
|
|
* @file test_real_cranking_nissan_vq40.cpp
|
|
|
|
*
|
|
|
|
* @date Jul 21, 2021
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2021
|
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
2021-07-21 20:08:56 -07:00
|
|
|
#include "logicdata_csv_reader.h"
|
|
|
|
|
|
|
|
TEST(realCrankingVQ40, normalCranking) {
|
|
|
|
CsvReader reader(1, /* vvtCount */ 2);
|
|
|
|
int indeces[] = {0};
|
|
|
|
|
|
|
|
reader.open("tests/trigger/resources/nissan_vq40_cranking-1.csv", indeces);
|
2021-08-08 04:04:18 -07:00
|
|
|
WITH_ENGINE_TEST_HELPER (HELLEN_121_NISSAN_6_CYL);
|
2021-07-21 20:08:56 -07:00
|
|
|
|
2021-07-21 22:02:37 -07:00
|
|
|
bool hasSeenFirstVvt = false;
|
|
|
|
|
2021-07-21 20:08:56 -07:00
|
|
|
while (reader.haveMore()) {
|
|
|
|
reader.processLine(ð);
|
2021-07-21 22:02:37 -07:00
|
|
|
float vvt1 = engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0);
|
|
|
|
|
|
|
|
if (vvt1 != 0 && !hasSeenFirstVvt) {
|
|
|
|
EXPECT_NEAR(vvt1, -38.69, 1);
|
|
|
|
hasSeenFirstVvt = true;
|
|
|
|
}
|
2021-07-21 20:08:56 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(/*bankIndex*/0, /*camIndex*/0), -46.817, 1e-2);
|
2021-07-21 20:24:23 -07:00
|
|
|
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(/*bankIndex*/1, /*camIndex*/0), -47.411, 1e-2);
|
2021-07-21 20:08:56 -07:00
|
|
|
ASSERT_EQ(241, GET_RPM())<< reader.lineIndex();
|
|
|
|
|
2021-07-21 20:24:23 -07:00
|
|
|
// TODO: why warnings?
|
2021-10-01 22:10:24 -07:00
|
|
|
ASSERT_EQ(3, eth.recentWarnings()->getCount());
|
2021-07-21 20:26:40 -07:00
|
|
|
ASSERT_EQ(CUSTOM_SYNC_COUNT_MISMATCH, eth.recentWarnings()->get(0));
|
2021-10-01 22:10:24 -07:00
|
|
|
ASSERT_EQ(CUSTOM_OUT_OF_ORDER_COIL, eth.recentWarnings()->get(1)); // this is from a coil being protected by overdwell protection
|
|
|
|
ASSERT_EQ(CUSTOM_SYNC_ERROR, eth.recentWarnings()->get(2));
|
2021-07-21 20:08:56 -07:00
|
|
|
}
|