Skip to content
Permalink
Browse files

Fix TestQgsGeometry::splitGeometry() test with geos 3.9

  • Loading branch information
lbartoletti authored and nyalldawson committed Mar 25, 2021
1 parent 4c06804 commit 7feb362f72f858f63a5ae6d0dbc7fcc1da7b4244
Showing with 12 additions and 3 deletions.
  1. +12 −3 tests/src/core/testqgsgeometry.cpp

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

0 comments on commit 7feb362

Please sign in to comment.