From 116c99e55c20821585eb2c8396877e407ede70ac Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 26 Oct 2022 20:10:19 +0200 Subject: [PATCH 1/2] fix regression tests --- .../jomjol_fileserver_ota/server_file.cpp | 2 +- .../test_flow_postrocess_helper.h | 11 +++++- .../test_flow_pp_negative.cpp | 3 +- code/test/test_suite_flowcontroll.cpp | 37 ++++++++++--------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/code/components/jomjol_fileserver_ota/server_file.cpp b/code/components/jomjol_fileserver_ota/server_file.cpp index f6a992b3..b0625f05 100644 --- a/code/components/jomjol_fileserver_ota/server_file.cpp +++ b/code/components/jomjol_fileserver_ota/server_file.cpp @@ -36,7 +36,7 @@ extern "C" { #include "defines.h" #include "ClassLogFile.h" -#include "server_tflite.h"" +#include "server_tflite.h" #include "server_help.h" #include "interface_mqtt.h" diff --git a/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.h b/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.h index 6b103f25..84e3e237 100644 --- a/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.h +++ b/code/test/components/jomjol-flowcontroll/test_flow_postrocess_helper.h @@ -6,7 +6,7 @@ #include #include #include - +#include class UnderTestPost : public ClassFlowPostProcessing { @@ -15,7 +15,6 @@ class UnderTestPost : public ClassFlowPostProcessing { : ClassFlowPostProcessing::ClassFlowPostProcessing(lfc, _analog, _digit) {} using ClassFlowPostProcessing::InitNUMBERS; - using ClassFlowPostProcessing::RundeOutput; using ClassFlowPostProcessing::flowAnalog; using ClassFlowPostProcessing::flowDigit; @@ -107,4 +106,12 @@ void setDecimalShift(UnderTestPost* _UnderTestPost, int decimal_shift); */ void setAnalogdigitTransistionStart(UnderTestPost* _underTestPost, float _analogdigitTransistionStart); +/** + * @brief Set the allowNegatives in testobject + * + * @param _underTestPost the testobject + * @param _allowNegatives if should be set true or false + */ +void setAllowNegatives(UnderTestPost* _underTestPost, bool _allowNegatives); + #endif // TEST_FLOW_H diff --git a/code/test/components/jomjol-flowcontroll/test_flow_pp_negative.cpp b/code/test/components/jomjol-flowcontroll/test_flow_pp_negative.cpp index 0a650deb..aa3e06f6 100644 --- a/code/test/components/jomjol-flowcontroll/test_flow_pp_negative.cpp +++ b/code/test/components/jomjol-flowcontroll/test_flow_pp_negative.cpp @@ -2,6 +2,7 @@ + /** * @brief Testfall für Überprüfung allowNegatives * @@ -33,7 +34,7 @@ void testNegative() { setPreValue(underTestPost, preValue_extended); result = process_doFlow(underTestPost); TEST_ASSERT_EQUAL_STRING("no error", underTestPost->getReadoutError().c_str()); - TEST_ASSERT_EQUAL_STRING(underTestPost->RundeOutput(preValue_extended, analogs.size()+1).c_str(), result.c_str()); + TEST_ASSERT_EQUAL_STRING(RundeOutput(preValue_extended, analogs.size()+1).c_str(), result.c_str()); delete underTestPost; // extendResolution=true diff --git a/code/test/test_suite_flowcontroll.cpp b/code/test/test_suite_flowcontroll.cpp index f91be40c..772b8735 100644 --- a/code/test/test_suite_flowcontroll.cpp +++ b/code/test/test_suite_flowcontroll.cpp @@ -14,22 +14,6 @@ static const char *TAGMAIN = "main"; #define __SD_USE_ONE_LINE_MODE__ #include "server_GPIO.h" - - - -void initGPIO() -{ - gpio_config_t io_conf; - //set as output mode - io_conf.mode = gpio_mode_t::GPIO_MODE_INPUT; - //bit mask of the pins that you want to set,e.g.GPIO18/19 - io_conf.pull_down_en = gpio_pulldown_t::GPIO_PULLDOWN_ENABLE; - //set pull-up mode - io_conf.pull_up_en = gpio_pullup_t::GPIO_PULLUP_DISABLE; - //configure GPIO with the given settings - gpio_config(&io_conf); -} - bool Init_NVS_SDCard() { esp_err_t ret = nvs_flash_init(); @@ -68,7 +52,7 @@ bool Init_NVS_SDCard() // formatted in case when mounting fails. esp_vfs_fat_sdmmc_mount_config_t mount_config = { .format_if_mount_failed = false, - .max_files = 5, + .max_files = 7, // anstatt 5 (2022-09-21) .allocation_unit_size = 16 * 1024 }; @@ -89,12 +73,29 @@ bool Init_NVS_SDCard() } return false; } - sdmmc_card_print_info(stdout, card); + sdmmc_card_print_info(stdout, card); + SaveSDCardInfo(card); return true; } + +void initGPIO() +{ + gpio_config_t io_conf; + //set as output mode + io_conf.mode = gpio_mode_t::GPIO_MODE_INPUT; + //bit mask of the pins that you want to set,e.g.GPIO18/19 + io_conf.pull_down_en = gpio_pulldown_t::GPIO_PULLDOWN_ENABLE; + //set pull-up mode + io_conf.pull_up_en = gpio_pullup_t::GPIO_PULLUP_DISABLE; + //configure GPIO with the given settings + gpio_config(&io_conf); +} + + + /** * @brief startup the test. Like a test-suite * all test methods must be called here From 083aeb42ec7e7a28dcc1a3bc9071aa63d282a89f Mon Sep 17 00:00:00 2001 From: CaCO3 Date: Wed, 26 Oct 2022 22:37:43 +0200 Subject: [PATCH 2/2] Update build.yaml (#1229)