Skip to content
Permalink
Browse files

Fix build failure due to dabc3b1

  • Loading branch information
rouault committed Jun 20, 2016
1 parent f3bbf89 commit ab98858b98224fcd703fefc44b91262750fe810d
Showing with 8 additions and 11 deletions.
  1. +2 −4 tests/src/core/testqgsmaptopixelgeometrysimplifier.cpp
  2. +6 −7 tests/src/python/test_qgsgeometry.py
@@ -174,13 +174,11 @@ void TestQgsMapToPixelGeometrySimplifier::testWkbDimensionMismatch()
// NOTE: wkb onwership transferred to QgsGeometry
g12416.fromWkb( wkb, size );
QString wkt = g12416.exportToWkt();
QCOMPARE( wkt, QString( "MultiLineString ((0 0 0, 1 1 0, 2 0 0, 3 1 0, 10 0 -0.000001),(0 0 0, 0 0 0.000001))" ) );
QCOMPARE( wkt, QString( "MultiLineStringZ ((0 0 0, 1 1 0, 2 0 0, 3 1 0, 10 0 -0.000001),(0 0 0, 0 0 0.000001))" ) );

int fl = QgsMapToPixelSimplifier::SimplifyGeometry;
int ret = QgsMapToPixelSimplifier::simplifyGeometry( &g12416, fl, 20.0 );
// NOTE: currently false due to thrown exception, but fixing the
// simplification code might actually give a success
QVERIFY( ! ret );
QVERIFY( ret );
}

QTEST_MAIN( TestQgsMapToPixelGeometrySimplifier )
@@ -3310,23 +3310,23 @@ def testMisc(self):
multipolygon = QgsMultiPolygonV2()
cp = QgsCurvePolygonV2()
cp.fromWkt("CurvePolygon ((0 0,0 1,1 1,0 0))")
assert not multipolygon.addGeometry( cp )
assert not multipolygon.addGeometry(cp)

# Test that importing an invalid WKB (a MultiPolygon with a CurvePolygon) fails
geom = QgsGeometry.fromWkt('MultiSurface(((0 0,0 1,1 1,0 0)), CurvePolygon ((0 0,0 1,1 1,0 0)))')
wkb = geom.asWkb()
wkb = bytearray(wkb)
if wkb[1] == QgsWKBTypes.MultiSurface:
wkb[1] = QgsWKBTypes.MultiPolygon
elif wkb[1+4] == QgsWKBTypes.MultiSurface:
wkb[1+4] = QgsWKBTypes.MultiPolygon
wkb[1] = QgsWKBTypes.MultiPolygon
elif wkb[1 + 4] == QgsWKBTypes.MultiSurface:
wkb[1 + 4] = QgsWKBTypes.MultiPolygon
else:
self.assertTrue(False)
self.assertTrue(False)
geom = QgsGeometry()
geom.fromWkb(wkb)
self.assertEqual(geom.exportToWkt(), QgsMultiPolygonV2().asWkt())

# Test that fromWkt() on a GeometryCollection works with all possible geometries
# Test that fromWkt() on a GeometryCollection works with all possible geometries
wkt = "GeometryCollection( "
wkt += "Point(0 1)"
wkt += ","
@@ -3360,6 +3360,5 @@ def testMisc(self):
wkb2 = geom.asWkb()
self.assertEqual(wkb1, wkb2)


if __name__ == '__main__':
unittest.main()

0 comments on commit ab98858

Please sign in to comment.
You can’t perform that action at this time.