From 67a296eb287b81106eb1058145fed382dc1c5416 Mon Sep 17 00:00:00 2001 From: hsaturn Date: Sat, 10 Apr 2021 15:29:17 +0200 Subject: [PATCH] Fix too many things in StringIndexer test --- src/StringIndexer.h | 1 - src/TinyMqtt.h | 3 ++- .../string-indexer-tests.ino | 18 ++---------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/StringIndexer.h b/src/StringIndexer.h index 8d26de9..17d5ac1 100644 --- a/src/StringIndexer.h +++ b/src/StringIndexer.h @@ -2,7 +2,6 @@ #include #include #include -#include /*** * Allows to store up to 255 different strings with one byte class diff --git a/src/TinyMqtt.h b/src/TinyMqtt.h index f2e52ca..4c2c707 100644 --- a/src/TinyMqtt.h +++ b/src/TinyMqtt.h @@ -1,4 +1,5 @@ -#include +#pragma once +#include #include #include #include diff --git a/tests/string-indexer-tests/string-indexer-tests.ino b/tests/string-indexer-tests/string-indexer-tests.ino index 86b8df0..4168946 100644 --- a/tests/string-indexer-tests/string-indexer-tests.ino +++ b/tests/string-indexer-tests/string-indexer-tests.ino @@ -1,28 +1,14 @@ #include -#include +#include #include /** - * TinyMqtt local unit tests. + * TinyMqtt / StringIndexer unit tests. * - * Clients are connected to pseudo remote broker - * The remote will be 127.0.0.1:1883 - * We are using 127.0.0.1 because this is simpler to test with a single ESP - * Also, this will allow to mock and thus run Action on github **/ using namespace std; -MqttBroker broker(1883); - -std::map> published; // map[client_id] => map[topic] = count - -void onPublish(const MqttClient* srce, const Topic& topic, const char* payload, size_t length) -{ - if (srce) - published[srce->id()][topic]++; -} - test(indexer_empty) { assertEqual(StringIndexer::count(), 0);