JsonString: change default ownership to Copied

This commit is contained in:
Benoit Blanchon committed 2024-11-26 10:10:52 +01:00
1 parent c078957282
commit 8931651317
7 files changed
+10 -7

No files matched your search

+1 -1
View File
@@ -96,7 +96,7 @@ TEST_CASE("JsonString") {
JsonString s("hello world", 5);
CHECK(s.size() == 5);
CHECK(s.isLinked() == true);
CHECK(s.isLinked() == false);
CHECK(s == "hello");
CHECK(s != "hello world");
}
@@ -139,7 +139,8 @@ TEST_CASE("serialize MsgPack value") {
SECTION("str 32") {
std::string shortest(65536, '?');
checkVariant(JsonString(shortest.c_str(), true), // force store by pointer
checkVariant(JsonString(shortest.c_str(),
JsonString::Linked), // force store by pointer
"\xDB\x00\x01\x00\x00"_s + shortest);
}