Commit 337f73b1 authored by Tom Lane's avatar Tom Lane

Revise geometry regression testing to eliminate most cross-platform

variation.  To do this, set extra_float_digits to -3 in the geometry
test, and tweak the CIRCLE_TBL dataset to avoid values that suffer
from severe cancellation error (eg, circles that just touch an axis).
We still need two geometry 'expected' files to account for the
difference between platforms that display minus zero as '-0' and those
that just say '0', but with luck that's all we'll need.
parent b26dfbb0
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
-- CIRCLE -- CIRCLE
-- --
CREATE TABLE CIRCLE_TBL (f1 circle); CREATE TABLE CIRCLE_TBL (f1 circle);
INSERT INTO CIRCLE_TBL VALUES ('<(0,0),3>'); INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>'); INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
INSERT INTO CIRCLE_TBL VALUES ('1,3,5'); INSERT INTO CIRCLE_TBL VALUES ('1,3,5');
INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)'); INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>'); INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
INSERT INTO CIRCLE_TBL VALUES ('<(100,0),100>'); INSERT INTO CIRCLE_TBL VALUES ('<(100,1),115>');
-- bad values -- bad values
INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>'); INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>');
ERROR: Bad circle external representation '<(-100,0),-100>' ERROR: Bad circle external representation '<(-100,0),-100>'
...@@ -18,24 +18,24 @@ ERROR: Bad circle external representation '(3,(1,2),3)' ...@@ -18,24 +18,24 @@ ERROR: Bad circle external representation '(3,(1,2),3)'
SELECT * FROM CIRCLE_TBL; SELECT * FROM CIRCLE_TBL;
f1 f1
---------------- ----------------
<(0,0),3> <(5,1),3>
<(1,2),100> <(1,2),100>
<(1,3),5> <(1,3),5>
<(1,2),3> <(1,2),3>
<(100,200),10> <(100,200),10>
<(100,0),100> <(100,1),115>
(6 rows) (6 rows)
SELECT '' AS six, center(f1) AS center SELECT '' AS six, center(f1) AS center
FROM CIRCLE_TBL; FROM CIRCLE_TBL;
six | center six | center
-----+----------- -----+-----------
| (0,0) | (5,1)
| (1,2) | (1,2)
| (1,3) | (1,3)
| (1,2) | (1,2)
| (100,200) | (100,200)
| (100,0) | (100,1)
(6 rows) (6 rows)
SELECT '' AS six, radius(f1) AS radius SELECT '' AS six, radius(f1) AS radius
...@@ -47,7 +47,7 @@ SELECT '' AS six, radius(f1) AS radius ...@@ -47,7 +47,7 @@ SELECT '' AS six, radius(f1) AS radius
| 5 | 5
| 3 | 3
| 10 | 10
| 100 | 115
(6 rows) (6 rows)
SELECT '' AS six, diameter(f1) AS diameter SELECT '' AS six, diameter(f1) AS diameter
...@@ -59,13 +59,13 @@ SELECT '' AS six, diameter(f1) AS diameter ...@@ -59,13 +59,13 @@ SELECT '' AS six, diameter(f1) AS diameter
| 10 | 10
| 6 | 6
| 20 | 20
| 200 | 230
(6 rows) (6 rows)
SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5; SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5;
two | f1 two | f1
-----+----------- -----+-----------
| <(0,0),3> | <(5,1),3>
| <(1,2),3> | <(1,2),3>
(2 rows) (2 rows)
...@@ -75,7 +75,7 @@ SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10; ...@@ -75,7 +75,7 @@ SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10;
| <(1,2),100> | <(1,2),100>
| <(1,3),5> | <(1,3),5>
| <(100,200),10> | <(100,200),10>
| <(100,0),100> | <(100,1),115>
(4 rows) (4 rows)
SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
...@@ -84,10 +84,10 @@ SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance ...@@ -84,10 +84,10 @@ SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
ORDER BY distance, one, two; ORDER BY distance, one, two;
five | one | two | distance five | one | two | distance
------+----------------+----------------+------------------ ------+----------------+----------------+------------------
| <(100,200),10> | <(100,0),100> | 90 | <(100,200),10> | <(100,1),115> | 74
| <(100,200),10> | <(1,2),100> | 111.370729772479 | <(100,200),10> | <(1,2),100> | 111.370729772479
| <(1,3),5> | <(100,200),10> | 205.476756144497 | <(1,3),5> | <(100,200),10> | 205.476756144497
| <(5,1),3> | <(100,200),10> | 207.51303816328
| <(1,2),3> | <(100,200),10> | 208.370729772479 | <(1,2),3> | <(100,200),10> | 208.370729772479
| <(0,0),3> | <(100,200),10> | 210.606797749979
(5 rows) (5 rows)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -10,32 +10,15 @@ float8/i.86-.*-netbsd=float8-small-is-zero ...@@ -10,32 +10,15 @@ float8/i.86-.*-netbsd=float8-small-is-zero
float8/.*-qnx=float8-exp-three-digits float8/.*-qnx=float8-exp-three-digits
float8/alpha.*-dec-osf.*:cc=float8-fp-exception float8/alpha.*-dec-osf.*:cc=float8-fp-exception
float8/i.86-pc-cygwin=float8-small-is-zero float8/i.86-pc-cygwin=float8-small-is-zero
geometry/.*-bsdi=geometry-bsd-precision geometry/.*-darwin=geometry-positive-zeros
geometry/.*-darwin=geometry-powerpc-darwin geometry/i.86-.*-freebsd4.[0-5]=geometry-positive-zeros
geometry/i.86-.*-freebsd=geometry-positive-zeros-bsd geometry/alpha.*-freebsd4.[0-5]=geometry-positive-zeros
geometry/i.86-.*-freebsd4.7=geometry-bsd-precision geometry/i.86-.*-openbsd=geometry-positive-zeros
geometry/i.86-.*-freebsd5=geometry-bsd-precision
geometry/alpha.*-freebsd=geometry-positive-zeros
geometry/i.86-.*-openbsd=geometry-positive-zeros-bsd
geometry/sparc-.*-openbsd=geometry-positive-zeros geometry/sparc-.*-openbsd=geometry-positive-zeros
geometry/.*-irix6=geometry-irix
geometry/.*-netbsd=geometry-positive-zeros geometry/.*-netbsd=geometry-positive-zeros
geometry/.*-sysv5.*:cc=geometry-uw7-cc
geometry/.*-sysv5.*:gcc=geometry-uw7-gcc
geometry/alpha.*-dec-osf=geometry-alpha-precision
geometry/hppa.*-hpux9=geometry-positive-zeros geometry/hppa.*-hpux9=geometry-positive-zeros
geometry/hppa.*-hpux10=geometry-positive-zeros geometry/hppa.*-hpux10=geometry-positive-zeros
geometry/hppa.*-hpux11=geometry-solaris-precision geometry/.*-irix6=geometry-positive-zeros
geometry/i.86-.*-gnulibc=geometry-i86-gnulibc
geometry/i.86-pc-cygwin=geometry-solaris-precision
geometry/i.86-pc-solaris2.7=geometry-solaris-i386-pc
geometry/powerpc-unknown-linux-gnu=geometry-powerpc-linux-gnulibc1
geometry/powerpc.*-aix4=geometry-powerpc-aix4
geometry/powerpc.*-aix5=geometry-powerpc-aix4
geometry/sparc-sun-solaris=geometry-solaris-precision
geometry/sparc.*-linux-gnu=geometry-solaris-precision
geometry/alpha.*-linux-gnu=geometry-solaris-precision
geometry/.*-beos=geometry-intel-beos
horology/.*-aix4=horology-no-DST-before-1970 horology/.*-aix4=horology-no-DST-before-1970
horology/.*-aix5=horology-no-DST-before-1970 horology/.*-aix5=horology-no-DST-before-1970
horology/.*-irix6=horology-no-DST-before-1970 horology/.*-irix6=horology-no-DST-before-1970
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
CREATE TABLE CIRCLE_TBL (f1 circle); CREATE TABLE CIRCLE_TBL (f1 circle);
INSERT INTO CIRCLE_TBL VALUES ('<(0,0),3>'); INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>'); INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
...@@ -14,7 +14,7 @@ INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)'); ...@@ -14,7 +14,7 @@ INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>'); INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
INSERT INTO CIRCLE_TBL VALUES ('<(100,0),100>'); INSERT INTO CIRCLE_TBL VALUES ('<(100,1),115>');
-- bad values -- bad values
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
-- GEOMETRY -- GEOMETRY
-- --
-- Back off displayed precision a little bit to reduce platform-to-platform
-- variation in results.
SET extra_float_digits TO -3;
-- --
-- Points -- Points
-- --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment