fancy default and reusing constant
This commit is contained in:
parent
3730a4650c
commit
63fe1120bd
|
@ -5,7 +5,9 @@
|
|||
* @author Andrey Belomutskiy, (c) 2012-2021
|
||||
*/
|
||||
|
||||
const int SINGLE_TRIGGER_FIRST[1] = {0};
|
||||
const int NORMAL_ORDER[2] = {0, 1};
|
||||
|
||||
const int REVERSE_ORDER[2] = {1, 0};
|
||||
|
||||
class CsvReader {
|
||||
public:
|
||||
|
@ -18,7 +20,7 @@ public:
|
|||
}
|
||||
~CsvReader();
|
||||
|
||||
void open(const char *fileName, const int* triggerColumnIndeces = SINGLE_TRIGGER_FIRST);
|
||||
void open(const char *fileName, const int* triggerColumnIndeces = NORMAL_ORDER);
|
||||
bool haveMore();
|
||||
void processLine(EngineTestHelper *eth);
|
||||
void readLine(EngineTestHelper *eth);
|
||||
|
@ -42,5 +44,6 @@ private:
|
|||
int m_lineIndex = -1;
|
||||
|
||||
const int* triggerColumnIndeces;
|
||||
const int* vvtColumnIndeces;
|
||||
};
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
TEST(cranking, realCrankingFromFile) {
|
||||
CsvReader reader(2, /* vvtCount */ 0);
|
||||
int indeces[2] = {1, 0}; // this logic data file has first trigger channel in second column and second trigger channel in first column
|
||||
reader.open("tests/trigger/resources/cranking_na_3.csv", indeces);
|
||||
// this logic data file has first trigger channel in second column and second trigger channel in first column
|
||||
reader.open("tests/trigger/resources/cranking_na_3.csv", REVERSE_ORDER);
|
||||
|
||||
EngineTestHelper eth (FRANKENSO_MIATA_NA6_MAP);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -167,8 +167,7 @@ TEST(cranking, hardcodedRealCranking) {
|
|||
|
||||
TEST(cranking, naCrankFromFile) {
|
||||
CsvReader reader(2, /* vvtCount */ 0);
|
||||
int indeces[2] = {1, 0};
|
||||
reader.open("tests/trigger/resources/cranking_na_4.csv", indeces);
|
||||
reader.open("tests/trigger/resources/cranking_na_4.csv", REVERSE_ORDER);
|
||||
|
||||
EngineTestHelper eth(FRANKENSO_MIATA_NA6_VAF);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
static void test(int engineSyncCam, float camOffsetAdd) {
|
||||
CsvReader reader(1, /* vvtCount */ 2);
|
||||
|
||||
reader.open("tests/trigger/resources/nissan_vq40_cranking-1.csv", SINGLE_TRIGGER_FIRST);
|
||||
reader.open("tests/trigger/resources/nissan_vq40_cranking-1.csv");
|
||||
EngineTestHelper eth (HELLEN_121_NISSAN_6_CYL);
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = false;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
TEST(realk20, cranking) {
|
||||
CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 2);
|
||||
|
||||
reader.open("tests/trigger/resources/civic-K20-cranking.csv", SINGLE_TRIGGER_FIRST);
|
||||
reader.open("tests/trigger/resources/civic-K20-cranking.csv");
|
||||
|
||||
EngineTestHelper eth (PROTEUS_HONDA_ELEMENT_2003);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
static void doTest(const char* testFile, int expectedRpm) {
|
||||
CsvReader reader(/* triggerCount */ 1, /* vvtCount */ 0);
|
||||
|
||||
reader.open(testFile, SINGLE_TRIGGER_FIRST);
|
||||
reader.open(testFile);
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
TEST(realCrankingNB2, normalCranking) {
|
||||
CsvReader reader(1, /* vvtCount */ 1);
|
||||
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good.csv", SINGLE_TRIGGER_FIRST);
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good.csv");
|
||||
EngineTestHelper eth (HELLEN_NB2);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
|
@ -37,7 +37,7 @@ TEST(realCrankingNB2, normalCranking) {
|
|||
TEST(realCrankingNB2, crankingMissingInjector) {
|
||||
CsvReader reader(1, /* vvtCount */ 1);
|
||||
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good-missing-injector-1.csv", SINGLE_TRIGGER_FIRST);
|
||||
reader.open("tests/trigger/resources/nb2-cranking-good-missing-injector-1.csv");
|
||||
EngineTestHelper eth (HELLEN_NB2);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
|
|
|
@ -90,8 +90,8 @@ TEST(big, testTriggerInputAdc) {
|
|||
setTriggerAdcMode(TRIGGER_ADC_ADC);
|
||||
|
||||
CsvReader reader(1, 0);
|
||||
int indices[2] = {0, 1};
|
||||
reader.open("tests/trigger/resources/trigger_adc_1.csv", indices);
|
||||
|
||||
reader.open("tests/trigger/resources/trigger_adc_1.csv");
|
||||
simulateTrigger(trigAdcState, reader, 2.0f, 3.3f);
|
||||
|
||||
ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
|
||||
|
|
Loading…
Reference in New Issue