refactoring: extract constant
This commit is contained in:
parent
82041f82cb
commit
0eef498b3e
|
@ -4,6 +4,9 @@
|
|||
* @date Jun 26, 2021
|
||||
* @author Andrey Belomutskiy, (c) 2012-2021
|
||||
*/
|
||||
|
||||
const int SINGLE_TRIGGER_FIRST[1] = {0};
|
||||
|
||||
class CsvReader {
|
||||
public:
|
||||
CsvReader(size_t triggerCount, size_t vvtCount) : CsvReader(triggerCount, vvtCount, 0.0) {}
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
static void test(int engineSyncCam, float camOffsetAdd) {
|
||||
CsvReader reader(1, /* vvtCount */ 2);
|
||||
int indeces[] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nissan_vq40_cranking-1.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nissan_vq40_cranking-1.csv", SINGLE_TRIGGER_FIRST);
|
||||
EngineTestHelper eth (HELLEN_121_NISSAN_6_CYL);
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = false;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
|
||||
TEST(crankingGm24x, gmRealCrankingFromFile) {
|
||||
CsvReader reader(1, /* vvtCount */ 0);
|
||||
int indeces[1] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/gm_24x_cranking.csv", indeces);
|
||||
reader.open("tests/trigger/resources/gm_24x_cranking.csv", SINGLE_TRIGGER_FIRST);
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
#include "logicdata_csv_reader.h"
|
||||
|
||||
static void doTest(const char* testFile, int expectedRpm) {
|
||||
CsvReader reader(1, /* vvtCount */ 0);
|
||||
int indeces[1] = {0};
|
||||
CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 0);
|
||||
|
||||
reader.open(testFile, indeces);
|
||||
reader.open(testFile, SINGLE_TRIGGER_FIRST);
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
TEST(realCrankingNB2, normalCranking) {
|
||||
CsvReader reader(1, /* vvtCount */ 1);
|
||||
int indeces[] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good.csv", SINGLE_TRIGGER_FIRST);
|
||||
EngineTestHelper eth (HELLEN_NB2);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
|
@ -37,9 +36,8 @@ TEST(realCrankingNB2, normalCranking) {
|
|||
|
||||
TEST(realCrankingNB2, crankingMissingInjector) {
|
||||
CsvReader reader(1, /* vvtCount */ 1);
|
||||
int indeces[] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good-missing-injector-1.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good-missing-injector-1.csv", SINGLE_TRIGGER_FIRST);
|
||||
EngineTestHelper eth (HELLEN_NB2);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
|
|
|
@ -11,9 +11,8 @@
|
|||
|
||||
TEST(crankingVW, vwRealCrankingFromFile) {
|
||||
CsvReader reader(1, /* vvtCount */ 0);
|
||||
int indeces[1] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nick_1.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nick_1.csv", SINGLE_TRIGGER_FIRST);
|
||||
EngineTestHelper eth (VW_ABA);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
eth.setTriggerType(TT_60_2_VW);
|
||||
|
@ -33,9 +32,8 @@ TEST(crankingVW, crankingTwiceWithGap) {
|
|||
|
||||
{
|
||||
CsvReader reader(1, /* vvtCount */ 0);
|
||||
int indeces[1] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nick_1.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nick_1.csv", SINGLE_TRIGGER_FIRST);
|
||||
|
||||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
@ -50,9 +48,8 @@ TEST(crankingVW, crankingTwiceWithGap) {
|
|||
{
|
||||
// Offset by a short time offset, 10 seconds
|
||||
CsvReader reader(1, /* vvtCount */ 0, 10);
|
||||
int indeces[1] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nick_1.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nick_1.csv", SINGLE_TRIGGER_FIRST);
|
||||
|
||||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
@ -65,9 +62,8 @@ TEST(crankingVW, crankingTwiceWithGap) {
|
|||
{
|
||||
// Offset by long time offset, 5m14.15s
|
||||
CsvReader reader(1, /* vvtCount */ 0, 314.159);
|
||||
int indeces[1] = {0};
|
||||
|
||||
reader.open("tests/trigger/resources/nick_1.csv", indeces);
|
||||
reader.open("tests/trigger/resources/nick_1.csv", SINGLE_TRIGGER_FIRST);
|
||||
|
||||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
|
Loading…
Reference in New Issue