[tests] Use TinyConsole::string instead of any

This commit is contained in:
Francois BIOT
2023-02-20 02:24:39 +01:00
parent c21b7b63fb
commit 775fbc14ee
8 changed files with 92 additions and 79 deletions

View File

@@ -12,9 +12,11 @@
* Also, this will allow to mock and thus run Action on github
**/
using string = TinyConsole::string;
MqttBroker broker(1883);
std::map<TinyString, std::map<Topic, int>> published; // map[client_id] => map[topic] = count
std::map<string, std::map<Topic, int>> published; // map[client_id] => map[topic] = count
const char* lastPayload;
size_t lastLength;

View File

@@ -16,6 +16,8 @@
* Checks with a local broker. Clients must connect to the local broker
**/
using string = TinyConsole::string;
// if ascii_pos = 0, no ascii dump, else ascii dump starts after column ascii_pos
std::string bufferToHexa(const uint8_t* buffer, size_t length, char sep = 0, size_t ascii_pos = 0)
{
@@ -78,7 +80,7 @@ String toString(const IPAddress& ip)
MqttBroker broker(1883);
std::map<TinyString, std::map<Topic, int>> published; // map[client_id] => map[topic] = count
std::map<string, std::map<Topic, int>> published; // map[client_id] => map[topic] = count
char* lastPayload = nullptr;
size_t lastLength;

View File

@@ -11,9 +11,11 @@
* Checks with a local broker. Clients must connect to the local broker
**/
using string = TinyConsole::string;
MqttBroker broker(1883);
std::map<TinyString, std::map<Topic, int>> published; // map[client_id] => map[topic] = count
std::map<string, std::map<Topic, int>> published; // map[client_id] => map[topic] = count
char* lastPayload = nullptr;
size_t lastLength;

View File

@@ -9,6 +9,8 @@
*
**/
using string = TinyConsole::string;
test(indexer_empty)
{
assertEqual(StringIndexer::count(), 0);
@@ -82,7 +84,7 @@ test(indexer_indexed_operator_eq)
test(indexer_get_string)
{
TinyString sone("one");
string sone("one");
IndexedString one(sone);
assertTrue(sone==one.str());