Skip to content

Commit ba35b23

Browse files
committed
adapt some tests to 'better' wkt (followup b1efd47)
1 parent 8fc14f8 commit ba35b23

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/core/raster/qgsrasterchecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ double QgsRasterChecker::tolerance( double val, int places )
211211
QString QgsRasterChecker::compareHead()
212212
{
213213
QString html;
214-
html += QString( "<tr><th style='%1'>Param name</th><th style='%1'>Verified value</th><th style='%1'>Eexpected value</th><th style='%1'>Difference</th><th style='%1'>Tolerance</th></tr>" ).arg( mCellStyle );
214+
html += QString( "<tr><th style='%1'>Param name</th><th style='%1'>Verified value</th><th style='%1'>Expected value</th><th style='%1'>Difference</th><th style='%1'>Tolerance</th></tr>" ).arg( mCellStyle );
215215
return html;
216216
}
217217

tests/src/core/testqgsogcutils.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ void TestQgsOgcUtils::testGeometryToGML()
8080
QVERIFY( !elemPoint.isNull() );
8181

8282
doc.appendChild( elemPoint );
83-
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:coordinates cs=\",\" ts=\" \">111.0,222.0</gml:coordinates></gml:Point>" ) );
83+
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:coordinates cs=\",\" ts=\" \">111,222</gml:coordinates></gml:Point>" ) );
8484
doc.removeChild( elemPoint );
8585

8686
QDomElement elemLine = QgsOgcUtils::geometryToGML( geomLine, doc );
8787
QVERIFY( !elemLine.isNull() );
8888

8989
doc.appendChild( elemLine );
90-
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:coordinates cs=\",\" ts=\" \">111.0,222.0 222.0,222.0</gml:coordinates></gml:LineString>" ) );
90+
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:coordinates cs=\",\" ts=\" \">111,222 222,222</gml:coordinates></gml:LineString>" ) );
9191
doc.removeChild( elemLine );
9292

9393
// Test GML3
@@ -98,14 +98,14 @@ void TestQgsOgcUtils::testGeometryToGML()
9898
QVERIFY( !elemPoint.isNull() );
9999

100100
doc.appendChild( elemPoint );
101-
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:pos srsDimension=\"2\">111.0 222.0</gml:pos></gml:Point>" ) );
101+
QCOMPARE( doc.toString( -1 ), QString( "<gml:Point><gml:pos srsDimension=\"2\">111 222</gml:pos></gml:Point>" ) );
102102
doc.removeChild( elemPoint );
103103

104104
elemLine = QgsOgcUtils::geometryToGML( geomLine, doc, "GML3" );
105105
QVERIFY( !elemLine.isNull() );
106106

107107
doc.appendChild( elemLine );
108-
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:posList srsDimension=\"2\">111.0 222.0 222.0 222.0</gml:posList></gml:LineString>" ) );
108+
QCOMPARE( doc.toString( -1 ), QString( "<gml:LineString><gml:posList srsDimension=\"2\">111 222 222 222</gml:posList></gml:LineString>" ) );
109109
doc.removeChild( elemLine );
110110

111111
delete geomPoint;
@@ -315,15 +315,15 @@ void TestQgsOgcUtils::testExpressionToOgcFilter_data()
315315
"<ogc:Filter>"
316316
"<ogc:Intersects>"
317317
"<ogc:PropertyName>geometry</ogc:PropertyName>"
318-
"<gml:Point><gml:coordinates cs=\",\" ts=\" \">5.0,6.0</gml:coordinates></gml:Point>"
318+
"<gml:Point><gml:coordinates cs=\",\" ts=\" \">5,6</gml:coordinates></gml:Point>"
319319
"</ogc:Intersects>"
320320
"</ogc:Filter>" );
321321

322-
QTest::newRow( "contains + gml" ) << QString( "contains($geometry, geomFromGML('<Point><coordinates cs=\",\" ts=\" \">5.0,6.0</coordinates></Point>'))" ) << QString(
322+
QTest::newRow( "contains + gml" ) << QString( "contains($geometry, geomFromGML('<Point><coordinates cs=\",\" ts=\" \">5,6</coordinates></Point>'))" ) << QString(
323323
"<ogc:Filter>"
324324
"<ogc:Contains>"
325325
"<ogc:PropertyName>geometry</ogc:PropertyName>"
326-
"<Point><coordinates cs=\",\" ts=\" \">5.0,6.0</coordinates></Point>"
326+
"<Point><coordinates cs=\",\" ts=\" \">5,6</coordinates></Point>"
327327
"</ogc:Contains>"
328328
"</ogc:Filter>" );
329329

tests/src/python/test_qgsgeometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def testClipping(self):
321321
#print 'Difference: %s' % myDifferenceGeometry.exportToWkt()
322322
print 'Symmetrical: %s' % mySymmetricalGeometry.exportToWkt()
323323

324-
myExpectedWkt = 'LINESTRING(20.0 20.0, 30.0 30.0)'
324+
myExpectedWkt = 'LINESTRING(20 20, 30 30)'
325325
# There should only be one feature that intersects this clip
326326
# poly so this assertion should work.
327327
self.assertEqual(myExpectedWkt,

tests/src/python/test_qgsrectangle.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ def testUnion(self):
179179
def testAsWktCoordinates(self):
180180
"""Test that we can get a proper wkt representation fo the rect"""
181181
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
182-
myExpectedWkt = ('0.0 0.0, '
183-
'5.0 5.0')
182+
myExpectedWkt = ('0 0, '
183+
'5 5')
184184
myWkt = rect1.asWktCoordinates()
185185
myMessage = ('Expected: %s\nGot: %s\n' %
186186
(myExpectedWkt, myWkt))
@@ -189,11 +189,11 @@ def testAsWktCoordinates(self):
189189
def testAsWktPolygon(self):
190190
"""Test that we can get a proper rect wkt polygon representation for rect"""
191191
rect1 = QgsRectangle( 0.0, 0.0, 5.0, 5.0)
192-
myExpectedWkt = ('POLYGON((0.0 0.0, '
193-
'5.0 0.0, '
194-
'5.0 5.0, '
195-
'0.0 5.0, '
196-
'0.0 0.0))')
192+
myExpectedWkt = ('POLYGON((0 0, '
193+
'5 0, '
194+
'5 5, '
195+
'0 5, '
196+
'0 0))')
197197
myWkt = rect1.asWktPolygon()
198198
myMessage = ('Expected: %s\nGot: %s\n' %
199199
(myExpectedWkt, myWkt))

0 commit comments

Comments
 (0)