Skip to content
Snippets Groups Projects
Commit 533d0915 authored by Neil Conway's avatar Neil Conway
Browse files

Update the float8 regression tests: they should now pass on FreeBSD 4.x

and (in theory) QNX. Thanks to Chris KL for the report.
parent 1c4da387
No related branches found
No related tags found
No related merge requests found
......@@ -7,14 +7,14 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
-- test for underflow and overflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
-- test for underflow and overflow handling
SELECT '10e400'::float8;
ERROR: "10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
SELECT '-10e400'::float8;
ERROR: "-10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
SELECT '10e-400'::float8;
ERROR: "10e-400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
SELECT '-10e-400'::float8;
ERROR: "-10e-400" is out of range for type double precision
-- bad input
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
......
......@@ -7,6 +7,81 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
-- test for underflow and overflow handling
SELECT '10e400'::float8;
ERROR: "10e400" is out of range for type double precision
SELECT '-10e400'::float8;
ERROR: "-10e400" is out of range for type double precision
SELECT '10e-400'::float8;
ERROR: "10e-400" is out of range for type double precision
SELECT '-10e-400'::float8;
ERROR: "-10e-400" is out of range for type double precision
-- bad input
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
ERROR: invalid input syntax for type double precision: " "
INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
ERROR: invalid input syntax for type double precision: "xyz"
INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
ERROR: invalid input syntax for type double precision: "5.0.0"
INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
ERROR: invalid input syntax for type double precision: "5 . 0"
INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
ERROR: invalid input syntax for type double precision: "5. 0"
INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
ERROR: invalid input syntax for type double precision: " - 3"
INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
ERROR: invalid input syntax for type double precision: "123 5"
-- special inputs
SELECT 'NaN'::float8;
float8
--------
NaN
(1 row)
SELECT 'nan'::float8;
float8
--------
NaN
(1 row)
SELECT ' NAN '::float8;
float8
--------
NaN
(1 row)
SELECT 'infinity'::float8;
float8
----------
Infinity
(1 row)
SELECT ' -INFINiTY '::float8;
float8
-----------
-Infinity
(1 row)
-- bad special inputs
SELECT 'N A N'::float8;
ERROR: invalid input syntax for type double precision: "N A N"
SELECT 'NaN x'::float8;
ERROR: invalid input syntax for type double precision: "NaN x"
SELECT ' INFINITY x'::float8;
ERROR: invalid input syntax for type double precision: " INFINITY x"
SELECT 'Infinity'::float8 + 100.0;
ERROR: type "double precision" value out of range: overflow
SELECT 'Infinity'::float8 / 'Infinity'::float8;
?column?
----------
NaN
(1 row)
SELECT 'nan'::float8 / 'nan'::float8;
?column?
----------
NaN
(1 row)
SELECT '' AS five, FLOAT8_TBL.*;
five | f1
------+----------------------
......
......@@ -7,6 +7,90 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
-- test for underflow and overflow handling
SELECT '10e400'::float8;
ERROR: "10e400" is out of range for type double precision
SELECT '-10e400'::float8;
ERROR: "-10e400" is out of range for type double precision
SELECT '10e-400'::float8;
float8
--------
0
(1 row)
SELECT '-10e-400'::float8;
float8
--------
-0
(1 row)
-- bad input
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
ERROR: invalid input syntax for type double precision: " "
INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
ERROR: invalid input syntax for type double precision: "xyz"
INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
ERROR: invalid input syntax for type double precision: "5.0.0"
INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
ERROR: invalid input syntax for type double precision: "5 . 0"
INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
ERROR: invalid input syntax for type double precision: "5. 0"
INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
ERROR: invalid input syntax for type double precision: " - 3"
INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
ERROR: invalid input syntax for type double precision: "123 5"
-- special inputs
SELECT 'NaN'::float8;
float8
--------
NaN
(1 row)
SELECT 'nan'::float8;
float8
--------
NaN
(1 row)
SELECT ' NAN '::float8;
float8
--------
NaN
(1 row)
SELECT 'infinity'::float8;
float8
----------
Infinity
(1 row)
SELECT ' -INFINiTY '::float8;
float8
-----------
-Infinity
(1 row)
-- bad special inputs
SELECT 'N A N'::float8;
ERROR: invalid input syntax for type double precision: "N A N"
SELECT 'NaN x'::float8;
ERROR: invalid input syntax for type double precision: "NaN x"
SELECT ' INFINITY x'::float8;
ERROR: invalid input syntax for type double precision: " INFINITY x"
SELECT 'Infinity'::float8 + 100.0;
ERROR: type "double precision" value out of range: overflow
SELECT 'Infinity'::float8 / 'Infinity'::float8;
?column?
----------
NaN
(1 row)
SELECT 'nan'::float8 / 'nan'::float8;
?column?
----------
NaN
(1 row)
SELECT '' AS five, FLOAT8_TBL.*;
five | f1
------+----------------------
......
......@@ -7,14 +7,14 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
-- test for underflow and overflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
-- test for underflow and overflow handling
SELECT '10e400'::float8;
ERROR: "10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
SELECT '-10e400'::float8;
ERROR: "-10e400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
SELECT '10e-400'::float8;
ERROR: "10e-400" is out of range for type double precision
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
SELECT '-10e-400'::float8;
ERROR: "-10e-400" is out of range for type double precision
-- bad input
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
......
......@@ -10,11 +10,11 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
-- test for underflow and overflow
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
-- test for underflow and overflow handling
SELECT '10e400'::float8;
SELECT '-10e400'::float8;
SELECT '10e-400'::float8;
SELECT '-10e-400'::float8;
-- bad input
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment