Skip to content

Commit b529056

Browse files
committed
Fix tests on VS
1 parent ee144b8 commit b529056

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

extras/tests/JsonDocument/MemberProxy.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -382,24 +382,6 @@ TEST_CASE("Deduplicate keys") {
382382
Allocate(sizeofString("example")),
383383
});
384384
}
385-
386-
SECTION("string literals") {
387-
doc[0]["example"] = 1;
388-
doc[1]["example"] = 2;
389-
doc.shrinkToFit();
390-
391-
const char* key1 = doc[0].as<JsonObject>().begin()->key().c_str();
392-
const char* key2 = doc[1].as<JsonObject>().begin()->key().c_str();
393-
CHECK(key1 == key2);
394-
395-
REQUIRE(spy.log() ==
396-
AllocatorLog{
397-
Allocate(sizeofPool()),
398-
Allocate(sizeofStaticStringPool()),
399-
Reallocate(sizeofPool(), sizeofPool(6)),
400-
Reallocate(sizeofStaticStringPool(), sizeofStaticStringPool(1)),
401-
});
402-
}
403385
}
404386

405387
TEST_CASE("MemberProxy under memory constraints") {

extras/tests/ResourceManager/saveString.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ TEST_CASE("ResourceManager::saveStaticString()") {
2323
SpyingAllocator spy;
2424
ResourceManager resources(&spy);
2525

26-
auto a = resources.saveStaticString("hello");
27-
auto b = resources.saveStaticString("world");
28-
REQUIRE(a != b);
26+
auto str1 = "hello";
27+
auto str2 = "world";
2928

30-
auto c = resources.saveStaticString("hello");
31-
REQUIRE(a == c);
29+
auto id1 = resources.saveStaticString(str1);
30+
auto id2 = resources.saveStaticString(str2);
31+
REQUIRE(id1 != id2);
32+
33+
auto id3 = resources.saveStaticString(str1);
34+
REQUIRE(id1 == id3);
3235

3336
resources.shrinkToFit();
3437
REQUIRE(spy.log() ==

0 commit comments

Comments
 (0)