From e0008fb9ab27fac80a2aa1502fc3cdd0fe63ede9 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 1 Mar 2012 15:14:27 +0000 Subject: [PATCH] Add a test for #1641 using a tolerance (1e-16 is good enough) git-svn-id: http://svn.osgeo.org/postgis/trunk@9368 b70326c6-7e19-0410-871a-916f4a2858ee --- .../test/regress/topogeo_addlinestring.sql | 21 +++++++++++++++++-- .../regress/topogeo_addlinestring_expected | 13 ++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql index 2084a9413..9536b6252 100644 --- a/topology/test/regress/topogeo_addlinestring.sql +++ b/topology/test/regress/topogeo_addlinestring.sql @@ -144,16 +144,33 @@ SELECT check_changes(); -- See http://trac.osgeo.org/postgis/ticket/1641 +-- clean all up first +DELETE FROM city_data.edge_data; +DELETE FROM city_data.node; +DELETE FROM city_data.face where face_id > 0; + +SELECT '#1641.1', TopoGeo_addLineString('city_data', + 'LINESTRING(-0.223586 0.474301, 0.142550 0.406124)' +) ORDER BY 2; +SELECT check_changes(); +-- Use a tolerance +SELECT '#1641.2', TopoGeo_addLineString('city_data', + 'LINESTRING(0.095989 0.113619, -0.064646 0.470149)' + , 1e-16 +) ORDER BY 2; +SELECT check_changes(); + +-- Fails w/out tolerance as of 2.0.0 --FAILS---- clean all up first --FAILS--DELETE FROM city_data.edge_data; --FAILS--DELETE FROM city_data.node; --FAILS--DELETE FROM city_data.face where face_id > 0; --FAILS-- ---FAILS--SELECT '#1641.1', TopoGeo_addLineString('city_data', +--FAILS--SELECT '#1641.3', TopoGeo_addLineString('city_data', --FAILS-- 'LINESTRING(-0.223586 0.474301, 0.142550 0.406124)' --FAILS--) ORDER BY 2; --FAILS--SELECT check_changes(); ---FAILS--SELECT '#1641.2', TopoGeo_addLineString('city_data', +--FAILS--SELECT '#1641.4', TopoGeo_addLineString('city_data', --FAILS-- 'LINESTRING(0.095989 0.113619, -0.064646 0.470149)' --FAILS--) ORDER BY 2; --FAILS--SELECT check_changes(); diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected index e820ee739..3de84a9d2 100644 --- a/topology/test/regress/topogeo_addlinestring_expected +++ b/topology/test/regress/topogeo_addlinestring_expected @@ -121,4 +121,17 @@ E|55|sn51|en54 E|56|sn54|en52 E|57|sn53|en54 E|58|sn54|en55 +#1641.1|59 +N|56||POINT(-0.2 0.4) +N|57||POINT(0.2 0.4) +E|59|sn56|en57 +#1641.2|61 +#1641.2|62 +N|58||POINT(0 0.2) +N|59||POINT(0 0.4) +N|60||POINT(0 0.4) +E|59|sn56|en59 +E|60|sn59|en57 +E|61|sn58|en59 +E|62|sn59|en60 Topology 'city_data' dropped -- 2.40.0