2021-05-24 03:03:58 -07:00
|
|
|
/*
|
|
|
|
* @file test_real_cranking_miata_NA.cpp
|
|
|
|
*
|
|
|
|
* @date May 22, 2021
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2021
|
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2021-06-25 21:33:28 -07:00
|
|
|
#include "logicdata_csv_reader.h"
|
2021-06-23 02:22:08 -07:00
|
|
|
#include <string>
|
2021-05-24 03:03:58 -07:00
|
|
|
|
2021-06-23 08:32:06 -07:00
|
|
|
TEST(cranking, realCrankingFromFile) {
|
2021-07-13 11:24:47 -07:00
|
|
|
CsvReader reader(2, /* vvtCount */ 0);
|
2021-06-24 18:58:40 -07:00
|
|
|
int indeces[2] = {1, 0}; // this logic data file has first trigger channel in second column and second trigger channel in first column
|
2021-07-13 09:35:43 -07:00
|
|
|
reader.open("tests/trigger/resources/cranking_na_3.csv", indeces);
|
2021-06-23 08:32:06 -07:00
|
|
|
|
2021-11-16 13:52:11 -08:00
|
|
|
EngineTestHelper eth (FRANKENSO_MIATA_NA6_MAP);
|
2021-06-23 08:32:06 -07:00
|
|
|
|
|
|
|
ssize_t read;
|
|
|
|
|
2021-07-01 18:29:04 -07:00
|
|
|
for (int i = 0; i < 23; i++) {
|
2021-06-23 08:32:06 -07:00
|
|
|
reader.readLine(ð);
|
|
|
|
}
|
|
|
|
|
2021-07-01 18:29:04 -07:00
|
|
|
EXPECT_EQ(0, GET_RPM())<< reader.lineIndex();
|
|
|
|
EXPECT_EQ( 0, eth.recentWarnings()->getCount());
|
2021-06-23 08:32:06 -07:00
|
|
|
|
2021-07-01 18:29:04 -07:00
|
|
|
// This tooth should be first sync point
|
2021-06-23 08:32:06 -07:00
|
|
|
reader.readLine(ð);
|
2021-06-24 22:43:15 -07:00
|
|
|
|
2021-07-01 18:29:04 -07:00
|
|
|
EXPECT_EQ(232, GET_RPM())<< reader.lineIndex() << " @ 1";
|
2021-06-23 08:32:06 -07:00
|
|
|
|
2021-06-24 18:58:40 -07:00
|
|
|
for (int i = 0; i < 30; i++) {
|
2021-06-23 08:32:06 -07:00
|
|
|
reader.readLine(ð);
|
2021-06-18 19:52:01 -07:00
|
|
|
}
|
2021-07-01 18:29:04 -07:00
|
|
|
ASSERT_EQ(224, GET_RPM())<< reader.lineIndex();
|
2021-05-24 03:03:58 -07:00
|
|
|
|
2021-06-24 19:21:30 -07:00
|
|
|
|
|
|
|
for (int i = 0; i < 30; i++) {
|
|
|
|
reader.readLine(ð);
|
|
|
|
}
|
2021-07-01 18:29:04 -07:00
|
|
|
ASSERT_EQ(456, GET_RPM())<< reader.lineIndex() << " @ 2";
|
2021-06-24 19:21:30 -07:00
|
|
|
|
2021-06-23 08:32:06 -07:00
|
|
|
while (reader.haveMore()) {
|
|
|
|
reader.processLine(ð);
|
|
|
|
}
|
2021-07-01 06:19:16 -07:00
|
|
|
|
2021-07-01 15:58:28 -07:00
|
|
|
ASSERT_EQ(0, eth.recentWarnings()->getCount())<< "warningCounter#realCranking";
|
2021-07-01 18:29:04 -07:00
|
|
|
ASSERT_EQ(407, GET_RPM())<< reader.lineIndex();
|
2021-05-24 03:03:58 -07:00
|
|
|
}
|