@@ -944,6 +944,21 @@ class TestQgsExpression: public QObject
944
944
QTest::newRow ( " make_regular_polygon bad (numEdges < 3)" ) << " make_regular_polygon(make_point(0,0), make_point(0,5), 2)" << true << QVariant ();
945
945
QTest::newRow ( " make_regular_polygon" ) << " geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5), 2)" << false << QVariant ( " Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))" );
946
946
QTest::newRow ( " make_regular_polygon" ) << " geom_to_wkt(make_regular_polygon(make_point(0,0), project(make_point(0,0), 4.0451, radians(36)), 5, 1), 2)" << false << QVariant ( " Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))" );
947
+ QTest::newRow ( " make_square not geom (point 1)" ) << " make_square(make_line(make_point(1,2), make_point(3,4)), make_point(5,5))" << false << QVariant ();
948
+ QTest::newRow ( " make_square not geom (point 2)" ) << " make_square(make_point(0,0), make_line(make_point(1,2), make_point(3,4)))" << false << QVariant ();
949
+ QTest::newRow ( " make_square bad (point 1)" ) << " make_square('a', make_point(5,5))" << true << QVariant ();
950
+ QTest::newRow ( " make_square bad (point 2)" ) << " make_square(make_point(0,0), 'a')" << true << QVariant ();
951
+ QTest::newRow ( " make_square" ) << " geom_to_wkt(make_square(make_point(5, 5), make_point(1, 1)))" << false << QVariant ( " Polygon ((5 5, 5 1, 1 1, 1 5, 5 5))" );
952
+ QTest::newRow ( " make_rectangle_3points not geom (point 1)" ) << " make_rectangle_3points( make_line(make_point(1,2), make_point(3,4)), make_point(0,5), make_point(5,5))" << false << QVariant ();
953
+ QTest::newRow ( " make_rectangle_3points not geom (point 2)" ) << " make_rectangle_3points(make_point(0,0), make_line(make_point(1,2), make_point(3,4)), make_point(5,5))" << false << QVariant ();
954
+ QTest::newRow ( " make_rectangle_3points not geom (point 3)" ) << " make_rectangle_3points(make_point(0,0), make_point(0,5), make_line(make_point(1,2), make_point(3,4)))" << false << QVariant ();
955
+ QTest::newRow ( " make_rectangle_3points bad (point 1)" ) << " make_rectangle_3points('a', make_point(0,5), make_point(5,5))" << true << QVariant ();
956
+ QTest::newRow ( " make_rectangle_3points bad (point 2)" ) << " make_rectangle_3points(make_point(0,0), 'a', make_point(5,5))" << true << QVariant ();
957
+ QTest::newRow ( " make_rectangle_3points bad (point 3)" ) << " make_rectangle_3points(make_point(0,0), make_point(0,5), 'a')" << true << QVariant ();
958
+ QTest::newRow ( " make_rectangle_3points bad (invalid option)" ) << " make_rectangle_3points(make_point(0,0), make_point(0,5), make_point(5,5), 2)" << true << QVariant ();
959
+ QTest::newRow ( " make_rectangle_3points (distance default)" ) << " geom_to_wkt(make_rectangle_3points(make_point(0, 0), make_point(0,5), make_point(5, 5)))" << false << QVariant ( " Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))" );
960
+ QTest::newRow ( " make_rectangle_3points (distance)" ) << " geom_to_wkt(make_rectangle_3points(make_point(0, 0), make_point(0,5), make_point(5, 5), 0))" << false << QVariant ( " Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))" );
961
+ QTest::newRow ( " make_rectangle_3points (projected)" ) << " geom_to_wkt(make_rectangle_3points(make_point(0, 0), make_point(0,5), make_point(5, 3), 1))" << false << QVariant ( " Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))" );
947
962
QTest::newRow ( " x point" ) << " x(make_point(2.2,4.4))" << false << QVariant ( 2.2 );
948
963
QTest::newRow ( " y point" ) << " y(make_point(2.2,4.4))" << false << QVariant ( 4.4 );
949
964
QTest::newRow ( " z point" ) << " z(make_point(2.2,4.4,6.6))" << false << QVariant ( 6.6 );
0 commit comments