migrating to googletest

This commit is contained in:
rusefi 2019-01-14 15:45:35 -05:00
parent 8fa3d4c3a5
commit 2bc8e592e2
7 changed files with 78 additions and 78 deletions

View File

@ -117,7 +117,7 @@ void resizeMap(void) {
// } // }
// } // }
// assertEquals(15, interpolate3d(1.2, engineConfiguration->fuelKeyBins, FUEL_MAF_COUNT, 8000, // ASSERT_EQ(15, interpolate3d(1.2, engineConfiguration->fuelKeyBins, FUEL_MAF_COUNT, 8000,
// engineConfiguration->fuelRpmBins, // engineConfiguration->fuelRpmBins,
// FUEL_RPM_COUNT, fuel_ptrs)); // FUEL_RPM_COUNT, fuel_ptrs));

View File

@ -25,10 +25,10 @@ TEST(sensors, testFasterEngineSpinningUp) {
setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth, IM_SEQUENTIAL); setupSimpleTestEngineWithMafAndTT_ONE_trigger(&eth, IM_SEQUENTIAL);
// check if it's true // check if it's true
assertEquals(IM_SEQUENTIAL, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); ASSERT_EQ(IM_SEQUENTIAL, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE));
assertEquals(IM_INDIVIDUAL_COILS, getIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); ASSERT_EQ(IM_INDIVIDUAL_COILS, getIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE));
// check if the engine has the right state // check if the engine has the right state
assertEquals(STOPPED, engine->rpmCalculator.getState()); ASSERT_EQ(STOPPED, engine->rpmCalculator.getState());
// check RPM // check RPM
assertEqualsM("RPM=0", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); assertEqualsM("RPM=0", 0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
// the queue should be empty, no trigger events yet // the queue should be empty, no trigger events yet
@ -84,11 +84,11 @@ TEST(sensors, testFasterEngineSpinningUp) {
eth.fireTriggerEventsWithDuration(60); eth.fireTriggerEventsWithDuration(60);
// check if the mode is now changed to 'running' at higher RPM // check if the mode is now changed to 'running' at higher RPM
assertEquals(RUNNING, engine->rpmCalculator.getState()); ASSERT_EQ(RUNNING, engine->rpmCalculator.getState());
// check RPM // check RPM
assertEqualsM("RPM#3", 1000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); assertEqualsM("RPM#3", 1000, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
// check if the injection mode is back to sequential now // check if the injection mode is back to sequential now
assertEquals(IM_SEQUENTIAL, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); ASSERT_EQ(IM_SEQUENTIAL, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE));
// 4 sequential injections for the full cycle // 4 sequential injections for the full cycle
assertEqualsM("plain#3", 8, engine->executor.size()); assertEqualsM("plain#3", 8, engine->executor.size());

View File

@ -25,17 +25,17 @@ TEST(idle, pid) {
assertEqualsM("getValue#10", 10, pid.getValue(14, 16, 0.1)); assertEqualsM("getValue#10", 10, pid.getValue(14, 16, 0.1));
assertEquals(10, pid.getValue(14, 16, 1)); ASSERT_EQ(10, pid.getValue(14, 16, 1));
pid.updateFactors(29, 0, 0); pid.updateFactors(29, 0, 0);
assertEquals(10, pid.getValue(14, 16, 1)); ASSERT_EQ(10, pid.getValue(14, 16, 1));
// assertEquals(68, pid.getIntegration()); // ASSERT_EQ(68, pid.getIntegration());
assertEquals(10, pid.getValue(14, 16, 1)); ASSERT_EQ(10, pid.getValue(14, 16, 1));
// assertEquals(0, pid.getIntegration()); // ASSERT_EQ(0, pid.getIntegration());
assertEquals(10, pid.getValue(14, 16, 1)); ASSERT_EQ(10, pid.getValue(14, 16, 1));
// assertEquals(68, pid.getIntegration()); // ASSERT_EQ(68, pid.getIntegration());

View File

@ -70,18 +70,18 @@ static void testParsing(void) {
element = pool.parseExpression("1 3 AND not"); element = pool.parseExpression("1 3 AND not");
ASSERT_TRUE(element != NULL); ASSERT_TRUE(element != NULL);
assertEquals(element->action, LE_NUMERIC_VALUE); ASSERT_EQ(element->action, LE_NUMERIC_VALUE);
assertEquals(element->fValue, 1.0); ASSERT_EQ(element->fValue, 1.0);
element = element->next; element = element->next;
assertEquals(element->action, LE_NUMERIC_VALUE); ASSERT_EQ(element->action, LE_NUMERIC_VALUE);
assertEquals(element->fValue, 3.0); ASSERT_EQ(element->fValue, 3.0);
element = element->next; element = element->next;
assertEquals(element->action, LE_OPERATOR_AND); ASSERT_EQ(element->action, LE_OPERATOR_AND);
element = element->next; element = element->next;
assertEquals(element->action, LE_OPERATOR_NOT); ASSERT_EQ(element->action, LE_OPERATOR_NOT);
element = element->next; element = element->next;
ASSERT_TRUE(element == NULL); ASSERT_TRUE(element == NULL);
@ -195,9 +195,9 @@ TEST(misc, testLogicExpressions) {
LECalculator c; LECalculator c;
assertEqualsM("that expression", 1, c.getValue2(0, element PASS_ENGINE_PARAMETER_SUFFIX)); assertEqualsM("that expression", 1, c.getValue2(0, element PASS_ENGINE_PARAMETER_SUFFIX));
assertEquals(12, c.currentCalculationLogPosition); ASSERT_EQ(12, c.currentCalculationLogPosition);
assertEquals(102, c.calcLogAction[0]); ASSERT_EQ(102, c.calcLogAction[0]);
assertEquals(0, c.calcLogValue[0]); ASSERT_EQ(0, c.calcLogValue[0]);
} }
testExpression("coolant", 100); testExpression("coolant", 100);

View File

@ -52,15 +52,15 @@ static void testSignalExecutor2(void) {
eq.insertTask(&p2.s, 0, (schfunc_t) complexCallback, &p2); eq.insertTask(&p2.s, 0, (schfunc_t) complexCallback, &p2);
eq.executeAll(complexTestNow); eq.executeAll(complexTestNow);
assertEqualsM("callbackCounter #1", 2, callbackCounter); assertEqualsM("callbackCounter #1", 2, callbackCounter);
assertEquals(2, eq.size()); ASSERT_EQ(2, eq.size());
eq.executeAll(complexTestNow = 2); eq.executeAll(complexTestNow = 2);
assertEqualsM("callbackCounter #2", 3, callbackCounter); assertEqualsM("callbackCounter #2", 3, callbackCounter);
assertEquals(2, eq.size()); ASSERT_EQ(2, eq.size());
eq.executeAll(complexTestNow = 3); eq.executeAll(complexTestNow = 3);
assertEqualsM("callbackCounter #3", 4, callbackCounter); assertEqualsM("callbackCounter #3", 4, callbackCounter);
assertEquals(2, eq.size()); ASSERT_EQ(2, eq.size());
} }
@ -96,7 +96,7 @@ TEST(misc, testSignalExecutor) {
print("*************************************** testSignalExecutor\r\n"); print("*************************************** testSignalExecutor\r\n");
eq.clear(); eq.clear();
assertEquals(EMPTY_QUEUE, eq.getNextEventTime(0)); ASSERT_EQ(EMPTY_QUEUE, eq.getNextEventTime(0));
scheduling_s s1; scheduling_s s1;
scheduling_s s2; scheduling_s s2;
scheduling_s s3; scheduling_s s3;
@ -107,11 +107,11 @@ TEST(misc, testSignalExecutor) {
eq.insertTask(&s3, 12, callback, NULL); eq.insertTask(&s3, 12, callback, NULL);
eq.insertTask(&s2, 11, callback, NULL); eq.insertTask(&s2, 11, callback, NULL);
assertEquals(4, eq.size()); ASSERT_EQ(4, eq.size());
assertEquals(10, eq.getHead()->momentX); ASSERT_EQ(10, eq.getHead()->momentX);
assertEquals(10, eq.getHead()->next->momentX); ASSERT_EQ(10, eq.getHead()->next->momentX);
assertEquals(11, eq.getHead()->next->next->momentX); ASSERT_EQ(11, eq.getHead()->next->next->momentX);
assertEquals(12, eq.getHead()->next->next->next->momentX); ASSERT_EQ(12, eq.getHead()->next->next->next->momentX);
callbackCounter = 0; callbackCounter = 0;
eq.executeAll(10); eq.executeAll(10);
@ -120,7 +120,7 @@ TEST(misc, testSignalExecutor) {
eq.executeAll(11); eq.executeAll(11);
assertEqualsM("callbackCounter/1#1", 1, callbackCounter); assertEqualsM("callbackCounter/1#1", 1, callbackCounter);
eq.executeAll(100); eq.executeAll(100);
assertEquals(0, eq.size()); ASSERT_EQ(0, eq.size());
eq.insertTask(&s1, 12, callback, NULL); eq.insertTask(&s1, 12, callback, NULL);
eq.insertTask(&s2, 11, callback, NULL); eq.insertTask(&s2, 11, callback, NULL);
@ -130,31 +130,31 @@ TEST(misc, testSignalExecutor) {
assertEqualsM("callbackCounter/1#2", 1, callbackCounter); assertEqualsM("callbackCounter/1#2", 1, callbackCounter);
callbackCounter = 0; callbackCounter = 0;
eq.executeAll(11); eq.executeAll(11);
assertEquals(1, callbackCounter); ASSERT_EQ(1, callbackCounter);
eq.executeAll(100); eq.executeAll(100);
assertEquals(0, eq.size()); ASSERT_EQ(0, eq.size());
callbackCounter = 0; callbackCounter = 0;
eq.insertTask(&s1, 10, callback, NULL); eq.insertTask(&s1, 10, callback, NULL);
assertEquals(10, eq.getNextEventTime(0)); ASSERT_EQ(10, eq.getNextEventTime(0));
eq.executeAll(1); eq.executeAll(1);
assertEqualsM("callbacks not expected", 0, callbackCounter); assertEqualsM("callbacks not expected", 0, callbackCounter);
eq.executeAll(11); eq.executeAll(11);
assertEquals(1, callbackCounter); ASSERT_EQ(1, callbackCounter);
assertEquals(EMPTY_QUEUE, eq.getNextEventTime(0)); ASSERT_EQ(EMPTY_QUEUE, eq.getNextEventTime(0));
eq.insertTask(&s1, 10, callback, NULL); eq.insertTask(&s1, 10, callback, NULL);
eq.insertTask(&s2, 13, callback, NULL); eq.insertTask(&s2, 13, callback, NULL);
assertEquals(10, eq.getNextEventTime(0)); ASSERT_EQ(10, eq.getNextEventTime(0));
eq.executeAll(1); eq.executeAll(1);
assertEquals(10, eq.getNextEventTime(0)); ASSERT_EQ(10, eq.getNextEventTime(0));
eq.executeAll(100); eq.executeAll(100);
assertEquals(0, eq.size()); ASSERT_EQ(0, eq.size());
callbackCounter = 0; callbackCounter = 0;
// both events are scheduled for the same time // both events are scheduled for the same time
eq.insertTask(&s1, 10, callback, NULL); eq.insertTask(&s1, 10, callback, NULL);
@ -162,6 +162,6 @@ TEST(misc, testSignalExecutor) {
eq.executeAll(11); eq.executeAll(11);
assertEquals(2, callbackCounter); ASSERT_EQ(2, callbackCounter);
testSignalExecutor2(); testSignalExecutor2();
} }

View File

@ -66,7 +66,7 @@ static void testDodgeNeonDecoder(void) {
EXPAND_EngineTestHelper; EXPAND_EngineTestHelper;
TriggerShape * shape = &eth.engine.triggerCentral.triggerShape; TriggerShape * shape = &eth.engine.triggerCentral.triggerShape;
assertEquals(8, shape->getTriggerShapeSynchPointIndex()); ASSERT_EQ(8, shape->getTriggerShapeSynchPointIndex());
TriggerState state; TriggerState state;
@ -90,11 +90,11 @@ static void testDodgeNeonDecoder(void) {
// processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_RISING, r + 60); // processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_RISING, r + 60);
// processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_FALLING, r + 210); // processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_FALLING, r + 210);
// ASSERT_TRUE(state.shaft_is_synchronized); // ASSERT_TRUE(state.shaft_is_synchronized);
// assertEquals(0, state.current_index); // ASSERT_EQ(0, state.current_index);
// processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_RISING, r + 420); // processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_RISING, r + 420);
// assertEquals(1, state.current_index); // ASSERT_EQ(1, state.current_index);
// processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_FALLING, r + 630); // processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_FALLING, r + 630);
// assertEquals(2, state.current_index); // ASSERT_EQ(2, state.current_index);
// //
// printf("3rd camshaft revolution\r\n"); // printf("3rd camshaft revolution\r\n");
// r = 2 * 720; // r = 2 * 720;
@ -128,9 +128,9 @@ TEST(misc, testSomethingWeird) {
assertFalseM("shaft_is_synchronized", sta->shaft_is_synchronized); // still no synchronization assertFalseM("shaft_is_synchronized", sta->shaft_is_synchronized); // still no synchronization
sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, ++r PASS_ENGINE_PARAMETER_SUFFIX); sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, ++r PASS_ENGINE_PARAMETER_SUFFIX);
ASSERT_TRUE(sta->shaft_is_synchronized); // first signal rise synchronize ASSERT_TRUE(sta->shaft_is_synchronized); // first signal rise synchronize
assertEquals(0, sta->getCurrentIndex()); ASSERT_EQ(0, sta->getCurrentIndex());
sta->decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX); sta->decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
assertEquals(1, sta->getCurrentIndex()); ASSERT_EQ(1, sta->getCurrentIndex());
for (int i = 2; i < 10;) { for (int i = 2; i < 10;) {
sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX); sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
@ -140,13 +140,13 @@ TEST(misc, testSomethingWeird) {
} }
sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX); sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
assertEquals(10, sta->getCurrentIndex()); ASSERT_EQ(10, sta->getCurrentIndex());
sta->decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX); sta->decodeTriggerEvent(SHAFT_PRIMARY_FALLING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
assertEquals(11, sta->getCurrentIndex()); ASSERT_EQ(11, sta->getCurrentIndex());
sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX); sta->decodeTriggerEvent(SHAFT_PRIMARY_RISING, r++ PASS_ENGINE_PARAMETER_SUFFIX);
assertEquals(0, sta->getCurrentIndex()); // new revolution ASSERT_EQ(0, sta->getCurrentIndex()); // new revolution
} }
TEST(misc, test1995FordInline6TriggerDecoder) { TEST(misc, test1995FordInline6TriggerDecoder) {
@ -203,8 +203,8 @@ TEST(misc, testFordAspire) {
assertEqualsM("getTriggerShapeSynchPointIndex", 4, TRIGGER_SHAPE(getTriggerShapeSynchPointIndex())); assertEqualsM("getTriggerShapeSynchPointIndex", 4, TRIGGER_SHAPE(getTriggerShapeSynchPointIndex()));
assertEquals(800, config->fuelRpmBins[0]); ASSERT_EQ(800, config->fuelRpmBins[0]);
assertEquals(7000, config->fuelRpmBins[15]); ASSERT_EQ(7000, config->fuelRpmBins[15]);
engineConfiguration->crankingChargeAngle = 65; engineConfiguration->crankingChargeAngle = 65;
engineConfiguration->crankingTimingAngle = 31; engineConfiguration->crankingTimingAngle = 31;
@ -283,7 +283,7 @@ TEST(misc, testStartupFuelPumping) {
} }
static void assertREquals(void *expected, void *actual) { static void assertREquals(void *expected, void *actual) {
assertEquals((float)(uint64_t)expected, (float)(uint64_t)actual); ASSERT_EQ((float)(uint64_t)expected, (float)(uint64_t)actual);
} }
static void assertREqualsM(const char *msg, void *expected, void *actual) { static void assertREqualsM(const char *msg, void *expected, void *actual) {
@ -315,11 +315,11 @@ TEST(misc, testRpmCalculator) {
engine->sensors.clt = 70; // 'testCltValue' does not give us exact number so we have to hack here. todo: migrate test engine->sensors.clt = 70; // 'testCltValue' does not give us exact number so we have to hack here. todo: migrate test
engine->sensors.iat = 30; // 'testIatValue' does not give us exact number so we have to hack here. todo: migrate test engine->sensors.iat = 30; // 'testIatValue' does not give us exact number so we have to hack here. todo: migrate test
assertEquals(0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); ASSERT_EQ(0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
// triggerIndexByAngle update is now fixed! prepareOutputSignals() wasn't reliably called // triggerIndexByAngle update is now fixed! prepareOutputSignals() wasn't reliably called
assertEquals(5, TRIGGER_SHAPE(triggerIndexByAngle[240])); ASSERT_EQ(5, TRIGGER_SHAPE(triggerIndexByAngle[240]));
assertEquals(5, TRIGGER_SHAPE(triggerIndexByAngle[241])); ASSERT_EQ(5, TRIGGER_SHAPE(triggerIndexByAngle[241]));
eth.fireTriggerEvents(/* count */ 48); eth.fireTriggerEvents(/* count */ 48);
@ -331,7 +331,7 @@ TEST(misc, testRpmCalculator) {
debugSignalExecutor = true; debugSignalExecutor = true;
assertEquals(engine->triggerCentral.triggerState.shaft_is_synchronized, 1); ASSERT_EQ(engine->triggerCentral.triggerState.shaft_is_synchronized, 1);
eth.moveTimeForwardUs(MS2US(5)); // 5ms eth.moveTimeForwardUs(MS2US(5)); // 5ms
@ -345,7 +345,7 @@ TEST(misc, testRpmCalculator) {
assertEqualsM("injection angle", 31.365, ie0->injectionStart.angleOffset); assertEqualsM("injection angle", 31.365, ie0->injectionStart.angleOffset);
eth.firePrimaryTriggerRise(); eth.firePrimaryTriggerRise();
assertEquals(1500, eth.engine.rpmCalculator.rpmValue); ASSERT_EQ(1500, eth.engine.rpmCalculator.rpmValue);
assertEqualsM("dwell", 4.5, engine->engineState.dwellAngle); assertEqualsM("dwell", 4.5, engine->engineState.dwellAngle);
assertEqualsM("fuel #2", 4.5450, engine->injectionDuration); assertEqualsM("fuel #2", 4.5450, engine->injectionDuration);
@ -382,8 +382,8 @@ TEST(misc, testRpmCalculator) {
assertEqualsM("3/3", start + 14777, engine->executor.getForUnitTest(2)->momentX); assertEqualsM("3/3", start + 14777, engine->executor.getForUnitTest(2)->momentX);
engine->executor.clear(); engine->executor.clear();
assertEquals(5, TRIGGER_SHAPE(triggerIndexByAngle[240])); ASSERT_EQ(5, TRIGGER_SHAPE(triggerIndexByAngle[240]));
assertEquals(5, TRIGGER_SHAPE(triggerIndexByAngle[241])); ASSERT_EQ(5, TRIGGER_SHAPE(triggerIndexByAngle[241]));
eth.fireFall(5); eth.fireFall(5);
@ -399,7 +399,7 @@ TEST(misc, testRpmCalculator) {
assertEqualsM("dwell", 4.5, eth.engine.engineState.dwellAngle); assertEqualsM("dwell", 4.5, eth.engine.engineState.dwellAngle);
assertEqualsM("fuel #3", 4.5450, eth.engine.injectionDuration); assertEqualsM("fuel #3", 4.5450, eth.engine.injectionDuration);
assertEquals(1500, eth.engine.rpmCalculator.rpmValue); ASSERT_EQ(1500, eth.engine.rpmCalculator.rpmValue);
eth.assertInjectorUpEvent("ev 0/2", 0, -4849, 2); eth.assertInjectorUpEvent("ev 0/2", 0, -4849, 2);
@ -460,10 +460,10 @@ TEST(misc, testTriggerDecoder) {
initializeSkippedToothTriggerShapeExt(s, 2, 0, FOUR_STROKE_CAM_SENSOR); initializeSkippedToothTriggerShapeExt(s, 2, 0, FOUR_STROKE_CAM_SENSOR);
assertEqualsM("shape size", s->getSize(), 4); assertEqualsM("shape size", s->getSize(), 4);
assertEquals(s->wave.switchTimes[0], 0.25); ASSERT_EQ(s->wave.switchTimes[0], 0.25);
assertEquals(s->wave.switchTimes[1], 0.5); ASSERT_EQ(s->wave.switchTimes[1], 0.5);
assertEquals(s->wave.switchTimes[2], 0.75); ASSERT_EQ(s->wave.switchTimes[2], 0.75);
assertEquals(s->wave.switchTimes[3], 1); ASSERT_EQ(s->wave.switchTimes[3], 1);
printf("====================================================================================== testTriggerDecoder part 2\r\n"); printf("====================================================================================== testTriggerDecoder part 2\r\n");
testDodgeNeonDecoder(); testDodgeNeonDecoder();
@ -513,21 +513,21 @@ TEST(misc, testTriggerDecoder) {
// TriggerShape *t = &eth.engine.triggerShape; // TriggerShape *t = &eth.engine.triggerShape;
// assertEquals(1, t->eventAngles[1]); // ASSERT_EQ(1, t->eventAngles[1]);
// assertEqualsM("index at 0", 0, t->triggerIndexByAngle[56]); // assertEqualsM("index at 0", 0, t->triggerIndexByAngle[56]);
// assertEqualsM("index at 1", 1, t->triggerIndexByAngle[57]); // assertEqualsM("index at 1", 1, t->triggerIndexByAngle[57]);
// //
// assertEquals(270, t->eventAngles[5]); // ASSERT_EQ(270, t->eventAngles[5]);
// assertEqualsM("index at 269", 4, t->triggerIndexByAngle[269]); // assertEqualsM("index at 269", 4, t->triggerIndexByAngle[269]);
// assertEqualsM("index at 270", 5, t->triggerIndexByAngle[270]); // assertEqualsM("index at 270", 5, t->triggerIndexByAngle[270]);
// assertEqualsM("index at 271", 5, t->triggerIndexByAngle[271]); // assertEqualsM("index at 271", 5, t->triggerIndexByAngle[271]);
// //
// assertEquals(306, t->eventAngles[6]); // ASSERT_EQ(306, t->eventAngles[6]);
// assertEquals(5, t->triggerIndexByAngle[305]); // ASSERT_EQ(5, t->triggerIndexByAngle[305]);
// assertEquals(6, t->triggerIndexByAngle[306]); // ASSERT_EQ(6, t->triggerIndexByAngle[306]);
// assertEquals(6, t->triggerIndexByAngle[307]); // ASSERT_EQ(6, t->triggerIndexByAngle[307]);
// //
// assertEquals(666, t->eventAngles[11]); // ASSERT_EQ(666, t->eventAngles[11]);
// assertEqualsM("index for 665", 10, t->triggerIndexByAngle[665]); // assertEqualsM("index for 665", 10, t->triggerIndexByAngle[665]);
// assertEqualsM("index for 668", 11, t->triggerIndexByAngle[668]); // assertEqualsM("index for 668", 11, t->triggerIndexByAngle[668]);
@ -592,7 +592,7 @@ void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, inject
timeNowUs = 0; timeNowUs = 0;
eth->clearQueue(); eth->clearQueue();
assertEquals(LM_PLAIN_MAF, engineConfiguration->fuelAlgorithm); ASSERT_EQ(LM_PLAIN_MAF, engineConfiguration->fuelAlgorithm);
engineConfiguration->isIgnitionEnabled = false; // let's focus on injection engineConfiguration->isIgnitionEnabled = false; // let's focus on injection
engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.cylindersCount = 4;
// a bit of flexibility - the mode may be changed by some tests // a bit of flexibility - the mode may be changed by some tests
@ -750,7 +750,7 @@ TEST(big, testFuelSchedulerBug299smallAndMedium) {
int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue); int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue);
assertEquals(8, engineLoadIndex); ASSERT_EQ(8, engineLoadIndex);
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 25); setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 25);
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 25); setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 25);
@ -999,7 +999,7 @@ TEST(big, testDifferentInjectionModes) {
// set fuel map values - extract method? // set fuel map values - extract method?
int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue); int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue);
assertEquals(8, engineLoadIndex); ASSERT_EQ(8, engineLoadIndex);
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 40); setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 40);
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 40); setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 40);
@ -1031,7 +1031,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) {
// set fuel map values - extract method? // set fuel map values - extract method?
int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue); int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue);
assertEquals(8, engineLoadIndex); ASSERT_EQ(8, engineLoadIndex);
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 35); setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 35);
setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 35); setArrayValues(fuelMap.pointers[engineLoadIndex + 1], FUEL_RPM_COUNT, 35);
@ -1286,7 +1286,7 @@ TEST(big, testMissedSpark299) {
printf("*************************************************** testMissedSpark299 start\r\n"); printf("*************************************************** testMissedSpark299 start\r\n");
assertEquals(3000, eth.engine.rpmCalculator.rpmValue); ASSERT_EQ(3000, eth.engine.rpmCalculator.rpmValue);
setWholeTimingTable(3); setWholeTimingTable(3);
eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);

View File

@ -182,7 +182,7 @@ TEST(big, testNoiselessDecoder) {
incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE);
eth.applyTriggerShape(); eth.applyTriggerShape();
assertEquals(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter); ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter);
assertEqualsM("testNoiselessDecoder RPM", 0, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); assertEqualsM("testNoiselessDecoder RPM", 0, eth.engine.rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE));
//printTriggerDebug = true; //printTriggerDebug = true;