parent
1908896598
commit
633274055b
|
@ -389,7 +389,7 @@ void EngineTestHelper::executeUntil(int timeUs) {
|
|||
|
||||
void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) {
|
||||
setCamOperationMode();
|
||||
setupSimpleTestEngineWithMaf(eth, injectionMode, TT_ONE);
|
||||
setupSimpleTestEngineWithMaf(eth, injectionMode, trigger_type_e::TT_ONE);
|
||||
}
|
||||
|
||||
void setVerboseTrigger(bool isEnabled) {
|
||||
|
|
|
@ -40,7 +40,7 @@ TEST(fuelControl, transitionIssue1592) {
|
|||
// This is easiest to trip on a wheel that requires sync
|
||||
engineConfiguration->trigger.customTotalToothCount = 6;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
|
||||
setCamOperationMode();
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ TEST(fuel, testWallWettingEnrichmentScheduling) {
|
|||
|
||||
setCrankOperationMode();
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
|
||||
|
||||
eth.fireTriggerEvents2(/* count */ 4, 25 /* ms */);
|
||||
|
|
|
@ -16,7 +16,7 @@ TEST(issues, issueOneCylinderSpecialCase968) {
|
|||
|
||||
setCrankOperationMode();
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
|
||||
ASSERT_EQ( 0, engine->executor.size()) << "start";
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ TEST(fuel, testTpsAccelEnrichmentScheduling) {
|
|||
engineConfiguration->tpsAccelEnrichmentThreshold = 5;
|
||||
engineConfiguration->tpsAccelLookback = 2;
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
|
||||
|
||||
Sensor::setMockValue(SensorType::Tps1, 0);
|
||||
|
|
|
@ -19,7 +19,7 @@ TEST(HPFP, IntegratedSchedule) {
|
|||
|
||||
engineConfiguration->trigger.customTotalToothCount = 16;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
|
||||
setCamOperationMode();
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ TEST(sensors, test2jz) {
|
|||
EngineTestHelper eth(engine_type_e::TOYOTA_2JZ_GTE_VVTi);
|
||||
engineConfiguration->isFasterEngineSpinUpEnabled = false;
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "test2jz RPM";
|
||||
for (int i = 0; i < 2;i++) {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//#define TEST_FROM_TRIGGER_ID ((int)TT_UNUSED - 1)
|
||||
#define TEST_FROM_TRIGGER_ID 1
|
||||
|
||||
#define TEST_TO_TRIGGER_ID TT_UNUSED
|
||||
#define TEST_TO_TRIGGER_ID trigger_type_e::TT_UNUSED
|
||||
// uncomment to test only one trigger
|
||||
//#define TEST_TO_TRIGGER_ID (TEST_FROM_TRIGGER_ID + 1)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ extern WaveChart waveChart;
|
|||
TEST(trigger, testNoStartUpWarningsNoSyncronizationTrigger) {
|
||||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||
// one tooth does not need synchronization it just counts tooth
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testNoStartUpWarnings RPM";
|
||||
|
||||
eth.fireTriggerEvents2(/*count*/10, /*duration*/50);
|
||||
|
@ -28,7 +28,7 @@ TEST(trigger, testNoStartUpWarnings) {
|
|||
// for this test we need a trigger with isSynchronizationNeeded=true
|
||||
engineConfiguration->trigger.customTotalToothCount = 3;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 1;
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
|
||||
ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testNoStartUpWarnings RPM";
|
||||
|
||||
for (int i = 0;i < 10;i++) {
|
||||
|
@ -86,7 +86,7 @@ TEST(trigger, testCamInput) {
|
|||
setCrankOperationMode();
|
||||
engineConfiguration->vvtMode[0] = VVT_FIRST_HALF;
|
||||
engineConfiguration->vvtOffsets[0] = 360;
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
engineConfiguration->camInputs[0] = Gpio::A10; // we just need to indicate that we have CAM
|
||||
|
||||
ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testCamInput RPM";
|
||||
|
|
|
@ -17,7 +17,7 @@ TEST(subaru, overrideGap) {
|
|||
engineConfiguration->triggerGapOverrideFrom[1] = 0.75;
|
||||
engineConfiguration->triggerGapOverrideTo[1] = 1.25;
|
||||
|
||||
eth.setTriggerType(TT_SUBARU_7_WITHOUT_6);
|
||||
eth.setTriggerType(trigger_type_e::TT_SUBARU_7_WITHOUT_6);
|
||||
|
||||
ASSERT_EQ(2, engine->triggerCentral.triggerShape.gapTrackingLength);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ TEST(trigger, testQuadCam) {
|
|||
engineConfiguration->camInputs[0] = Gpio::A10; // we just need to indicate that we have CAM
|
||||
|
||||
// this crank trigger would be easier to test, crank shape is less important for this test
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
|
||||
ASSERT_EQ(0, Sensor::getOrZero(SensorType::Rpm));
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ TEST(real4b11, running) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
eth.setTriggerType(TT_36_2_1);
|
||||
eth.setTriggerType(trigger_type_e::TT_36_2_1);
|
||||
|
||||
int eventCount = 0;
|
||||
bool gotRpm = false;
|
||||
|
@ -50,7 +50,7 @@ TEST(real4b11, runningDoubledEdge) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
eth.setTriggerType(TT_36_2_1);
|
||||
eth.setTriggerType(trigger_type_e::TT_36_2_1);
|
||||
|
||||
int eventCount = 0;
|
||||
bool gotRpm = false;
|
||||
|
|
|
@ -18,7 +18,7 @@ TEST(real4g93, cranking) {
|
|||
|
||||
engineConfiguration->vvtMode[0] = VVT_MITSUBISHI_4G63;
|
||||
|
||||
eth.setTriggerType(TT_MITSU_4G63_CRANK);
|
||||
eth.setTriggerType(trigger_type_e::TT_MITSU_4G63_CRANK);
|
||||
|
||||
bool gotRpm = false;
|
||||
bool gotSync = false;
|
||||
|
@ -78,7 +78,7 @@ TEST(real4g93, crankingOn11) {
|
|||
|
||||
engineConfiguration->isPhaseSyncRequiredForIgnition = true;
|
||||
|
||||
eth.setTriggerType(TT_MAZDA_MIATA_NA);
|
||||
eth.setTriggerType(trigger_type_e::TT_MAZDA_MIATA_NA);
|
||||
|
||||
bool gotRpm = false;
|
||||
while (reader.haveMore()) {
|
||||
|
@ -106,7 +106,7 @@ TEST(real4g93, crankingCamOnly) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
eth.setTriggerType(TT_MITSU_4G9x_CAM);
|
||||
eth.setTriggerType(trigger_type_e::TT_MITSU_4G9x_CAM);
|
||||
|
||||
bool gotRpm = false;
|
||||
bool gotSync = false;
|
||||
|
|
|
@ -10,7 +10,7 @@ TEST(crankingGm24x, gmRealCrankingFromFile) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
eth.setTriggerType(TT_GM_24x);
|
||||
eth.setTriggerType(trigger_type_e::TT_GM_24x);
|
||||
|
||||
int eventCount = 0;
|
||||
bool gotRpm = false;
|
||||
|
|
|
@ -10,7 +10,7 @@ static void doTest(const char* testFile, int expectedRpm) {
|
|||
engineConfiguration->isFasterEngineSpinUpEnabled = true;
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
|
||||
eth.setTriggerType(TT_HONDA_K_CRANK_12_1);
|
||||
eth.setTriggerType(trigger_type_e::TT_HONDA_K_CRANK_12_1);
|
||||
|
||||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
|
|
@ -15,7 +15,7 @@ TEST(crankingVW, vwRealCrankingFromFile) {
|
|||
reader.open("tests/trigger/resources/nick_1.csv");
|
||||
EngineTestHelper eth (engine_type_e::VW_ABA);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
eth.setTriggerType(TT_60_2_VW);
|
||||
eth.setTriggerType(trigger_type_e::TT_60_2_VW);
|
||||
|
||||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
@ -28,7 +28,7 @@ TEST(crankingVW, vwRealCrankingFromFile) {
|
|||
TEST(crankingVW, crankingTwiceWithGap) {
|
||||
EngineTestHelper eth (engine_type_e::VW_ABA);
|
||||
engineConfiguration->alwaysInstantRpm = true;
|
||||
eth.setTriggerType(TT_60_2_VW);
|
||||
eth.setTriggerType(trigger_type_e::TT_60_2_VW);
|
||||
|
||||
{
|
||||
CsvReader reader(1, /* vvtCount */ 0);
|
||||
|
|
|
@ -13,7 +13,7 @@ static void runRpmTest(bool isTwoStroke, bool isCam, int expected) {
|
|||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||
engineConfiguration->twoStroke = isTwoStroke;
|
||||
engineConfiguration->skippedWheelOnCam = isCam;
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
|
||||
eth.smartFireTriggerEvents2(/*count*/200, /*delay*/ 40);
|
||||
ASSERT_EQ(expected, Sensor::getOrZero(SensorType::Rpm));
|
||||
|
|
|
@ -48,7 +48,7 @@ TEST(trigger, testSkipped2_0) {
|
|||
// for this test we need a trigger with isSynchronizationNeeded=true
|
||||
engineConfiguration->trigger.customTotalToothCount = 2;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
|
||||
ASSERT_EQ( 0, round(Sensor::getOrZero(SensorType::Rpm))) << "testNoStartUpWarnings RPM";
|
||||
}
|
||||
|
||||
|
@ -969,7 +969,7 @@ TEST(big, testSparkReverseOrderBug319) {
|
|||
// this is needed to update injectorLag
|
||||
engine->updateSlowSensors();
|
||||
|
||||
eth.setTriggerType(TT_ONE);
|
||||
eth.setTriggerType(trigger_type_e::TT_ONE);
|
||||
eth.engine.periodicFastCallback();
|
||||
|
||||
setWholeTimingTable(0);
|
||||
|
|
|
@ -42,7 +42,7 @@ static auto makeTriggerShape(operation_mode_e mode, const TriggerConfiguration&
|
|||
#define doTooth(dut, shape, cfg, t) dut.decodeTriggerEvent("", shape, nullptr, cfg, SHAFT_PRIMARY_RISING, t)
|
||||
|
||||
TEST(TriggerDecoder, FindsFirstSyncPoint) {
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({trigger_type_e::TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -85,7 +85,7 @@ TEST(TriggerDecoder, FindsFirstSyncPoint) {
|
|||
|
||||
|
||||
TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) {
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({trigger_type_e::TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -135,7 +135,7 @@ TEST(TriggerDecoder, FindsSyncPointMultipleRevolutions) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, TooManyTeeth_CausesError) {
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({trigger_type_e::TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -213,7 +213,7 @@ TEST(TriggerDecoder, TooManyTeeth_CausesError) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, NotEnoughTeeth_CausesError) {
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({trigger_type_e::TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -290,7 +290,7 @@ TEST(TriggerDecoder, NotEnoughTeeth_CausesError) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, PrimaryDecoderNoDisambiguation) {
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({trigger_type_e::TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CAM_SENSOR, cfg);
|
||||
|
@ -321,7 +321,7 @@ TEST(TriggerDecoder, PrimaryDecoderNoDisambiguation) {
|
|||
}
|
||||
|
||||
TEST(TriggerDecoder, PrimaryDecoderNeedsDisambiguation) {
|
||||
MockTriggerConfiguration cfg({TT_TOOTHED_WHEEL, 4, 1});
|
||||
MockTriggerConfiguration cfg({trigger_type_e::TT_TOOTHED_WHEEL, 4, 1});
|
||||
cfg.update();
|
||||
|
||||
auto shape = makeTriggerShape(FOUR_STROKE_CRANK_SENSOR, cfg);
|
||||
|
|
|
@ -80,7 +80,7 @@ TEST(big, testTriggerInputAdc) {
|
|||
engineConfiguration->analogInputDividerCoefficient = 2.0f;
|
||||
|
||||
// we'll test on 60-2 wheel
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL_60_2);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL_60_2);
|
||||
|
||||
ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
|
||||
ASSERT_EQ(0, Sensor::getOrZero(SensorType::Rpm)) << "testTriggerInputAdc RPM #1";
|
||||
|
|
|
@ -166,7 +166,7 @@ TEST(trigger, noiselessDecoder) {
|
|||
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
||||
|
||||
// we'll test on 60-2 wheel
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL_60_2);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL_60_2);
|
||||
|
||||
ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
|
||||
ASSERT_EQ( 0, Sensor::getOrZero(SensorType::Rpm)) << "testNoiselessDecoder RPM";
|
||||
|
|
|
@ -7,6 +7,6 @@ TEST(trigger, testCustomSkipped) {
|
|||
|
||||
engineConfiguration->trigger.customTotalToothCount = 24;
|
||||
engineConfiguration->trigger.customSkippedToothCount = 2;
|
||||
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
||||
eth.setTriggerType(trigger_type_e::TT_TOOTHED_WHEEL);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue