auto-sync
This commit is contained in:
parent
6850e4b243
commit
18b2984444
|
@ -741,6 +741,11 @@ static void setTestBug299(EngineTestHelper *eth) {
|
|||
assertEqualsM("maf", 3, getMaf(PASS_ENGINE_PARAMETER_F));
|
||||
}
|
||||
|
||||
static void assertInjectors(const char *msg, int value0, int value1) {
|
||||
assertEqualsM4(msg, "inj#0", value0, enginePins.injectors[0].currentLogicValue);
|
||||
assertEqualsM4(msg, "inj#1", value1, enginePins.injectors[1].currentLogicValue);
|
||||
}
|
||||
|
||||
void testFuelSchedulerBug299smallAndMedium(void) {
|
||||
printf("*************************************************** testFuelSchedulerBug299 small to medium\r\n");
|
||||
|
||||
|
@ -750,6 +755,9 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
|
||||
FuelSchedule * t;
|
||||
|
||||
assertInjectors("#0", 0, 0);
|
||||
|
||||
|
||||
int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue);
|
||||
assertEquals(8, engineLoadIndex);
|
||||
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 25);
|
||||
|
@ -815,40 +823,59 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
assertInjectionEvent("#1", &t->injectionEvents.elements[3], 1, 0, 45 + 90, false);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
assertEqualsM("qs#02", 5, schedulingQueue.size());
|
||||
assertInjectorUpEvent("6@0", 0, MS2US(-12.5), 1);
|
||||
assertInjectorDownEvent("6@1", 1, MS2US(-10.0), 0);
|
||||
assertInjectorUpEvent("6@2", 2, MS2US(-2.5), 0);
|
||||
assertInjectorDownEvent("6@3", 3, MS2US(0), 1);
|
||||
assertInjectorDownEvent("6@4", 4, MS2US(10.0), 0);
|
||||
|
||||
// so placing this 'executeAll' changes much?
|
||||
assertEqualsM("exec#07", 4, schedulingQueue.executeAll(timeNow));
|
||||
|
||||
eth.firePrimaryTriggerRise();
|
||||
assertEqualsM("qs#2", 8, schedulingQueue.size());
|
||||
assertEqualsM("rev cnt6", 6, engine->rpmCalculator.getRevolutionCounter());
|
||||
// time...|-20.....|-10.....|0.......|10......|20......|30......|40......|
|
||||
// inj #0 |########|.....###|########|....####|........|........|........|
|
||||
// inj #1 |.....###|########|.....###|########|........|........|........|
|
||||
assertInjectorUpEvent("6@0", 0, MS2US(-12.5), 1);
|
||||
assertInjectorDownEvent("6@1", 1, MS2US(-10.0), 0);
|
||||
assertInjectorUpEvent("6@2", 2, MS2US(-2.5), 0);
|
||||
assertInjectorDownEvent("6@3", 3, MS2US(0), 1);
|
||||
assertInjectorUpEvent("6@4", 4, MS2US(7.5), 1);
|
||||
assertInjectorDownEvent("6@5", 5, MS2US(10.0), 0);
|
||||
assertInjectorUpEvent("6@6", 6, MS2US(17.5), 0);
|
||||
assertInjectorDownEvent("6@7", 7, MS2US(20.0), 1);
|
||||
assertInjectorDownEvent("06@5", 5, MS2US(30.0), 0);
|
||||
assertInjectorUpEvent("06@6", 6, MS2US(37.5), 0);
|
||||
assertInjectorDownEvent("06@7", 7, MS2US(40.0), 1);
|
||||
|
||||
assertEqualsM("exec#7", 4, schedulingQueue.executeAll(timeNow));
|
||||
assertEqualsM("exec#7", 0, schedulingQueue.executeAll(timeNow));
|
||||
|
||||
assertInjectors("#1", 1, 0);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
eth.firePrimaryTriggerFall();
|
||||
|
||||
assertEqualsM("qs#3", 4, schedulingQueue.size());
|
||||
assertEqualsM("rev cnt6", 6, engine->rpmCalculator.getRevolutionCounter());
|
||||
// time...|-20.....|-10.....|0.......|10......|20......|30......|40......|
|
||||
// inj #0 |........|##......|........|........|........|........|........|
|
||||
// inj #0 |########|.......#|........|........|........|........|........|
|
||||
// inj #1 |....####|########|........|........|........|........|........|
|
||||
assertInjectorUpEvent("7@0", 0, MS2US(-12.5), 1);
|
||||
assertInjectorDownEvent("7@1", 1, MS2US(-10.0), 0);
|
||||
assertInjectorUpEvent("7@2", 2, MS2US(-2.5), 0);
|
||||
assertInjectorDownEvent("7@3", 3, MS2US(0), 1);
|
||||
assertEqualsM("executed #6", 4, schedulingQueue.executeAll(timeNow));
|
||||
|
||||
assertEqualsM("executed #06", 4, schedulingQueue.executeAll(timeNow));
|
||||
assertInjectors("#4", 1, 0);
|
||||
assertEqualsM("qs#06", 4, schedulingQueue.size());
|
||||
assertInjectorUpEvent("17@0", 0, MS2US(7.5), 1);
|
||||
assertInjectorDownEvent("17@1", 1, MS2US(10.0), 0);
|
||||
assertInjectorUpEvent("17@2", 2, MS2US(17.5), 0);
|
||||
assertInjectorDownEvent("17@3", 3, MS2US(20), 1);
|
||||
|
||||
eth.firePrimaryTriggerFall();
|
||||
|
||||
assertEqualsM("qs#3", 4, schedulingQueue.size());
|
||||
assertEqualsM("rev cnt6", 6, engine->rpmCalculator.getRevolutionCounter());
|
||||
assertEqualsM("executed #6", 0, schedulingQueue.executeAll(timeNow));
|
||||
|
||||
|
||||
timeNow += MS2US(20);
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
assertInjectors("#2", 1, 0);
|
||||
|
||||
eth.firePrimaryTriggerRise();
|
||||
assertEqualsM("Queue.size#03", 8, schedulingQueue.size());
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
|
@ -861,6 +888,11 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
assertInjectorDownEvent("07@6", 6, MS2US(40), 1);
|
||||
assertInjectorDownEvent("07@7", 7, MS2US(50), 0);
|
||||
|
||||
assertEqualsM("executeAll#3", 0, schedulingQueue.executeAll(timeNow));
|
||||
timeNow += MS2US(20);
|
||||
assertEqualsM("executeAll#4", 3, schedulingQueue.executeAll(timeNow));
|
||||
|
||||
|
||||
t = ENGINE(engineConfiguration2)->injectionEvents;
|
||||
assertEqualsM("injectionEvents.size", 4, t->injectionEvents.size);
|
||||
assertInjectionEvent("#2", &t->injectionEvents.elements[0], 0, 0, 315, false);
|
||||
|
@ -881,13 +913,25 @@ void testFuelSchedulerBug299smallAndMedium(void) {
|
|||
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
|
||||
assertEqualsM("inj#0", 1, enginePins.injectors[0].currentLogicValue);
|
||||
|
||||
assertEqualsM("Queue.size#04", 5, schedulingQueue.size());
|
||||
assertInjectorUpEvent("08@0", 0, MS2US(7.5), 1);
|
||||
assertInjectorDownEvent("08@1", 1, MS2US(10), 0);
|
||||
assertInjectorUpEvent("08@2", 2, MS2US(17.5), 0);
|
||||
assertInjectorDownEvent("08@3", 3, MS2US(20), 1);
|
||||
assertInjectorDownEvent("08@4", 4, MS2US(30), 0);
|
||||
|
||||
eth.firePrimaryTriggerFall();
|
||||
|
||||
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
eth.firePrimaryTriggerRise();
|
||||
assertEqualsM("Queue.size#05", 8, schedulingQueue.size());
|
||||
schedulingQueue.executeAll(timeNow);
|
||||
|
||||
timeNow += MS2US(20);
|
||||
|
|
Loading…
Reference in New Issue