From d69e796c3767527d7007974e5d342f258ebf3496 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 12 Jan 2019 15:51:40 -0500 Subject: [PATCH] Question: something strange trigger errors #662 unit test progress --- unit_tests/engine_test_helper.cpp | 2 +- unit_tests/tests/test_trigger_decoder.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 7c4a5102c8..f46f054a1e 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -64,7 +64,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType) : engine (&persiste engine->engineConfigurationPtr->clt.adcChannel = (adc_channel_e)TEST_CLT_CHANNEL; engine->engineConfigurationPtr->iat.adcChannel = (adc_channel_e)TEST_IAT_CHANNEL; testCltValue = 1.492964; -// testIatValue = 1.492964; + testIatValue = 4.03646; // this is needed to have valid CLT and IAT. engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); diff --git a/unit_tests/tests/test_trigger_decoder.cpp b/unit_tests/tests/test_trigger_decoder.cpp index 32bf6b6d31..0eee406087 100644 --- a/unit_tests/tests/test_trigger_decoder.cpp +++ b/unit_tests/tests/test_trigger_decoder.cpp @@ -185,10 +185,10 @@ void test1995FordInline6TriggerDecoder(void) { IgnitionEventList *ecl = &engine->ignitionEvents; assertEqualsM("ford inline ignition events size", 1, ecl->isReady); assertEqualsM("event index", 0, ecl->elements[0].dwellPosition.eventIndex); - assertEqualsM("angle offset#1", 7, ecl->elements[0].dwellPosition.angleOffset); + assertEqualsM("angle offset#1", 7.8621, ecl->elements[0].dwellPosition.angleOffset); assertEqualsM("event index", 10, ecl->elements[5].dwellPosition.eventIndex); - assertEqualsM("angle offset#2", 7, ecl->elements[5].dwellPosition.angleOffset); + assertEqualsM("angle offset#2", 7.8621, ecl->elements[5].dwellPosition.angleOffset); assertEqualsM("running dwell", 0.5, getSparkDwell(2000 PASS_ENGINE_PARAMETER_SUFFIX)); @@ -314,6 +314,7 @@ void testRpmCalculator(void) { engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); 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 assertEquals(0, engine->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)); @@ -1249,7 +1250,7 @@ TEST(big, testMissedSpark299) { engineConfiguration->isIgnitionEnabled = true; engineConfiguration->isInjectionEnabled = false; - assertEqualsM("warningCounter#0", 2, unitTestWarningCodeState.warningCounter); + assertEqualsM("warningCounter#0", 0, unitTestWarningCodeState.warningCounter); eth.fireRise(20); @@ -1319,5 +1320,6 @@ TEST(big, testMissedSpark299) { eth.fireFall(20); eth.executeActions(); - assertEqualsM("warningCounter#1", 3, unitTestWarningCodeState.warningCounter); + assertEqualsM("warningCounter#1", 1, unitTestWarningCodeState.warningCounter); + assertEqualsM("warningCounter code", CUSTOM_SYNC_COUNT_MISMATCH, unitTestWarningCodeState.recentWarning.get(0)); }