Skip to content

Commit 0597a81

Browse files
committedMay 30, 2019
fix windows build
1 parent 5c8daf2 commit 0597a81

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎tests/src/core/testqgsjsonutils.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ void TestQgsJsonUtils::testJsonArray()
7777
QCOMPARE( QgsJsonUtils::parseArray( R"([1.234567,2.00003e+4,-3.01234e-02])" ), QVariantList() << 1.234567 << 2.00003e+4 << -3.01234e-2 );
7878
// Strings
7979
QCOMPARE( QgsJsonUtils::parseArray( R"(["one", "two", "three"])" ), QVariantList() << "one" << "two" << "three" );
80-
QCOMPARE( QgsJsonUtils::parseArray( R"(["one,comma", "two[]brackets", "three\"escaped"])" ), QVariantList() << "one,comma" << "two[]brackets" << "three\"escaped" );
80+
// VC++ doesn't like \" in raw strings
81+
QCOMPARE( QgsJsonUtils::parseArray( "[\"one,comma\", \"two[]brackets\", \"three\\\"escaped\"]" ), QVariantList() << "one,comma" << "two[]brackets" << "three\"escaped" );
8182
// Nested (not implemented: discard deeper levels)
8283
//QCOMPARE( QgsJsonUtils::parseArray( R"([1.0,[2.0,5.0],3.0])" ), QVariantList() << 1.0 << 3.0 );
8384
// Mixed types
@@ -183,10 +184,10 @@ void TestQgsJsonUtils::testExportFeatureJson()
183184
QgsJsonExporter exporter { &vl };
184185

185186
const auto expectedJson { QStringLiteral( "{\"bbox\":[[1.12,1.12,5.45,5.33]],\"geometry\":{\"coordinates\":"
186-
"[[[1.12,1.34],[5.45,1.12],[5.34,5.33],[1.56,5.2],[1.12,1.34]],"
187-
"[[2.0,2.0],[3.0,2.0],[3.0,3.0],[2.0,3.0],[2.0,2.0]]],\"type\":\"Polygon\"}"
188-
",\"id\":0,\"properties\":{\"flddbl\":2.0,\"fldint\":1,\"fldtxt\":\"a value\"}"
189-
",\"type\":\"Feature\"}" ) };
187+
"[[[1.12,1.34],[5.45,1.12],[5.34,5.33],[1.56,5.2],[1.12,1.34]],"
188+
"[[2.0,2.0],[3.0,2.0],[3.0,3.0],[2.0,3.0],[2.0,2.0]]],\"type\":\"Polygon\"}"
189+
",\"id\":0,\"properties\":{\"flddbl\":2.0,\"fldint\":1,\"fldtxt\":\"a value\"}"
190+
",\"type\":\"Feature\"}" ) };
190191

191192
const auto j( exporter.exportFeatureToJsonObject( feature ) );
192193
QCOMPARE( QString::fromStdString( j.dump() ), expectedJson );

0 commit comments

Comments
 (0)
Please sign in to comment.