Skip to content
Permalink
Browse files

Added test for tessellator fix

(cherry picked from commit 7cc0d92)
  • Loading branch information
uclaros authored and nyalldawson committed Apr 28, 2020
1 parent 8dadfa4 commit ac4dc39f319611b3dfd456fb9e05d7c4106765ae
Showing with 9 additions and 0 deletions.
  1. +9 −0 tests/src/3d/testqgstessellator.cpp
@@ -138,6 +138,7 @@ class TestQgsTessellator : public QObject
void testCrashEmptyPolygon();
void testBoundsScaling();
void testNoZ();
void testCrash2DTriangle();

private:
};
@@ -386,6 +387,14 @@ void TestQgsTessellator::testNoZ()
QVERIFY( checkTriangleOutput( t.data(), false, tc ) );
}

void TestQgsTessellator::testCrash2DTriangle()
{
// test tessellation of a 2D triangle - https://github.com/qgis/QGIS/issues/36024
QgsPolygon polygon;
polygon.fromWkt( "Polygon((0 0, 42 0, 42 42, 0 0))" );
QgsTessellator t( 0, 0, true );
t.addPolygon( polygon, 0 ); // must not crash - that's all we test here
}

QGSTEST_MAIN( TestQgsTessellator )
#include "testqgstessellator.moc"

0 comments on commit ac4dc39

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