From da67a199ae1a6cd0c04d084a0ce3d5a050a509f9 Mon Sep 17 00:00:00 2001 From: ronny-antoon <90724911+ronny-antoon@users.noreply.github.com> Date: Mon, 8 Apr 2024 01:41:07 +0300 Subject: [PATCH] . --- test/loggme.hpp | 8 ++++++++ test/main.cpp | 7 ++++++- test/test_UpdateOTA.hpp | 11 ++++------- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 test/loggme.hpp diff --git a/test/loggme.hpp b/test/loggme.hpp new file mode 100644 index 0000000..5fa73c1 --- /dev/null +++ b/test/loggme.hpp @@ -0,0 +1,8 @@ +#ifndef ANAN +#define ANAN + +#include + +static MultiPrinterLogger* logger12; + +#endif \ No newline at end of file diff --git a/test/main.cpp b/test/main.cpp index 00b06ff..780368c 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -1,13 +1,18 @@ #include #include - +#include "loggme.hpp" #include "test_UpdateOTA.hpp" void setup() { // Initialize Serial Serial.begin(115200); + + logger12 = new MultiPrinterLogger(); + logger12->addPrinter(&Serial); + logger12->setLogLevel(MultiPrinterLoggerInterface::VERBOSE); + ::testing::InitGoogleTest(); } diff --git a/test/test_UpdateOTA.hpp b/test/test_UpdateOTA.hpp index c3e102b..0e3353e 100644 --- a/test/test_UpdateOTA.hpp +++ b/test/test_UpdateOTA.hpp @@ -2,9 +2,10 @@ #define TEST_UPDATE_OTA_HPP #include - #include "UpdateOTA.hpp" -#include "MultiPrinterLogger.hpp" +#include "loggme.hpp" + + class UpdateOTATest : public ::testing::Test { @@ -16,15 +17,11 @@ class UpdateOTATest : public ::testing::Test const char *WIFI_SSID = "Wokwi-GUEST"; const char *WIFI_PASSWORD = ""; const int WIFI_CHANNEL = 6; - MultiPrinterLogger *logger = new MultiPrinterLogger(); - logger->addPrinter(Serial); - logger->setLogLevel(MultiPrinterLoggerInterface::LogLevel::VERBOSE); - void SetUp() override { // Initialize UpdateOTA - _updateOTA = new UpdateOTA(logger); + _updateOTA = new UpdateOTA(logger12); } void TearDown() override