Skip to content

Commit

Permalink
Add QgsDistanceArea test for empty polygon
Browse files Browse the repository at this point in the history
(cherry-picked from ebdccf3)
  • Loading branch information
nyalldawson committed Jun 30, 2016
1 parent a8ecdb5 commit ae6592d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/core/testqgsdistancearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class TestQgsDistanceArea: public QObject
void collections();
void measureUnits();
void measureAreaAndUnits();
void emptyPolygon();

};

Expand Down Expand Up @@ -344,6 +345,17 @@ void TestQgsDistanceArea::measureAreaAndUnits()
QVERIFY( qgsDoubleNear( area, 220240.8172549, 0.00001 ) );
}

void TestQgsDistanceArea::emptyPolygon()
{
QgsDistanceArea da;
da.setSourceCrs( 3452 );
da.setEllipsoidalMode( true );
da.setEllipsoid( "WGS84" );

//test that measuring an empty polygon doesn't crash
da.measurePolygon( QList< QgsPoint >() );
}

QTEST_MAIN( TestQgsDistanceArea )
#include "testqgsdistancearea.moc"

Expand Down

0 comments on commit ae6592d

Please sign in to comment.