Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Jun 14, 2024
1 parent 08ff138 commit f2f3a40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test/app/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ enum class Fruit {
};

struct Size {
size_t cx, cy, cz;
unsigned cx;
unsigned cy;
unsigned cz;
};

String toString(Fruit fruit)
Expand Down
9 changes: 6 additions & 3 deletions test/app/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,16 @@ class MapTest : public TestGroup

TEST_CASE("lookup")
{
String contentKey1 = F("This is content from file \"content1.txt\".");
String contentKey2 = F("This is content from file \"content2.txt\".");

Serial << _F("stringMap['key1']: ") << stringMap["key1"] << endl;
REQUIRE(stringMap["key1"]);
REQUIRE(stringMap["KEY1"]);
REQUIRE(!stringMap["key1"].content().isNull());
REQUIRE_EQ(contentKey1, stringMap["key1"].content());
Serial << _F("stringMap['key2']: ") << stringMap["key2"] << endl;
REQUIRE(stringMap["key2"]);
REQUIRE(!stringMap["key2"].content().isNull());
REQUIRE_EQ(contentKey2, stringMap["key2"].content());
Serial << _F("stringMap['non-existent']: ") << stringMap["key20"] << endl;
REQUIRE(!stringMap["key20"]);
REQUIRE(stringMap["key20"].content().isNull());
Expand All @@ -85,7 +88,7 @@ class MapTest : public TestGroup

TEST_CASE("Map of enum MapKey => String")
{
Serial.printf(_F("enumMap[%u]\n"), enumMap.length());
Serial.printf(_F("enumMap[%lu]\n"), enumMap.length());

Serial.println(_F(" for-loop:"));
for(unsigned i = 0; i < enumMap.length(); ++i) {
Expand Down

0 comments on commit f2f3a40

Please sign in to comment.