@@ -26,7 +26,7 @@ TEST_CASE("StringBuilder") {
2626 REQUIRE (spyingAllocator.log () == AllocatorLog{
2727 Allocate (sizeofStringBuffer ()),
2828 });
29- REQUIRE (data.type () == VariantType::TinyString);
29+ REQUIRE (data.type == VariantType::TinyString);
3030 }
3131
3232 SECTION (" Tiny string" ) {
@@ -45,8 +45,8 @@ TEST_CASE("StringBuilder") {
4545 str.save (&data);
4646
4747 REQUIRE (resources.overflowed () == false );
48- REQUIRE (data.type () == VariantType::TinyString);
49- REQUIRE (data.asString (&resources ) == " url" );
48+ REQUIRE (data.type == VariantType::TinyString);
49+ REQUIRE (VariantImpl (& data, &resources) .asString () == " url" );
5050 }
5151
5252 SECTION (" Short string fits in first allocation" ) {
@@ -134,10 +134,10 @@ TEST_CASE("StringBuilder::save() deduplicates strings") {
134134 auto s2 = saveString (builder, " world" );
135135 auto s3 = saveString (builder, " hello" );
136136
137- REQUIRE (s1 .asString (&resources ) == " hello" );
138- REQUIRE (s2 .asString (&resources ) == " world" );
139- REQUIRE (+s1 .asString (&resources ).c_str () ==
140- +s3 .asString (&resources ).c_str ()); // same address
137+ REQUIRE (VariantImpl (&s1, &resources) .asString () == " hello" );
138+ REQUIRE (VariantImpl (&s2, &resources) .asString () == " world" );
139+ REQUIRE (+VariantImpl (&s1, &resources) .asString ().c_str () ==
140+ +VariantImpl (&s3, &resources) .asString ().c_str ()); // same address
141141
142142 REQUIRE (spy.log () ==
143143 AllocatorLog{
@@ -153,10 +153,11 @@ TEST_CASE("StringBuilder::save() deduplicates strings") {
153153 auto s1 = saveString (builder, " hello world" );
154154 auto s2 = saveString (builder, " hello" );
155155
156- REQUIRE (s1.asString (&resources) == " hello world" );
157- REQUIRE (s2.asString (&resources) == " hello" );
158- REQUIRE (+s2.asString (&resources).c_str () !=
159- +s1.asString (&resources).c_str ()); // different address
156+ REQUIRE (VariantImpl (&s1, &resources).asString () == " hello world" );
157+ REQUIRE (VariantImpl (&s2, &resources).asString () == " hello" );
158+ REQUIRE (
159+ +VariantImpl (&s1, &resources).asString ().c_str () !=
160+ +VariantImpl (&s2, &resources).asString ().c_str ()); // different address
160161
161162 REQUIRE (spy.log () ==
162163 AllocatorLog{
@@ -171,10 +172,11 @@ TEST_CASE("StringBuilder::save() deduplicates strings") {
171172 auto s1 = saveString (builder, " hello world" );
172173 auto s2 = saveString (builder, " worl" );
173174
174- REQUIRE (s1.asString (&resources) == " hello world" );
175- REQUIRE (s2.asString (&resources) == " worl" );
176- REQUIRE (s2.asString (&resources).c_str () !=
177- s1.asString (&resources).c_str ()); // different address
175+ REQUIRE (VariantImpl (&s1, &resources).asString () == " hello world" );
176+ REQUIRE (VariantImpl (&s2, &resources).asString () == " worl" );
177+ REQUIRE (
178+ VariantImpl (&s1, &resources).asString ().c_str () !=
179+ VariantImpl (&s2, &resources).asString ().c_str ()); // different address
178180
179181 REQUIRE (spy.log () ==
180182 AllocatorLog{
0 commit comments