Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix TestQgsGeometry::splitGeometry() test with geos 3.9
  • Loading branch information
lbartoletti authored and nyalldawson committed Mar 25, 2021
1 parent 4c06804 commit 7feb362
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/src/core/testqgsgeometry.cpp
Expand Up @@ -18071,11 +18071,20 @@ void TestQgsGeometry::minimalEnclosingCircle()

void TestQgsGeometry::splitGeometry()
{
QgsGeometry g1 = QgsGeometry::fromWkt( QStringLiteral( "Polygon ((492980.38648063864093274 7082334.45244149677455425, 493082.65415841294452548 7082319.87918917648494244, 492980.38648063858272508 7082334.45244149677455425, 492980.38648063864093274 7082334.45244149677455425))" ) );
QVector<QgsGeometry> newGeoms;
QgsPointSequence testPoints;
QCOMPARE( g1.splitGeometry( QgsPointSequence() << QgsPoint( 493825.46541286131832749, 7082214.02779923938214779 ) << QgsPoint( 492955.04876351181883365, 7082338.06309300474822521 ),
newGeoms, false, testPoints ), QgsGeometry::NothingHappened );
qDebug() << GEOSversion() << "\n";
QgsGeometry g1 = QgsGeometry::fromWkt( QStringLiteral( "Polygon ((492980.38648063864093274 7082334.45244149677455425, 493082.65415841294452548 7082319.87918917648494244, 492980.38648063858272508 7082334.45244149677455425, 492980.38648063864093274 7082334.45244149677455425))" ) );
if ( GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR < 9 )
{
QCOMPARE( g1.splitGeometry( QgsPointSequence() << QgsPoint( 493825.46541286131832749, 7082214.02779923938214779 ) << QgsPoint( 492955.04876351181883365, 7082338.06309300474822521 ),
newGeoms, false, testPoints ), QgsGeometry::NothingHappened );
}
else
{
QCOMPARE( g1.splitGeometry( QgsPointSequence() << QgsPoint( 493825.46541286131832749, 7082214.02779923938214779 ) << QgsPoint( 492955.04876351181883365, 7082338.06309300474822521 ),
newGeoms, false, testPoints ), QgsGeometry::InvalidBaseGeometry );
}
QVERIFY( newGeoms.isEmpty() );

// Bug https://github.com/qgis/QGIS/issues/33489
Expand Down

0 comments on commit 7feb362

Please sign in to comment.