Skip to content
Permalink
Browse files

Add QgsDistanceArea test for empty polygon

  • Loading branch information
nyalldawson committed Jun 6, 2016
1 parent 3408a78 commit ebdccf3869e8ccf1e495b7e5ba6119d94fec4980
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 ebdccf3

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