Skip to content
Permalink
Browse files

add tests

  • Loading branch information
lbartoletti committed Aug 24, 2020
1 parent 653c1e0 commit 57ddc98ecaef8cf5f2e7a900f79887b893830d46
Showing with 20 additions and 0 deletions.
  1. +20 −0 tests/src/core/testqgsgeometry.cpp
@@ -164,6 +164,8 @@ class TestQgsGeometry : public QObject

void testRandomPointsInPolygon();

void wktParser();

private:
//! Must be called before each render test
void initPainterTest();
QVERIFY( foundp2Point );
}

void TestQgsGeometry::wktParser()
{
// unbalanced parenthesis
QVERIFY(! QgsPoint().fromWkt("POINT((0, 1)"));
QVERIFY(! QgsPoint().fromWkt("POINT(0, 1) )"));
QVERIFY(! QgsPoint().fromWkt("POINT ((0, 1)"));
QVERIFY(! QgsPoint().fromWkt("POINT (0, 1) )"));
QVERIFY(! QgsLineString().fromWkt("LineString(0, 1) )"));
QVERIFY(! QgsLineString().fromWkt("LineString(0 1, 1 2) )"));
QVERIFY(! QgsLineString().fromWkt("LineString (0, 1) )"));
QVERIFY(! QgsLineString().fromWkt("LineString (0 1, 1 2) )"));
QVERIFY(! QgsMultiLineString().fromWkt("MULTILINESTRING ((((1 2, 2 4, 4 5))"));
QVERIFY(! QgsMultiLineString().fromWkt("MULTILINESTRING((((1 2, 2 4, 4 5))"));
QVERIFY(! QgsLineString().fromWkt("Triangle(0 1, 1 2, 3 3) )"));
QVERIFY(! QgsLineString().fromWkt("Triangle (0 1, 1 2, 3 3) )"));
QVERIFY(! QgsLineString().fromWkt("Triangle( (0 1, 1 2, 3 3) )) "));
QVERIFY(! QgsLineString().fromWkt("Triangle ( (0 1, 1 2, 3 3) )) "));
}
QGSTEST_MAIN( TestQgsGeometry )
#include "testqgsgeometry.moc"

0 comments on commit 57ddc98

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