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

Commitc34446c

Browse files
author
Michael Meskes
committed
First try to make this one ecpg regression test work on Windows too. I'm just trying to figure out the minimal amount of defines needed.
1 parent16e5859 commitc34446c

File tree

3 files changed

+237
-227
lines changed

3 files changed

+237
-227
lines changed

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

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
#line 8 "nan_test.pgc"
2626

2727

28+
#ifdefWIN32
29+
#defineisinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
30+
#defineisnan(x) _isnan(x)
31+
#endif/* WIN32 */
32+
2833
int
2934
main(void)
3035
{
@@ -34,54 +39,54 @@ main(void)
3439

3540

3641

37-
#line14 "nan_test.pgc"
42+
#line19 "nan_test.pgc"
3843
intid ;
3944

40-
#line15 "nan_test.pgc"
45+
#line20 "nan_test.pgc"
4146
doubled ;
4247

43-
#line16 "nan_test.pgc"
48+
#line21 "nan_test.pgc"
4449
numeric*num ;
4550

46-
#line17 "nan_test.pgc"
51+
#line22 "nan_test.pgc"
4752
charval [16 ] ;
4853
/* exec sql end declare section */
49-
#line18 "nan_test.pgc"
54+
#line23 "nan_test.pgc"
5055

5156

5257
ECPGdebug(1,stderr);
5358
/* exec sql whenever sqlerror do sqlprint ( ) ; */
54-
#line21 "nan_test.pgc"
59+
#line26 "nan_test.pgc"
5560

5661

5762
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,NULL,0);
58-
#line23 "nan_test.pgc"
63+
#line28 "nan_test.pgc"
5964

6065
if (sqlca.sqlcode<0)sqlprint ( );}
61-
#line23 "nan_test.pgc"
66+
#line28 "nan_test.pgc"
6267

6368

6469
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table nantest1 ( id int4 , d float8 )",ECPGt_EOIT,ECPGt_EORT);
65-
#line25 "nan_test.pgc"
70+
#line30 "nan_test.pgc"
6671

6772
if (sqlca.sqlcode<0)sqlprint ( );}
68-
#line25 "nan_test.pgc"
73+
#line30 "nan_test.pgc"
6974

7075
{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);
71-
#line26 "nan_test.pgc"
76+
#line31 "nan_test.pgc"
7277

7378
if (sqlca.sqlcode<0)sqlprint ( );}
74-
#line26 "nan_test.pgc"
79+
#line31 "nan_test.pgc"
7580

7681

7782
/* declare cur cursor for select id , d , d from nantest1 */
78-
#line28 "nan_test.pgc"
83+
#line33 "nan_test.pgc"
7984

8085
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur cursor for select id , d , d from nantest1",ECPGt_EOIT,ECPGt_EORT);
81-
#line29 "nan_test.pgc"
86+
#line34 "nan_test.pgc"
8287

8388
if (sqlca.sqlcode<0)sqlprint ( );}
84-
#line29 "nan_test.pgc"
89+
#line34 "nan_test.pgc"
8590

8691
while (1)
8792
{
@@ -92,10 +97,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
9297
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
9398
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
9499
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
95-
#line32 "nan_test.pgc"
100+
#line37 "nan_test.pgc"
96101

97102
if (sqlca.sqlcode<0)sqlprint ( );}
98-
#line32 "nan_test.pgc"
103+
#line37 "nan_test.pgc"
99104

100105
if (sqlca.sqlcode)
101106
break;
@@ -109,34 +114,34 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
109114
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
110115
ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
111116
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
112-
#line40 "nan_test.pgc"
117+
#line45 "nan_test.pgc"
113118

114119
if (sqlca.sqlcode<0)sqlprint ( );}
115-
#line40 "nan_test.pgc"
120+
#line45 "nan_test.pgc"
116121

117122
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
118123
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
119124
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
120125
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
121126
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
122-
#line41 "nan_test.pgc"
127+
#line46 "nan_test.pgc"
123128

124129
if (sqlca.sqlcode<0)sqlprint ( );}
125-
#line41 "nan_test.pgc"
130+
#line46 "nan_test.pgc"
126131

127132
}
128133
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur",ECPGt_EOIT,ECPGt_EORT);
129-
#line43 "nan_test.pgc"
134+
#line48 "nan_test.pgc"
130135

131136
if (sqlca.sqlcode<0)sqlprint ( );}
132-
#line43 "nan_test.pgc"
137+
#line48 "nan_test.pgc"
133138

134139

135140
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur cursor for select id , d , d from nantest1",ECPGt_EOIT,ECPGt_EORT);
136-
#line45 "nan_test.pgc"
141+
#line50 "nan_test.pgc"
137142

138143
if (sqlca.sqlcode<0)sqlprint ( );}
139-
#line45 "nan_test.pgc"
144+
#line50 "nan_test.pgc"
140145

141146
while (1)
142147
{
@@ -147,10 +152,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
147152
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
148153
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
149154
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
150-
#line48 "nan_test.pgc"
155+
#line53 "nan_test.pgc"
151156

152157
if (sqlca.sqlcode<0)sqlprint ( );}
153-
#line48 "nan_test.pgc"
158+
#line53 "nan_test.pgc"
154159

155160
if (sqlca.sqlcode)
156161
break;
@@ -160,25 +165,25 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
160165
printf("%d NaN '%s'\n",id,val);
161166
}
162167
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur",ECPGt_EOIT,ECPGt_EORT);
163-
#line56 "nan_test.pgc"
168+
#line61 "nan_test.pgc"
164169

165170
if (sqlca.sqlcode<0)sqlprint ( );}
166-
#line56 "nan_test.pgc"
171+
#line61 "nan_test.pgc"
167172

168173

169174
num=PGTYPESnumeric_new();
170175

171176
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table nantest2 ( id int4 , d numeric )",ECPGt_EOIT,ECPGt_EORT);
172-
#line60 "nan_test.pgc"
177+
#line65 "nan_test.pgc"
173178

174179
if (sqlca.sqlcode<0)sqlprint ( );}
175-
#line60 "nan_test.pgc"
180+
#line65 "nan_test.pgc"
176181

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

180185
if (sqlca.sqlcode<0)sqlprint ( );}
181-
#line61 "nan_test.pgc"
186+
#line66 "nan_test.pgc"
182187

183188

184189
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"select id , d , d from nantest2 where id = 4",ECPGt_EOIT,
@@ -188,39 +193,39 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
188193
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
189194
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
190195
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
191-
#line63 "nan_test.pgc"
196+
#line68 "nan_test.pgc"
192197

193198
if (sqlca.sqlcode<0)sqlprint ( );}
194-
#line63 "nan_test.pgc"
199+
#line68 "nan_test.pgc"
195200

196201

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

199204
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 5 , $1 )",
200205
ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
201206
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
202-
#line67 "nan_test.pgc"
207+
#line72 "nan_test.pgc"
203208

204209
if (sqlca.sqlcode<0)sqlprint ( );}
205-
#line67 "nan_test.pgc"
210+
#line72 "nan_test.pgc"
206211

207212
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 6 , $1 )",
208213
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
209214
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
210-
#line68 "nan_test.pgc"
215+
#line73 "nan_test.pgc"
211216

212217
if (sqlca.sqlcode<0)sqlprint ( );}
213-
#line68 "nan_test.pgc"
218+
#line73 "nan_test.pgc"
214219

215220

216221
/* declare cur1 cursor for select id , d , d from nantest2 */
217-
#line70 "nan_test.pgc"
222+
#line75 "nan_test.pgc"
218223

219224
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur1 cursor for select id , d , d from nantest2",ECPGt_EOIT,ECPGt_EORT);
220-
#line71 "nan_test.pgc"
225+
#line76 "nan_test.pgc"
221226

222227
if (sqlca.sqlcode<0)sqlprint ( );}
223-
#line71 "nan_test.pgc"
228+
#line76 "nan_test.pgc"
224229

225230
while (1)
226231
{
@@ -231,33 +236,33 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
231236
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
232237
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
233238
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
234-
#line74 "nan_test.pgc"
239+
#line79 "nan_test.pgc"
235240

236241
if (sqlca.sqlcode<0)sqlprint ( );}
237-
#line74 "nan_test.pgc"
242+
#line79 "nan_test.pgc"
238243

239244
if (sqlca.sqlcode)
240245
break;
241246
printf("%d %s '%s'\n",id, (num->sign==NUMERIC_NAN ?"NaN" :"not NaN"),val);
242247
}
243248
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur1",ECPGt_EOIT,ECPGt_EORT);
244-
#line79 "nan_test.pgc"
249+
#line84 "nan_test.pgc"
245250

246251
if (sqlca.sqlcode<0)sqlprint ( );}
247-
#line79 "nan_test.pgc"
252+
#line84 "nan_test.pgc"
248253

249254

250255
{ECPGtrans(__LINE__,NULL,"rollback");
251-
#line81 "nan_test.pgc"
256+
#line86 "nan_test.pgc"
252257

253258
if (sqlca.sqlcode<0)sqlprint ( );}
254-
#line81 "nan_test.pgc"
259+
#line86 "nan_test.pgc"
255260

256261
{ECPGdisconnect(__LINE__,"CURRENT");
257-
#line82 "nan_test.pgc"
262+
#line87 "nan_test.pgc"
258263

259264
if (sqlca.sqlcode<0)sqlprint ( );}
260-
#line82 "nan_test.pgc"
265+
#line87 "nan_test.pgc"
261266

262267

263268
return (0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp