forked from bblanchon/ArduinoJson
Fix tests on VS
This commit is contained in:
@ -382,24 +382,6 @@ TEST_CASE("Deduplicate keys") {
|
|||||||
Allocate(sizeofString("example")),
|
Allocate(sizeofString("example")),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("string literals") {
|
|
||||||
doc[0]["example"] = 1;
|
|
||||||
doc[1]["example"] = 2;
|
|
||||||
doc.shrinkToFit();
|
|
||||||
|
|
||||||
const char* key1 = doc[0].as<JsonObject>().begin()->key().c_str();
|
|
||||||
const char* key2 = doc[1].as<JsonObject>().begin()->key().c_str();
|
|
||||||
CHECK(key1 == key2);
|
|
||||||
|
|
||||||
REQUIRE(spy.log() ==
|
|
||||||
AllocatorLog{
|
|
||||||
Allocate(sizeofPool()),
|
|
||||||
Allocate(sizeofStaticStringPool()),
|
|
||||||
Reallocate(sizeofPool(), sizeofPool(6)),
|
|
||||||
Reallocate(sizeofStaticStringPool(), sizeofStaticStringPool(1)),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("MemberProxy under memory constraints") {
|
TEST_CASE("MemberProxy under memory constraints") {
|
||||||
|
@ -23,12 +23,15 @@ TEST_CASE("ResourceManager::saveStaticString()") {
|
|||||||
SpyingAllocator spy;
|
SpyingAllocator spy;
|
||||||
ResourceManager resources(&spy);
|
ResourceManager resources(&spy);
|
||||||
|
|
||||||
auto a = resources.saveStaticString("hello");
|
auto str1 = "hello";
|
||||||
auto b = resources.saveStaticString("world");
|
auto str2 = "world";
|
||||||
REQUIRE(a != b);
|
|
||||||
|
|
||||||
auto c = resources.saveStaticString("hello");
|
auto id1 = resources.saveStaticString(str1);
|
||||||
REQUIRE(a == c);
|
auto id2 = resources.saveStaticString(str2);
|
||||||
|
REQUIRE(id1 != id2);
|
||||||
|
|
||||||
|
auto id3 = resources.saveStaticString(str1);
|
||||||
|
REQUIRE(id1 == id3);
|
||||||
|
|
||||||
resources.shrinkToFit();
|
resources.shrinkToFit();
|
||||||
REQUIRE(spy.log() ==
|
REQUIRE(spy.log() ==
|
||||||
|
Reference in New Issue
Block a user