Fix too many things in StringIndexer test
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ESP8266WiFi.h>
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* Allows to store up to 255 different strings with one byte class
|
* Allows to store up to 255 different strings with one byte class
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <ESP8266WiFi.h>
|
#pragma once
|
||||||
|
#include <ESPAsyncTCP.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -1,28 +1,14 @@
|
|||||||
#include <AUnit.h>
|
#include <AUnit.h>
|
||||||
#include <TinyMqtt.h>
|
#include <StringIndexer.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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;
|
using namespace std;
|
||||||
|
|
||||||
MqttBroker broker(1883);
|
|
||||||
|
|
||||||
std::map<std::string, std::map<Topic, int>> 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)
|
test(indexer_empty)
|
||||||
{
|
{
|
||||||
assertEqual(StringIndexer::count(), 0);
|
assertEqual(StringIndexer::count(), 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user