fix regression tests

This commit is contained in:
Frank Haverland
2022-10-26 20:10:19 +02:00
parent c8bb95a852
commit 116c99e55c
4 changed files with 31 additions and 22 deletions

View File

@@ -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"

View File

@@ -6,7 +6,7 @@
#include <ClassFlowCNNGeneral.h>
#include <ClassFlowCNNGeneral.h>
#include <ClassFlowMakeImage.h>
#include <Helper.h>
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

View File

@@ -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

View File

@@ -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