@@ -69,17 +69,8 @@ TEST_CASE("JsonDocument::shrinkToFit()") {
6969 REQUIRE (spyingAllocator.log () == AllocatorLog{});
7070 }
7171
72- SECTION (" linked string" ) {
73- doc.set (" hello" );
74-
75- doc.shrinkToFit ();
76-
77- REQUIRE (doc.as <std::string>() == " hello" );
78- REQUIRE (spyingAllocator.log () == AllocatorLog{});
79- }
80-
81- SECTION (" owned string" ) {
82- doc.set (" abcdefg" _s);
72+ SECTION (" string" ) {
73+ doc.set (" abcdefg" );
8374 REQUIRE (doc.as <std::string>() == " abcdefg" );
8475
8576 doc.shrinkToFit ();
@@ -101,20 +92,7 @@ TEST_CASE("JsonDocument::shrinkToFit()") {
10192 });
10293 }
10394
104- SECTION (" linked key" ) {
105- doc[" key" ] = 42 ;
106-
107- doc.shrinkToFit ();
108-
109- REQUIRE (doc.as <std::string>() == " {\" key\" :42}" );
110- REQUIRE (spyingAllocator.log () ==
111- AllocatorLog{
112- Allocate (sizeofPool ()),
113- Reallocate (sizeofPool (), sizeofObject (1 )),
114- });
115- }
116-
117- SECTION (" owned key" ) {
95+ SECTION (" object key" ) {
11896 doc[" abcdefg" _s] = 42 ;
11997
12098 doc.shrinkToFit ();
@@ -128,20 +106,7 @@ TEST_CASE("JsonDocument::shrinkToFit()") {
128106 });
129107 }
130108
131- SECTION (" linked string in array" ) {
132- doc.add (" hello" );
133-
134- doc.shrinkToFit ();
135-
136- REQUIRE (doc.as <std::string>() == " [\" hello\" ]" );
137- REQUIRE (spyingAllocator.log () ==
138- AllocatorLog{
139- Allocate (sizeofPool ()),
140- Reallocate (sizeofPool (), sizeofArray (1 )),
141- });
142- }
143-
144- SECTION (" owned string in array" ) {
109+ SECTION (" string in array" ) {
145110 doc.add (" abcdefg" _s);
146111
147112 doc.shrinkToFit ();
@@ -155,20 +120,7 @@ TEST_CASE("JsonDocument::shrinkToFit()") {
155120 });
156121 }
157122
158- SECTION (" linked string in object" ) {
159- doc[" key" ] = " hello" ;
160-
161- doc.shrinkToFit ();
162-
163- REQUIRE (doc.as <std::string>() == " {\" key\" :\" hello\" }" );
164- REQUIRE (spyingAllocator.log () ==
165- AllocatorLog{
166- Allocate (sizeofPool ()),
167- Reallocate (sizeofPool (), sizeofObject (1 )),
168- });
169- }
170-
171- SECTION (" owned string in object" ) {
123+ SECTION (" string in object" ) {
172124 doc[" key" ] = " abcdefg" _s;
173125
174126 doc.shrinkToFit ();
0 commit comments