]> granicus.if.org Git - postgis/commitdiff
Move tests for ST_ChangeEdgeGeom into a dedicated file. Prepared for ticket #979...
authorSandro Santilli <strk@keybit.net>
Tue, 24 May 2011 08:13:46 +0000 (08:13 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 24 May 2011 08:13:46 +0000 (08:13 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7225 b70326c6-7e19-0410-871a-916f4a2858ee

topology/test/Makefile
topology/test/regress/sqlmm.sql
topology/test/regress/sqlmm_expected
topology/test/regress/st_changeedgegeom.sql [new file with mode: 0644]
topology/test/regress/st_changeedgegeom_expected [new file with mode: 0644]

index b2cdb72a85f06fdad22aa1bc54acb6989f8149cc..b5ce7eb1fd0c3da57e9ccb74a2792dfd22bb336a 100644 (file)
@@ -31,6 +31,7 @@ TESTS = regress/legacy_validate.sql regress/legacy_predicate.sql \
        regress/st_addisoedge.sql \
        regress/st_addisonode.sql \
        regress/st_addedgenewfaces.sql \
+       regress/st_changeedgegeom.sql \
        regress/st_getfacegeometry.sql \
        regress/st_getfaceedges.sql \
        regress/st_modedgeheal.sql \
index 08a61f45dfd5ce61fa8d6b18dab10bf1e5ac4119..7663b857caaee466e5f89d2bb266ac1fe84bf462 100644 (file)
@@ -97,22 +97,6 @@ SELECT '-- ST_AddIsoNode(2) ------------------------';
 -- ST_AddIsoNode edge-crossing node 
 SELECT topology.ST_AddIsoNode('sqlmm_topology', NULL, 'POINT(5 9.5)');
 
--------------------------------------------------------------
--- ST_ChangeEdgeGeom
--------------------------------------------------------------
-
-SELECT '-- ST_ChangeEdgeGeom ------------------------';
-
--- good one
-SELECT topology.ST_ChangeEdgeGeom('sqlmm_topology', 1, 'LINESTRING(5 10, 5 8, 10 10)');
-
--- start/end points mismatch
-SELECT topology.ST_ChangeEdgeGeom('sqlmm_topology', 1, 'LINESTRING(5 9, 5 8, 10 10)');
-SELECT topology.ST_ChangeEdgeGeom('sqlmm_topology', 1, 'LINESTRING(5 10, 5 8, 10 9)');
-
--- Node crossing 
-SELECT topology.ST_ChangeEdgeGeom('sqlmm_topology', 1, 'LINESTRING(5 10, 10 10)');
-
 -------------------------------------------------------------
 -- ST_RemoveIsoNode
 -------------------------------------------------------------
index 6c13ed3794d53f6cedcd62b42b12f37b7cf63813..e429a8de7d16c77e32cf25fe4041c3770ddbf62d 100644 (file)
@@ -36,11 +36,6 @@ ERROR:  SQL/MM Spatial exception - not isolated node
 ERROR:  SQL/MM Spatial exception - not isolated node
 -- ST_AddIsoNode(2) ------------------------
 ERROR:  SQL/MM Spatial exception - edge crosses node.
--- ST_ChangeEdgeGeom ------------------------
-Edge 1 changed
-ERROR:  SQL/MM Spatial exception - start node not geometry start point.
-ERROR:  SQL/MM Spatial exception - end node not geometry end point.
-ERROR:  SQL/MM Spatial exception - geometry crosses a node
 -- ST_RemoveIsoNode  ------------------------
 ERROR:  SQL/MM Spatial exception - not isolated node
 ERROR:  SQL/MM Spatial exception - not isolated node
diff --git a/topology/test/regress/st_changeedgegeom.sql b/topology/test/regress/st_changeedgegeom.sql
new file mode 100644 (file)
index 0000000..789619c
--- /dev/null
@@ -0,0 +1,23 @@
+set client_min_messages to ERROR;
+
+\i load_topology.sql
+
+
+-- good one
+SELECT topology.ST_ChangeEdgeGeom('city_data', 25,
+ 'LINESTRING(9 35, 11 33, 13 35)');
+
+-- start/end points mismatch
+SELECT topology.ST_ChangeEdgeGeom('city_data', 25,
+ 'LINESTRING(10 35, 13 35)');
+SELECT topology.ST_ChangeEdgeGeom('city_data', 25,
+ 'LINESTRING(9 35, 13 36)');
+
+-- Node crossing 
+SELECT topology.ST_ChangeEdgeGeom('city_data', 3,
+  'LINESTRING(25 30, 20 36, 20 38, 25 35)');
+
+-- TODO: test edge crossing
+-- TODO: test non-existent edge (#979)
+
+SELECT topology.DropTopology('city_data');
diff --git a/topology/test/regress/st_changeedgegeom_expected b/topology/test/regress/st_changeedgegeom_expected
new file mode 100644 (file)
index 0000000..41c8d11
--- /dev/null
@@ -0,0 +1,11 @@
+BEGIN
+t
+9
+22
+26
+COMMIT
+Edge 25 changed
+ERROR:  SQL/MM Spatial exception - start node not geometry start point.
+ERROR:  SQL/MM Spatial exception - end node not geometry end point.
+ERROR:  SQL/MM Spatial exception - geometry crosses a node
+Topology 'city_data' dropped