From 78154ae8e99ccab7afb7355b78d01528893fb923 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 10 Dec 2015 10:15:14 +0000 Subject: [PATCH] Move ST_EstimatedExtent tests in their own file git-svn-id: http://svn.osgeo.org/postgis/trunk@14480 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/Makefile.in | 1 + regress/estimatedextent.sql | 29 +++++++++++++++++++++++++++++ regress/estimatedextent_expected | 7 +++++++ regress/tickets.sql | 28 ---------------------------- regress/tickets_expected | 7 ------- 5 files changed, 37 insertions(+), 35 deletions(-) create mode 100644 regress/estimatedextent.sql create mode 100644 regress/estimatedextent_expected diff --git a/regress/Makefile.in b/regress/Makefile.in index 3a400cb14..71304ffef 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -84,6 +84,7 @@ TESTS = \ dump \ dumppoints \ empty \ + estimatedextent \ forcecurve \ geography \ in_geohash \ diff --git a/regress/estimatedextent.sql b/regress/estimatedextent.sql new file mode 100644 index 000000000..b33107882 --- /dev/null +++ b/regress/estimatedextent.sql @@ -0,0 +1,29 @@ +-- #877, #818 +create table t(g geometry); +select '#877.1', ST_EstimatedExtent('t','g'); +analyze t; +select '#877.2', ST_EstimatedExtent('public', 't','g'); +SET client_min_messages TO DEBUG; +select '#877.2.deprecated', ST_Estimated_Extent('public', 't','g'); +SET client_min_messages TO NOTICE; +insert into t(g) values ('LINESTRING(-10 -50, 20 30)'); + +-- #877.3 +with e as ( select ST_EstimatedExtent('t','g') as e ) +select '#877.3', round(st_xmin(e.e)::numeric, 5), round(st_xmax(e.e)::numeric, 5), +round(st_ymin(e.e)::numeric, 5), round(st_ymax(e.e)::numeric, 5) from e; + +-- #877.4 +analyze t; +with e as ( select ST_EstimatedExtent('t','g') as e ) +select '#877.4', round(st_xmin(e.e)::numeric, 5), round(st_xmax(e.e)::numeric, 5), +round(st_ymin(e.e)::numeric, 5), round(st_ymax(e.e)::numeric, 5) from e; + +-- #877.5 +truncate t; +with e as ( select ST_EstimatedExtent('t','g') as e ) +select '#877.5', round(st_xmin(e.e)::numeric, 5), round(st_xmax(e.e)::numeric, 5), +round(st_ymin(e.e)::numeric, 5), round(st_ymax(e.e)::numeric, 5) from e; +drop table t; + + diff --git a/regress/estimatedextent_expected b/regress/estimatedextent_expected new file mode 100644 index 000000000..bc65afc96 --- /dev/null +++ b/regress/estimatedextent_expected @@ -0,0 +1,7 @@ +ERROR: stats for "t.g" do not exist +ERROR: stats for "t.g" do not exist +WARNING: ST_Estimated_Extent signature was deprecated in 2.1.0. Please use ST_EstimatedExtent +ERROR: stats for "t.g" do not exist +ERROR: stats for "t.g" do not exist +#877.4|-10.15000|20.15000|-50.40000|30.40000 +#877.5|-10.15000|20.15000|-50.40000|30.40000 diff --git a/regress/tickets.sql b/regress/tickets.sql index a9ced6e8a..370228815 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -449,34 +449,6 @@ SELECT '#1273', st_equals(p.g, postgis_addbbox(p.g)) from p; WITH p AS ( SELECT 'MULTIPOINT((832694.188 816254.625))'::geometry as g ) SELECT '#1273.1', st_equals(p.g, postgis_dropbbox(p.g)) from p; --- #877, #818 -create table t(g geometry); -select '#877.1', ST_EstimatedExtent('t','g'); -analyze t; -select '#877.2', ST_EstimatedExtent('public', 't','g'); -SET client_min_messages TO DEBUG; -select '#877.2.deprecated', ST_Estimated_Extent('public', 't','g'); -SET client_min_messages TO NOTICE; -insert into t(g) values ('LINESTRING(-10 -50, 20 30)'); - --- #877.3 -with e as ( select ST_EstimatedExtent('t','g') as e ) -select '#877.3', round(st_xmin(e.e)::numeric, 5), round(st_xmax(e.e)::numeric, 5), -round(st_ymin(e.e)::numeric, 5), round(st_ymax(e.e)::numeric, 5) from e; - --- #877.4 -analyze t; -with e as ( select ST_EstimatedExtent('t','g') as e ) -select '#877.4', round(st_xmin(e.e)::numeric, 5), round(st_xmax(e.e)::numeric, 5), -round(st_ymin(e.e)::numeric, 5), round(st_ymax(e.e)::numeric, 5) from e; - --- #877.5 -truncate t; -with e as ( select ST_EstimatedExtent('t','g') as e ) -select '#877.5', round(st_xmin(e.e)::numeric, 5), round(st_xmax(e.e)::numeric, 5), -round(st_ymin(e.e)::numeric, 5), round(st_ymax(e.e)::numeric, 5) from e; -drop table t; - -- #1292 SELECT '#1292', ST_AsText(ST_SnapToGrid(ST_GeomFromText( 'GEOMETRYCOLLECTION(POINT(180 90),POLYGON((140 50,150 50,180 50,140 50),(140 60,150 60,180 60,140 60)))' diff --git a/regress/tickets_expected b/regress/tickets_expected index 8a83aeb71..b4e83b24f 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -144,13 +144,6 @@ ERROR: First argument must be a LINESTRING #1060|FFFFFFFF2 #1273|t #1273.1|t -ERROR: stats for "t.g" do not exist -ERROR: stats for "t.g" do not exist -WARNING: ST_Estimated_Extent signature was deprecated in 2.1.0. Please use ST_EstimatedExtent -ERROR: stats for "t.g" do not exist -ERROR: stats for "t.g" do not exist -#877.4|-10.15000|20.15000|-50.40000|30.40000 -#877.5|-10.15000|20.15000|-50.40000|30.40000 #1292|GEOMETRYCOLLECTION(POINT(180 90),POLYGON((140 50,150 50,180 50,140 50),(140 60,150 60,180 60,140 60))) NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY -- 2.40.0