Skip to content
Permalink
Browse files

Add QgsDistanceArea test for empty polygon

(cherry-picked from ebdccf3)
  • Loading branch information
nyalldawson committed Jun 30, 2016
1 parent a8ecdb5 commit ae6592d5c3ac7c3ed227f33a19dad4628343c3b8
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/src/core/testqgsdistancearea.cpp
@@ -42,6 +42,7 @@ class TestQgsDistanceArea: public QObject
void collections();
void measureUnits();
void measureAreaAndUnits();
void emptyPolygon();

};

@@ -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"

0 comments on commit ae6592d

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