50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
/*
|
|
* @file test_real_nb2_cranking.cpp
|
|
*
|
|
* @date July 13, 2019
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
|
*/
|
|
|
|
#include "pch.h"
|
|
#include "logicdata_csv_reader.h"
|
|
|
|
TEST(realCrankingNB2, normalCranking) {
|
|
CsvReader reader(1, /* vvtCount */ 1);
|
|
int indeces[] = {0};
|
|
|
|
reader.open("tests/trigger/resources/nb2-cranking-good.csv", indeces);
|
|
EngineTestHelper eth (HELLEN_NB2);
|
|
|
|
while (reader.haveMore()) {
|
|
reader.processLine(ð);
|
|
}
|
|
|
|
// 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);
|
|
EngineTestHelper eth (HELLEN_NB2);
|
|
|
|
while (reader.haveMore()) {
|
|
reader.processLine(ð);
|
|
}
|
|
|
|
// VVT position nearly zero!
|
|
EXPECT_NEAR(engine->triggerCentral.getVVTPosition(0, 0), -7.1926f, 1e-4);
|
|
|
|
ASSERT_EQ(668, GET_RPM());
|
|
|
|
// TODO: why warnings?
|
|
ASSERT_EQ(2, eth.recentWarnings()->getCount());
|
|
}
|