2021-07-13 11:24:47 -07:00
|
|
|
/*
|
|
|
|
* @file test_real_nb2_cranking.cpp
|
|
|
|
*
|
|
|
|
* @date July 13, 2019
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "engine_test_helper.h"
|
|
|
|
#include "logicdata_csv_reader.h"
|
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
TEST(realCrankingNB2, normalCranking) {
|
2021-07-13 11:39:21 -07:00
|
|
|
CsvReader reader(1, /* vvtCount */ 1);
|
2021-07-21 14:48:37 -07:00
|
|
|
int indeces[] = {0};
|
2021-07-13 11:39:21 -07:00
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
reader.open("tests/trigger/resources/nb2-cranking-good.csv", indeces);
|
2021-07-13 15:15:22 -07:00
|
|
|
WITH_ENGINE_TEST_HELPER (HELLEN_NB2);
|
2021-07-13 11:39:21 -07:00
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
while (reader.haveMore()) {
|
|
|
|
reader.processLine(ð);
|
2021-07-13 11:39:21 -07:00
|
|
|
}
|
2021-07-13 15:15:22 -07:00
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
// VVT position nearly zero!
|
|
|
|
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(0, 0), 3.6569f, 1e-4);
|
|
|
|
|
|
|
|
ASSERT_EQ(942, GET_RPM());
|
|
|
|
|
|
|
|
// TODO: why warnings?
|
|
|
|
ASSERT_EQ(2, eth.recentWarnings()->getCount());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(realCrankingNB2, crankingMissingInjector) {
|
|
|
|
CsvReader reader(1, /* vvtCount */ 1);
|
|
|
|
int indeces[] = {0};
|
|
|
|
|
|
|
|
reader.open("tests/trigger/resources/nb2-cranking-good-missing-injector-1.csv", indeces);
|
|
|
|
WITH_ENGINE_TEST_HELPER (HELLEN_NB2);
|
|
|
|
|
2021-07-13 15:15:22 -07:00
|
|
|
while (reader.haveMore()) {
|
|
|
|
reader.processLine(ð);
|
|
|
|
}
|
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
// VVT position nearly zero!
|
|
|
|
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(0, 0), -17.8867f, 1e-4);
|
2021-07-13 11:24:47 -07:00
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
ASSERT_EQ(209, GET_RPM());
|
2021-07-13 11:24:47 -07:00
|
|
|
|
2021-07-21 14:48:37 -07:00
|
|
|
// TODO: why warnings?
|
|
|
|
ASSERT_EQ(2, eth.recentWarnings()->getCount());
|
2021-07-13 11:24:47 -07:00
|
|
|
}
|