mirror of https://github.com/rusefi/rusefi.git
parent
60435b063a
commit
57baf7517b
|
@ -23,14 +23,11 @@ TEST(real4g93, cranking) {
|
||||||
engineConfiguration->skippedWheelOnCam = false;
|
engineConfiguration->skippedWheelOnCam = false;
|
||||||
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
eth.setTriggerType(TT_TOOTHED_WHEEL);
|
||||||
|
|
||||||
int eventCount = 0;
|
|
||||||
bool gotRpm = false;
|
bool gotRpm = false;
|
||||||
bool gotSync = false;
|
bool gotSync = false;
|
||||||
|
|
||||||
while (reader.haveMore()) {
|
while (reader.haveMore()) {
|
||||||
reader.processLine(ð);
|
reader.processLine(ð);
|
||||||
eventCount++;
|
|
||||||
engine->rpmCalculator.onSlowCallback();
|
|
||||||
|
|
||||||
// Expect that all teeth are in the correct spot
|
// Expect that all teeth are in the correct spot
|
||||||
|
|
||||||
|
@ -39,14 +36,14 @@ TEST(real4g93, cranking) {
|
||||||
gotRpm = true;
|
gotRpm = true;
|
||||||
|
|
||||||
// We should get first RPM on exactly the first sync point - this means the instant RPM pre-sync event copy all worked OK
|
// We should get first RPM on exactly the first sync point - this means the instant RPM pre-sync event copy all worked OK
|
||||||
EXPECT_EQ(eventCount, 6);
|
EXPECT_EQ(reader.lineIndex(), 6);
|
||||||
EXPECT_NEAR(rpm, 132.77f, 0.1);
|
EXPECT_NEAR(rpm, 132.77f, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gotSync && engine->triggerCentral.triggerState.hasSynchronizedPhase()) {
|
if (!gotSync && engine->triggerCentral.triggerState.hasSynchronizedPhase()) {
|
||||||
gotSync = true;
|
gotSync = true;
|
||||||
|
|
||||||
EXPECT_EQ(eventCount, 17);
|
EXPECT_EQ(reader.lineIndex(), 17);
|
||||||
EXPECT_NEAR(rpm, 204.01f, 0.1);
|
EXPECT_NEAR(rpm, 204.01f, 0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,30 +64,26 @@ TEST(real4g93, crankingCamOnly) {
|
||||||
|
|
||||||
eth.setTriggerType(TT_MITSU_4G9x_CAM);
|
eth.setTriggerType(TT_MITSU_4G9x_CAM);
|
||||||
|
|
||||||
int eventCount = 0;
|
|
||||||
bool gotRpm = false;
|
bool gotRpm = false;
|
||||||
bool gotSync = false;
|
bool gotSync = false;
|
||||||
|
|
||||||
while (reader.haveMore()) {
|
while (reader.haveMore()) {
|
||||||
reader.processLine(ð);
|
reader.processLine(ð);
|
||||||
eventCount++;
|
|
||||||
engine->rpmCalculator.onSlowCallback();
|
|
||||||
|
|
||||||
// Expect that all teeth are in the correct spot
|
// Expect that all teeth are in the correct spot
|
||||||
|
|
||||||
auto rpm = Sensor::getOrZero(SensorType::Rpm);
|
auto rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||||
if (!gotRpm && rpm) {
|
if (!gotRpm && rpm) {
|
||||||
gotRpm = true;
|
gotRpm = true;
|
||||||
|
|
||||||
// We should get first RPM on exactly the first sync point - this means the instant RPM pre-sync event copy all worked OK
|
// We should get first RPM on exactly the first sync point - this means the instant RPM pre-sync event copy all worked OK
|
||||||
EXPECT_EQ(eventCount, 17);
|
EXPECT_EQ(reader.lineIndex(), 17);
|
||||||
EXPECT_NEAR(rpm, 194.61f, 0.1);
|
EXPECT_NEAR(rpm, 194.61f, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gotSync && engine->triggerCentral.triggerState.getShaftSynchronized() && engine->triggerCentral.triggerState.hasSynchronizedPhase()) {
|
if (!gotSync && engine->triggerCentral.triggerState.getShaftSynchronized() && engine->triggerCentral.triggerState.hasSynchronizedPhase()) {
|
||||||
gotSync = true;
|
gotSync = true;
|
||||||
|
|
||||||
EXPECT_EQ(eventCount, 17);
|
EXPECT_EQ(reader.lineIndex(), 17);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue