Skip to content
Permalink
Browse files

Added test for tessellator fix

  • Loading branch information
uclaros authored and nyalldawson committed Apr 28, 2020
1 parent 800c54f commit 7cc0d92aff228eeb0a4b17426df715577c993da6
Showing with 9 additions and 0 deletions.
  1. +9 −0 tests/src/3d/testqgstessellator.cpp
@@ -139,6 +139,7 @@ class TestQgsTessellator : public QObject
void testBoundsScaling();
void testNoZ();
void testTriangulationDoesNotCrash();
void testCrash2DTriangle();

private:
};
@@ -397,6 +398,14 @@ void TestQgsTessellator::testTriangulationDoesNotCrash()
t.addPolygon( polygon, 0 );
}

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 7cc0d92

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