Fix JsonVariant::memoryUsage() for raw strings

This commit is contained in:
Benoit Blanchon committed 2021-11-12 16:55:41 +01:00
1 parent 0429016ff1
commit 599e927590
3 files changed
+7 -2

No files matched your search

+3 -1
View File
@@ -30,10 +30,12 @@ TEST_CASE("JsonVariant::memoryUsage()") {
SECTION("returns size of owned string") {
var.set(std::string("hello"));
REQUIRE(var.memoryUsage() == 6);
REQUIRE(var.memoryUsage() == doc.memoryUsage());
}
SECTION("returns size of owned raw") {
var.set(serialized(std::string("hello")));
REQUIRE(var.memoryUsage() == 5);
REQUIRE(var.memoryUsage() == 6);
REQUIRE(var.memoryUsage() == doc.memoryUsage());
}
}