From 7c7766efcc13fc441cd66a34065f258fd2d89ab2 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sat, 26 Jun 2021 16:05:43 -0400 Subject: [PATCH] VW warnings on cranking #2861 --- unit_tests/engine_test_helper.cpp | 6 ++++++ unit_tests/engine_test_helper.h | 2 ++ unit_tests/tests/trigger/test_real_volkswagen.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 292fd73204..9757c8d794 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -28,6 +28,7 @@ extern int timeNowUs; extern WarningCodeState unitTestWarningCodeState; extern engine_configuration_s & activeConfiguration; extern bool printTriggerDebug; +extern bool printTriggerTrace; extern bool printFuelDebug; extern int minCrankingRpm; @@ -380,3 +381,8 @@ void EngineTestHelper::setTriggerType(trigger_type_e trigger DECLARE_ENGINE_PARA void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injectionMode) { setupSimpleTestEngineWithMaf(eth, injectionMode, TT_ONE); } + +void setVerboseTrigger(bool isEnabled) { + printTriggerDebug = isEnabled; + printTriggerTrace = isEnabled; +} diff --git a/unit_tests/engine_test_helper.h b/unit_tests/engine_test_helper.h index e53a81ea3f..5566a340f6 100644 --- a/unit_tests/engine_test_helper.h +++ b/unit_tests/engine_test_helper.h @@ -100,3 +100,5 @@ private: void setupSimpleTestEngineWithMafAndTT_ONE_trigger(EngineTestHelper *eth, injection_mode_e injMode = IM_BATCH); void setupSimpleTestEngineWithMaf(EngineTestHelper *eth, injection_mode_e injectionMode, trigger_type_e trigger); + +void setVerboseTrigger(bool isEnabled); diff --git a/unit_tests/tests/trigger/test_real_volkswagen.cpp b/unit_tests/tests/trigger/test_real_volkswagen.cpp index ff93f3b32a..85b8076821 100644 --- a/unit_tests/tests/trigger/test_real_volkswagen.cpp +++ b/unit_tests/tests/trigger/test_real_volkswagen.cpp @@ -13,15 +13,17 @@ TEST(crankingVW, vwRealCrankingFromFile) { CsvReader reader; reader.triggerCount = 1; int indeces[1] = {0}; +// setVerboseTrigger(true); reader.open("tests/trigger/recourses/nick_1.csv", indeces); WITH_ENGINE_TEST_HELPER (VW_ABA); + eth.setTriggerType(TT_60_2_VW PASS_ENGINE_PARAMETER_SUFFIX); while (reader.haveMore()) { reader.processLine(ð); } - ASSERT_EQ( 0, eth.recentWarnings()->getCount())<< "warningCounter#vwRealCranking"; - ASSERT_EQ( 0, GET_RPM())<< reader.lineIndex; + ASSERT_EQ( 3, eth.recentWarnings()->getCount())<< "warningCounter#vwRealCranking"; + ASSERT_EQ( 1683, GET_RPM())<< reader.lineIndex; }