Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit533d091

Browse files
author
Neil Conway
committed
Update the float8 regression tests: they should now pass on FreeBSD 4.x
and (in theory) QNX. Thanks to Chris KL for the report.
1 parent1c4da38 commit533d091

File tree

5 files changed

+180
-21
lines changed

5 files changed

+180
-21
lines changed

‎src/test/regress/expected/float8-exp-three-digits-win32.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
77
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
88
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
99
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
10-
-- test for underflow and overflow
11-
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
10+
-- test for underflow and overflow handling
11+
SELECT'10e400'::float8;
1212
ERROR: "10e400" is out of range for type double precision
13-
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
13+
SELECT'-10e400'::float8;
1414
ERROR: "-10e400" is out of range for type double precision
15-
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
15+
SELECT'10e-400'::float8;
1616
ERROR: "10e-400" is out of range for type double precision
17-
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
17+
SELECT'-10e-400'::float8;
1818
ERROR: "-10e-400" is out of range for type double precision
1919
-- bad input
2020
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');

‎src/test/regress/expected/float8-exp-three-digits.out

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,86 @@
22
-- FLOAT8
33
--
44
CREATE TABLE FLOAT8_TBL(f1 float8);
5-
INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
6-
INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
7-
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
5+
INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
6+
INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
7+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
88
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
99
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
10+
-- test for underflow and overflow handling
11+
SELECT '10e400'::float8;
12+
ERROR: "10e400" is out of range for type double precision
13+
SELECT '-10e400'::float8;
14+
ERROR: "-10e400" is out of range for type double precision
15+
SELECT '10e-400'::float8;
16+
ERROR: "10e-400" is out of range for type double precision
17+
SELECT '-10e-400'::float8;
18+
ERROR: "-10e-400" is out of range for type double precision
19+
-- bad input
20+
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
21+
ERROR: invalid input syntax for type double precision: " "
22+
INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
23+
ERROR: invalid input syntax for type double precision: "xyz"
24+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
25+
ERROR: invalid input syntax for type double precision: "5.0.0"
26+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
27+
ERROR: invalid input syntax for type double precision: "5 . 0"
28+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
29+
ERROR: invalid input syntax for type double precision: "5. 0"
30+
INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
31+
ERROR: invalid input syntax for type double precision: " - 3"
32+
INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
33+
ERROR: invalid input syntax for type double precision: "123 5"
34+
-- special inputs
35+
SELECT 'NaN'::float8;
36+
float8
37+
--------
38+
NaN
39+
(1 row)
40+
SELECT 'nan'::float8;
41+
float8
42+
--------
43+
NaN
44+
(1 row)
45+
46+
SELECT ' NAN '::float8;
47+
float8
48+
--------
49+
NaN
50+
(1 row)
51+
52+
SELECT 'infinity'::float8;
53+
float8
54+
----------
55+
Infinity
56+
(1 row)
57+
58+
SELECT ' -INFINiTY '::float8;
59+
float8
60+
-----------
61+
-Infinity
62+
(1 row)
63+
64+
-- bad special inputs
65+
SELECT 'N A N'::float8;
66+
ERROR: invalid input syntax for type double precision: "N A N"
67+
SELECT 'NaN x'::float8;
68+
ERROR: invalid input syntax for type double precision: "NaN x"
69+
SELECT ' INFINITY x'::float8;
70+
ERROR: invalid input syntax for type double precision: " INFINITY x"
71+
SELECT 'Infinity'::float8 + 100.0;
72+
ERROR: type "double precision" value out of range: overflow
73+
SELECT 'Infinity'::float8 / 'Infinity'::float8;
74+
?column?
75+
----------
76+
NaN
77+
(1 row)
78+
79+
SELECT 'nan'::float8 / 'nan'::float8;
80+
?column?
81+
----------
82+
NaN
83+
(1 row)
84+
1085
SELECT '' AS five, FLOAT8_TBL.*;
1186
five | f1
1287
------+----------------------

‎src/test/regress/expected/float8-small-is-zero.out

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,95 @@
22
-- FLOAT8
33
--
44
CREATE TABLE FLOAT8_TBL(f1 float8);
5-
INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
6-
INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
7-
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
5+
INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
6+
INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
7+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
88
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
99
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
10+
-- test for underflow and overflow handling
11+
SELECT '10e400'::float8;
12+
ERROR: "10e400" is out of range for type double precision
13+
SELECT '-10e400'::float8;
14+
ERROR: "-10e400" is out of range for type double precision
15+
SELECT '10e-400'::float8;
16+
float8
17+
--------
18+
0
19+
(1 row)
20+
21+
SELECT '-10e-400'::float8;
22+
float8
23+
--------
24+
-0
25+
(1 row)
26+
27+
-- bad input
28+
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
29+
ERROR: invalid input syntax for type double precision: " "
30+
INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
31+
ERROR: invalid input syntax for type double precision: "xyz"
32+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
33+
ERROR: invalid input syntax for type double precision: "5.0.0"
34+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
35+
ERROR: invalid input syntax for type double precision: "5 . 0"
36+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
37+
ERROR: invalid input syntax for type double precision: "5. 0"
38+
INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
39+
ERROR: invalid input syntax for type double precision: " - 3"
40+
INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
41+
ERROR: invalid input syntax for type double precision: "123 5"
42+
-- special inputs
43+
SELECT 'NaN'::float8;
44+
float8
45+
--------
46+
NaN
47+
(1 row)
48+
49+
SELECT 'nan'::float8;
50+
float8
51+
--------
52+
NaN
53+
(1 row)
54+
55+
SELECT ' NAN '::float8;
56+
float8
57+
--------
58+
NaN
59+
(1 row)
60+
61+
SELECT 'infinity'::float8;
62+
float8
63+
----------
64+
Infinity
65+
(1 row)
66+
67+
SELECT ' -INFINiTY '::float8;
68+
float8
69+
-----------
70+
-Infinity
71+
(1 row)
72+
73+
-- bad special inputs
74+
SELECT 'N A N'::float8;
75+
ERROR: invalid input syntax for type double precision: "N A N"
76+
SELECT 'NaN x'::float8;
77+
ERROR: invalid input syntax for type double precision: "NaN x"
78+
SELECT ' INFINITY x'::float8;
79+
ERROR: invalid input syntax for type double precision: " INFINITY x"
80+
SELECT 'Infinity'::float8 + 100.0;
81+
ERROR: type "double precision" value out of range: overflow
82+
SELECT 'Infinity'::float8 / 'Infinity'::float8;
83+
?column?
84+
----------
85+
NaN
86+
(1 row)
87+
88+
SELECT 'nan'::float8 / 'nan'::float8;
89+
?column?
90+
----------
91+
NaN
92+
(1 row)
93+
1094
SELECT '' AS five, FLOAT8_TBL.*;
1195
five | f1
1296
------+----------------------

‎src/test/regress/expected/float8.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 ');
77
INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
88
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
99
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
10-
-- test for underflow and overflow
11-
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
10+
-- test for underflow and overflow handling
11+
SELECT'10e400'::float8;
1212
ERROR: "10e400" is out of range for type double precision
13-
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
13+
SELECT'-10e400'::float8;
1414
ERROR: "-10e400" is out of range for type double precision
15-
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
15+
SELECT'10e-400'::float8;
1616
ERROR: "10e-400" is out of range for type double precision
17-
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
17+
SELECT'-10e-400'::float8;
1818
ERROR: "-10e-400" is out of range for type double precision
1919
-- bad input
2020
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');

‎src/test/regress/sql/float8.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84');
1010
INSERT INTO FLOAT8_TBL(f1)VALUES ('1.2345678901234e+200');
1111
INSERT INTO FLOAT8_TBL(f1)VALUES ('1.2345678901234e-200');
1212

13-
-- test for underflow and overflow
14-
INSERT INTO FLOAT8_TBL(f1)VALUES ('10e400');
15-
INSERT INTO FLOAT8_TBL(f1)VALUES ('-10e400');
16-
INSERT INTO FLOAT8_TBL(f1)VALUES ('10e-400');
17-
INSERT INTO FLOAT8_TBL(f1)VALUES ('-10e-400');
13+
-- test for underflow and overflow handling
14+
SELECT'10e400'::float8;
15+
SELECT'-10e400'::float8;
16+
SELECT'10e-400'::float8;
17+
SELECT'-10e-400'::float8;
1818

1919
-- bad input
2020
INSERT INTO FLOAT8_TBL(f1)VALUES ('');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp