mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
add tests
This commit is contained in:
parent
653c1e020d
commit
57ddc98eca
@ -164,6 +164,8 @@ class TestQgsGeometry : public QObject
|
|||||||
|
|
||||||
void testRandomPointsInPolygon();
|
void testRandomPointsInPolygon();
|
||||||
|
|
||||||
|
void wktParser();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Must be called before each render test
|
//! Must be called before each render test
|
||||||
void initPainterTest();
|
void initPainterTest();
|
||||||
@ -18097,5 +18099,23 @@ void TestQgsGeometry::testRandomPointsInPolygon()
|
|||||||
QVERIFY( foundp2Point );
|
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 )
|
QGSTEST_MAIN( TestQgsGeometry )
|
||||||
#include "testqgsgeometry.moc"
|
#include "testqgsgeometry.moc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user