From cbc1aef722e6168232684ce2616088bfc1b3a175 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 12 May 2019 20:31:28 -0400 Subject: [PATCH] more PROD code into unit test --- firmware/controllers/core/fsio_impl.cpp | 3 +++ firmware/controllers/engine_controller.cpp | 7 +++---- unit_tests/tests/test_miata_na6_real_cranking.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index e94e417041..973ba174b2 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -638,6 +638,9 @@ static void rpnEval(char *line) { void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { #if EFI_PROD_CODE || EFI_SIMULATOR logger = sharedLogger; +#else + // only unit test needs this + sysPool.reset(); #endif #if EFI_FUEL_PUMP diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 26baf01a57..ef95dca6fc 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -83,6 +83,9 @@ void mostCommonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { initSensors(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); initAccelEnrichment(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); +#if EFI_FSIO + initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); +#endif /* EFI_FSIO */ } #if !EFI_UNIT_TEST @@ -661,10 +664,6 @@ void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S return; } mostCommonInitEngineController(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); - -#if EFI_FSIO - initFsioImpl(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); -#endif /* EFI_FSIO */ } void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { diff --git a/unit_tests/tests/test_miata_na6_real_cranking.cpp b/unit_tests/tests/test_miata_na6_real_cranking.cpp index c405e3688c..926fb6e286 100644 --- a/unit_tests/tests/test_miata_na6_real_cranking.cpp +++ b/unit_tests/tests/test_miata_na6_real_cranking.cpp @@ -130,7 +130,7 @@ TEST(miataNA6, realCranking) { /* 134 */ EVENT(/* timestamp*/3.031735, /*index*/1, /*value*/true); - ASSERT_EQ( 4, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#realCranking"; + ASSERT_EQ( 3, unitTestWarningCodeState.recentWarnings.getCount()) << "warningCounter#realCranking"; // ASSERT_EQ(CUSTOM_SYNC_COUNT_MISMATCH, unitTestWarningCodeState.recentWarnings.get(0)) << "@0";