Skip to content

Commit 103981d

Browse files
committed
Fix QCOMPARE in the test
1 parent a809625 commit 103981d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/src/core/testqgsjsonutils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class TestQgsJsonUtils : public QObject
9696
QBENCHMARK
9797
{
9898
const auto json { QgsJsonUtils::exportAttributesToJsonObject( feature, &vl ) };
99-
QCOMPARE( QJsonDocument( json ).toJson( QJsonDocument::JsonFormat::Compact ), QStringLiteral( "{\"flddbl\":2,\"fldint\":1,\"fldtxt\":\"a value\"}" ) );
99+
QCOMPARE( QString( QJsonDocument( json ).toJson( QJsonDocument::JsonFormat::Compact ) ), QStringLiteral( R"raw({"flddbl":2,"fldint":1,"fldtxt":"a value"})raw" ) );
100100
}
101101
}
102102
else // average: 0.0070 msecs per iteration
@@ -133,7 +133,7 @@ class TestQgsJsonUtils : public QObject
133133
QBENCHMARK
134134
{
135135
const auto json { exporter.exportFeatureToJsonObject( feature ) };
136-
QCOMPARE( QJsonDocument( json ).toJson( QJsonDocument::JsonFormat::Compact ),
136+
QCOMPARE( QString( QJsonDocument( json ).toJson( QJsonDocument::JsonFormat::Compact ) ),
137137
QStringLiteral( "{\"bbox\":[1.12,1.12,5.45,5.33],\"geometry\":{\"coordinates\":[[[1.12,1.34]"
138138
",[5.45,1.12],[5.34,5.33],[1.56,5.2],[1.12,1.34]],[[2,2],[3,2],[3,3],[2,3],[2,2]]],"
139139
"\"type\":\"Polygon\"},\"id\":0,\"properties\":{\"flddbl\":2,\"fldint\":1,\"fldtxt\":\"a value\"},\"type\":\"Feature\"}"

0 commit comments

Comments
 (0)