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

Commit58fb345

Browse files
author
Michael Meskes
committed
Usage of isnan() in ECPG regression tests probably needs '#include <float.h>' as well.
1 parenta96ad2f commit58fb345

File tree

3 files changed

+221
-219
lines changed

3 files changed

+221
-219
lines changed

‎src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include<stdio.h>
1111
#include<stdlib.h>
1212
#include<math.h>
13+
#include<float.h>
1314
#include<pgtypes_numeric.h>
1415
#include<decimal.h>
1516

@@ -21,7 +22,7 @@
2122

2223

2324

24-
#line7 "nan_test.pgc"
25+
#line8 "nan_test.pgc"
2526

2627

2728
int
@@ -33,54 +34,54 @@ main(void)
3334

3435

3536

36-
#line13 "nan_test.pgc"
37+
#line14 "nan_test.pgc"
3738
intid ;
3839

39-
#line14 "nan_test.pgc"
40+
#line15 "nan_test.pgc"
4041
doubled ;
4142

42-
#line15 "nan_test.pgc"
43+
#line16 "nan_test.pgc"
4344
numeric*num ;
4445

45-
#line16 "nan_test.pgc"
46+
#line17 "nan_test.pgc"
4647
charval [16 ] ;
4748
/* exec sql end declare section */
48-
#line17 "nan_test.pgc"
49+
#line18 "nan_test.pgc"
4950

5051

5152
ECPGdebug(1,stderr);
5253
/* exec sql whenever sqlerror do sqlprint ( ) ; */
53-
#line20 "nan_test.pgc"
54+
#line21 "nan_test.pgc"
5455

5556

5657
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,NULL,0);
57-
#line22 "nan_test.pgc"
58+
#line23 "nan_test.pgc"
5859

5960
if (sqlca.sqlcode<0)sqlprint ( );}
60-
#line22 "nan_test.pgc"
61+
#line23 "nan_test.pgc"
6162

6263

6364
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table nantest1 ( id int4 , d float8 )",ECPGt_EOIT,ECPGt_EORT);
64-
#line24 "nan_test.pgc"
65+
#line25 "nan_test.pgc"
6566

6667
if (sqlca.sqlcode<0)sqlprint ( );}
67-
#line24 "nan_test.pgc"
68+
#line25 "nan_test.pgc"
6869

6970
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )",ECPGt_EOIT,ECPGt_EORT);
70-
#line25 "nan_test.pgc"
71+
#line26 "nan_test.pgc"
7172

7273
if (sqlca.sqlcode<0)sqlprint ( );}
73-
#line25 "nan_test.pgc"
74+
#line26 "nan_test.pgc"
7475

7576

7677
/* declare cur cursor for select id , d , d from nantest1 */
77-
#line27 "nan_test.pgc"
78+
#line28 "nan_test.pgc"
7879

7980
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur cursor for select id , d , d from nantest1",ECPGt_EOIT,ECPGt_EORT);
80-
#line28 "nan_test.pgc"
81+
#line29 "nan_test.pgc"
8182

8283
if (sqlca.sqlcode<0)sqlprint ( );}
83-
#line28 "nan_test.pgc"
84+
#line29 "nan_test.pgc"
8485

8586
while (1)
8687
{
@@ -91,10 +92,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
9192
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
9293
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
9394
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
94-
#line31 "nan_test.pgc"
95+
#line32 "nan_test.pgc"
9596

9697
if (sqlca.sqlcode<0)sqlprint ( );}
97-
#line31 "nan_test.pgc"
98+
#line32 "nan_test.pgc"
9899

99100
if (sqlca.sqlcode)
100101
break;
@@ -108,34 +109,34 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
108109
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
109110
ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
110111
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
111-
#line39 "nan_test.pgc"
112+
#line40 "nan_test.pgc"
112113

113114
if (sqlca.sqlcode<0)sqlprint ( );}
114-
#line39 "nan_test.pgc"
115+
#line40 "nan_test.pgc"
115116

116117
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
117118
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
118119
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
119120
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
120121
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
121-
#line40 "nan_test.pgc"
122+
#line41 "nan_test.pgc"
122123

123124
if (sqlca.sqlcode<0)sqlprint ( );}
124-
#line40 "nan_test.pgc"
125+
#line41 "nan_test.pgc"
125126

126127
}
127128
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur",ECPGt_EOIT,ECPGt_EORT);
128-
#line42 "nan_test.pgc"
129+
#line43 "nan_test.pgc"
129130

130131
if (sqlca.sqlcode<0)sqlprint ( );}
131-
#line42 "nan_test.pgc"
132+
#line43 "nan_test.pgc"
132133

133134

134135
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur cursor for select id , d , d from nantest1",ECPGt_EOIT,ECPGt_EORT);
135-
#line44 "nan_test.pgc"
136+
#line45 "nan_test.pgc"
136137

137138
if (sqlca.sqlcode<0)sqlprint ( );}
138-
#line44 "nan_test.pgc"
139+
#line45 "nan_test.pgc"
139140

140141
while (1)
141142
{
@@ -146,10 +147,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
146147
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
147148
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
148149
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
149-
#line47 "nan_test.pgc"
150+
#line48 "nan_test.pgc"
150151

151152
if (sqlca.sqlcode<0)sqlprint ( );}
152-
#line47 "nan_test.pgc"
153+
#line48 "nan_test.pgc"
153154

154155
if (sqlca.sqlcode)
155156
break;
@@ -159,25 +160,25 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
159160
printf("%d NaN '%s'\n",id,val);
160161
}
161162
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur",ECPGt_EOIT,ECPGt_EORT);
162-
#line55 "nan_test.pgc"
163+
#line56 "nan_test.pgc"
163164

164165
if (sqlca.sqlcode<0)sqlprint ( );}
165-
#line55 "nan_test.pgc"
166+
#line56 "nan_test.pgc"
166167

167168

168169
num=PGTYPESnumeric_new();
169170

170171
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table nantest2 ( id int4 , d numeric )",ECPGt_EOIT,ECPGt_EORT);
171-
#line59 "nan_test.pgc"
172+
#line60 "nan_test.pgc"
172173

173174
if (sqlca.sqlcode<0)sqlprint ( );}
174-
#line59 "nan_test.pgc"
175+
#line60 "nan_test.pgc"
175176

176177
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )",ECPGt_EOIT,ECPGt_EORT);
177-
#line60 "nan_test.pgc"
178+
#line61 "nan_test.pgc"
178179

179180
if (sqlca.sqlcode<0)sqlprint ( );}
180-
#line60 "nan_test.pgc"
181+
#line61 "nan_test.pgc"
181182

182183

183184
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"select id , d , d from nantest2 where id = 4",ECPGt_EOIT,
@@ -187,39 +188,39 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
187188
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
188189
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
189190
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
190-
#line62 "nan_test.pgc"
191+
#line63 "nan_test.pgc"
191192

192193
if (sqlca.sqlcode<0)sqlprint ( );}
193-
#line62 "nan_test.pgc"
194+
#line63 "nan_test.pgc"
194195

195196

196197
printf("%d %s '%s'\n",id, (num->sign==NUMERIC_NAN ?"NaN" :"not NaN"),val);
197198

198199
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 5 , $1 )",
199200
ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
200201
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
201-
#line66 "nan_test.pgc"
202+
#line67 "nan_test.pgc"
202203

203204
if (sqlca.sqlcode<0)sqlprint ( );}
204-
#line66 "nan_test.pgc"
205+
#line67 "nan_test.pgc"
205206

206207
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 6 , $1 )",
207208
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
208209
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
209-
#line67 "nan_test.pgc"
210+
#line68 "nan_test.pgc"
210211

211212
if (sqlca.sqlcode<0)sqlprint ( );}
212-
#line67 "nan_test.pgc"
213+
#line68 "nan_test.pgc"
213214

214215

215216
/* declare cur1 cursor for select id , d , d from nantest2 */
216-
#line69 "nan_test.pgc"
217+
#line70 "nan_test.pgc"
217218

218219
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur1 cursor for select id , d , d from nantest2",ECPGt_EOIT,ECPGt_EORT);
219-
#line70 "nan_test.pgc"
220+
#line71 "nan_test.pgc"
220221

221222
if (sqlca.sqlcode<0)sqlprint ( );}
222-
#line70 "nan_test.pgc"
223+
#line71 "nan_test.pgc"
223224

224225
while (1)
225226
{
@@ -230,33 +231,33 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
230231
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
231232
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
232233
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
233-
#line73 "nan_test.pgc"
234+
#line74 "nan_test.pgc"
234235

235236
if (sqlca.sqlcode<0)sqlprint ( );}
236-
#line73 "nan_test.pgc"
237+
#line74 "nan_test.pgc"
237238

238239
if (sqlca.sqlcode)
239240
break;
240241
printf("%d %s '%s'\n",id, (num->sign==NUMERIC_NAN ?"NaN" :"not NaN"),val);
241242
}
242243
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur1",ECPGt_EOIT,ECPGt_EORT);
243-
#line78 "nan_test.pgc"
244+
#line79 "nan_test.pgc"
244245

245246
if (sqlca.sqlcode<0)sqlprint ( );}
246-
#line78 "nan_test.pgc"
247+
#line79 "nan_test.pgc"
247248

248249

249250
{ECPGtrans(__LINE__,NULL,"rollback");
250-
#line80 "nan_test.pgc"
251+
#line81 "nan_test.pgc"
251252

252253
if (sqlca.sqlcode<0)sqlprint ( );}
253-
#line80 "nan_test.pgc"
254+
#line81 "nan_test.pgc"
254255

255256
{ECPGdisconnect(__LINE__,"CURRENT");
256-
#line81 "nan_test.pgc"
257+
#line82 "nan_test.pgc"
257258

258259
if (sqlca.sqlcode<0)sqlprint ( );}
259-
#line81 "nan_test.pgc"
260+
#line82 "nan_test.pgc"
260261

261262

262263
return (0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp