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

Commit3ceaa97

Browse files
author
Michael Meskes
committed
Regression test updates and fixes
1 parenta83437f commit3ceaa97

28 files changed

+164
-11636
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ We Aug 2 13:15:25 CEST 2006
20652065
- Applied first version of the regression test patch by Joachim
20662066
Wieland <joe@mcknight.de>.
20672067

2068-
Th Aug3 14:45:06 CEST 2006
2068+
Fr Aug4 10:44:30 CEST 2006
20692069

20702070
- Applied test suite update by Joachim Wieland <joe@mcknight.de>.
20712071
- Set ecpg library version to 5.2.

‎src/interfaces/ecpg/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ clean distclean maintainer-clean:
1818
-$(MAKE) -C preproc$@
1919
-$(MAKE) -Ctest clean
2020

21-
check: all
21+
checkchecktcp: all
2222
$(MAKE) -Ctest$@

‎src/interfaces/ecpg/ecpglib/descriptor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* dynamic SQL support routines
22
*
3-
* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.17 2006/07/05 10:49:56 meskes Exp $
3+
* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.18 2006/08/04 08:52:17 meskes Exp $
44
*/
55

66
#definePOSTGRES_ECPG_INTERNAL
@@ -249,7 +249,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
249249
data_var.ind_varcharsize=varcharsize;
250250
data_var.ind_arrsize=arrsize;
251251
data_var.ind_offset=offset;
252-
if ((data_var.ind_arrsize==0||data_var.ind_varcharsize==0)&&data_var.ind_pointer!=NULL)
252+
if (data_var.ind_arrsize==0||data_var.ind_varcharsize==0)
253253
data_var.ind_value=*((void**) (data_var.ind_pointer));
254254
else
255255
data_var.ind_value=data_var.ind_pointer;

‎src/interfaces/ecpg/test/Makefile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.54 2006/08/02 13:43:23 meskes Exp $
1+
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.55 2006/08/04 08:52:17 meskes Exp $
22

33
subdir = src/interfaces/ecpg/test
44
top_builddir = ../../../..
55
include$(top_builddir)/src/Makefile.global
66

77
# port number for temp-installation test postmaster
8+
# this is also defined in test/connect/Makefile
89
TEMP_PORT = 5$(DEF_PGPORT)
910

1011
# default encoding
@@ -16,16 +17,28 @@ ifdef NO_LOCALE
1617
NOLOCALE += --no-locale
1718
endif
1819

19-
allcleaninstallinstalldirsuninstalldepdependdistprep:
20+
allinstallinstalldirsuninstalldepdependdistprep:
2021
$(MAKE) -C connect$@
2122
$(MAKE) -C sql$@
2223
$(MAKE) -C pgtypeslib$@
2324
$(MAKE) -C errors$@
2425
$(MAKE) -C compat_informix$@
2526
$(MAKE) -C complex$@
2627
$(MAKE) -C thread$@
27-
# for some reason I couldn't figure out, ifeq($@,clean) ... does not work
28-
if [ $@ = clean ]; then rm -f results/*.stdout results/*.stderr results/*.c; rm -rf tmp_check/; rm -f log/*.log; rm -f pg_regress.inc.sh regression.diff; fi
28+
29+
cleandistcleanmaintainer-clean:
30+
$(MAKE) -C connect$@
31+
$(MAKE) -C connect extraclean
32+
$(MAKE) -C sql$@
33+
$(MAKE) -C pgtypeslib$@
34+
$(MAKE) -C errors$@
35+
$(MAKE) -C compat_informix$@
36+
$(MAKE) -C complex$@
37+
$(MAKE) -C thread$@
38+
rm -f results/*.stdout results/*.stderr results/*.c
39+
rm -rf tmp_check/
40+
rm -f log/*.log
41+
rm -f pg_regress.inc.sh regression.diff
2942

3043
all: pg_regress.sh
3144

@@ -43,8 +56,10 @@ pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global
4356
-e's/@GCC@/$(GCC)/g'\
4457
$<>$@
4558

46-
test: all pg_regress.inc.sh
47-
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --listen-on-tcp --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE)
59+
check: all pg_regress.inc.sh
60+
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE)
4861

49-
check: all test
62+
# the same options, but with --listen-on-tcp
63+
checktcp: all pg_regress.inc.sh
64+
sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE) --listen-on-tcp
5065

‎src/interfaces/ecpg/test/complex/test5.pgc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ main (void)
9191

9292
EXEC SQL CLOSE B;
9393

94-
printf ("name=%s, accs=%d byte=", empl.name, a.accs);
94+
/* do not print a.accs because big/little endian will have different outputs here */
95+
printf ("name=%s, byte=", empl.name);
9596
for (i=0; i<20; i++)
9697
{
9798
if (empl.byte[i] == '#')

‎src/interfaces/ecpg/test/connect/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@ top_builddir = ../../../../..
33
include$(top_builddir)/src/Makefile.global
44
include ../Makefile.regress
55

6+
# port number for temp-installation test postmaster
7+
# this is also defined in ../Makefile
8+
TEMP_PORT = 5$(DEF_PGPORT)
9+
10+
test1.pgc: test1.pgc.in
11+
sed -e's,@TEMP_PORT@,$(TEMP_PORT),g'\
12+
$<>$@
13+
614
TESTS = test1 test1.c\
715
test2 test2.c\
816
test3 test3.c\
9-
test4 test4.c
17+
test4 test4.c
1018

1119
all:$(TESTS)
1220

21+
extraclean:
22+
rm -f test1.pgc

‎src/interfaces/ecpg/test/connect/test1.pgcrenamed to‎src/interfaces/ecpg/test/connect/test1.pgc.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ exec sql end declare section;
3838
exec sql connect to connectdb@localhost as main user connectuser/connectdb;
3939
exec sql disconnect main;
4040

41-
exec sql connect to tcp:postgresql://localhost:55432/connectdb user connectuser identified by connectpw;
41+
exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by connectpw;
4242
exec sql disconnect nonexistant;
4343
exec sql disconnect;
4444

4545
strcpy(pw, "connectpw");
46-
strcpy(db, "tcp:postgresql://localhost:55432/connectdb");
46+
strcpy(db, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb");
4747
exec sql connect to :db user connectuser using :pw;
4848
exec sql disconnect;
4949

50-
exec sql connect to unix:postgresql://localhost:55432/connectdb user connectuser using "connectpw";
50+
exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser using "connectpw";
5151
exec sql disconnect;
5252

5353
/* wrong db */
54-
exec sql connect to tcp:postgresql://localhost:55432/nonexistant user connectuser identified by connectpw;
54+
exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/nonexistant user connectuser identified by connectpw;
5555
exec sql disconnect;
5656

5757
/* wrong port */
5858
exec sql connect to tcp:postgresql://localhost:0/connectdb user connectuser identified by connectpw;
5959
/* no disconnect necessary */
6060

6161
/* wrong password */
62-
exec sql connect to unix:postgresql://localhost:55432/connectdb user connectuser identified by "wrongpw";
62+
exec sql connect to unix:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by "wrongpw";
6363
/* no disconnect necessary */
6464

6565
/* connect twice */

‎src/interfaces/ecpg/test/connect/test2.pgc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <stdlib.h>
99
#include <stdio.h>
1010

11-
/* do notincluderegression.h */
11+
exec sqlinclude../regression;
1212

1313
int
1414
main(void)
@@ -22,7 +22,7 @@ exec sql end declare section;
2222

2323
strcpy(id, "first");
2424
exec sql connect to connectdb as :id;
25-
exec sql connect toregress1@localhost as second;
25+
exec sql connect toREGRESSDB1 as second;
2626

2727
/* this selects from "second" which was opened last */
2828
exec sql select current_database() into :res;

‎src/interfaces/ecpg/test/connect/test3.pgc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <stdlib.h>
88
#include <stdio.h>
99

10-
/* do notincluderegression.h */
10+
exec sqlinclude../regression;
1111

1212
int
1313
main(void)
@@ -21,7 +21,7 @@ exec sql end declare section;
2121

2222
strcpy(id, "first");
2323
exec sql connect to connectdb as :id;
24-
exec sql connect toregress1@localhost as second;
24+
exec sql connect toREGRESSDB1 as second;
2525

2626
/* this selects from "second" which was opened last */
2727
exec sql select current_database() into :res;
@@ -30,11 +30,11 @@ exec sql end declare section;
3030
exec sql disconnect CURRENT;
3131
exec sql select current_database() into :res;
3232

33-
exec sql connect toregress1@localhost as second;
33+
exec sql connect toREGRESSDB1 as second;
3434
/* will close "second" */
3535
exec sql disconnect DEFAULT;
3636

37-
exec sql connect toregress1@localhost as second;
37+
exec sql connect toREGRESSDB1 as second;
3838
exec sql disconnect ALL;
3939

4040
exec sql disconnect CURRENT;

‎src/interfaces/ecpg/test/expected/complex-test5.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ main (void)
199199
#line 92 "test5.pgc"
200200

201201

202-
printf ("name=%s, accs=%d byte=",empl.name,a.accs);
202+
/* do not print a.accs because big/little endian will have different outputs here */
203+
printf ("name=%s, byte=",empl.name);
203204
for (i=0;i<20;i++)
204205
{
205206
if (empl.byte[i]=='#')
@@ -208,7 +209,7 @@ main (void)
208209
}
209210
printf("\n");
210211
{ECPGdisconnect(__LINE__,"CURRENT");}
211-
#line102 "test5.pgc"
212+
#line103 "test5.pgc"
212213

213214
exit (0);
214215
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name=first user , accs=320 byte=\001m\000\212
22
name=first user , accs=320 byte=\001m\000\212
3-
name=first user ,accs=16385byte=(1)(155)(0)(212)
3+
name=first user , byte=(1)(155)(0)(212)

‎src/interfaces/ecpg/test/expected/connect-test1.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
THEPORTNUMBERMIGHTHAVEBEENCHANGEDBYTHEREGRESSIONSCRIPT
3+
14
/* Processed by ecpg (4.2.1) */
25
/* These include files are added by the preprocessor */
36
#include<ecpgtype.h>

‎src/interfaces/ecpg/test/expected/connect-test1.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
3+
14
[NO_PID]: ECPGdebug: set to 1
25
[NO_PID]: sqlca: code: 0, state: 00000
36
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
3+

‎src/interfaces/ecpg/test/expected/connect-test2.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@
1717
#include<stdlib.h>
1818
#include<stdio.h>
1919

20-
/* do not include regression.h */
20+
21+
#line 1 "./../regression.h"
22+
23+
24+
25+
26+
27+
28+
#line 11 "test2.pgc"
29+
2130

2231
int
2332
main(void)
@@ -41,7 +50,7 @@ main(void)
4150
{ECPGconnect(__LINE__,0,"connectdb" ,NULL,NULL ,id,0); }
4251
#line 24 "test2.pgc"
4352

44-
{ECPGconnect(__LINE__,0,"regress1@localhost" ,NULL,NULL ,"second",0); }
53+
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,"second",0); }
4554
#line 25 "test2.pgc"
4655

4756

‎src/interfaces/ecpg/test/expected/connect-test2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[NO_PID]: sqlca: code: 0, state: 00000
33
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
44
[NO_PID]: sqlca: code: 0, state: 00000
5-
[NO_PID]: ECPGconnect: opening database regress1 onlocalhost port <DEFAULT>
5+
[NO_PID]: ECPGconnect: opening database regress1 on<DEFAULT> port <DEFAULT>
66
[NO_PID]: sqlca: code: 0, state: 00000
77
[NO_PID]: ECPGexecute line 28: QUERY: select current_database () on connection second
88
[NO_PID]: sqlca: code: 0, state: 00000

‎src/interfaces/ecpg/test/expected/connect-test3.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616
#include<stdlib.h>
1717
#include<stdio.h>
1818

19-
/* do not include regression.h */
19+
20+
#line 1 "./../regression.h"
21+
22+
23+
24+
25+
26+
27+
#line 10 "test3.pgc"
28+
2029

2130
int
2231
main(void)
@@ -40,7 +49,7 @@ main(void)
4049
{ECPGconnect(__LINE__,0,"connectdb" ,NULL,NULL ,id,0); }
4150
#line 23 "test3.pgc"
4251

43-
{ECPGconnect(__LINE__,0,"regress1@localhost" ,NULL,NULL ,"second",0); }
52+
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,"second",0); }
4453
#line 24 "test3.pgc"
4554

4655

@@ -61,15 +70,15 @@ main(void)
6170
#line 31 "test3.pgc"
6271

6372

64-
{ECPGconnect(__LINE__,0,"regress1@localhost" ,NULL,NULL ,"second",0); }
73+
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,"second",0); }
6574
#line 33 "test3.pgc"
6675

6776
/* will close "second" */
6877
{ECPGdisconnect(__LINE__,"DEFAULT");}
6978
#line 35 "test3.pgc"
7079

7180

72-
{ECPGconnect(__LINE__,0,"regress1@localhost" ,NULL,NULL ,"second",0); }
81+
{ECPGconnect(__LINE__,0,"regress1" ,NULL,NULL ,"second",0); }
7382
#line 37 "test3.pgc"
7483

7584
{ECPGdisconnect(__LINE__,"ALL");}

‎src/interfaces/ecpg/test/expected/connect-test3.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[NO_PID]: sqlca: code: 0, state: 00000
33
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
44
[NO_PID]: sqlca: code: 0, state: 00000
5-
[NO_PID]: ECPGconnect: opening database regress1 onlocalhost port <DEFAULT>
5+
[NO_PID]: ECPGconnect: opening database regress1 on<DEFAULT> port <DEFAULT>
66
[NO_PID]: sqlca: code: 0, state: 00000
77
[NO_PID]: ECPGexecute line 27: QUERY: select current_database () on connection second
88
[NO_PID]: sqlca: code: 0, state: 00000
@@ -18,7 +18,7 @@
1818
[NO_PID]: sqlca: code: 0, state: 00000
1919
[NO_PID]: ECPGget_data line 31: RESULT: connectdb offset: 200 array: Yes
2020
[NO_PID]: sqlca: code: 0, state: 00000
21-
[NO_PID]: ECPGconnect: opening database regress1 onlocalhost port <DEFAULT>
21+
[NO_PID]: ECPGconnect: opening database regress1 on<DEFAULT> port <DEFAULT>
2222
[NO_PID]: sqlca: code: 0, state: 00000
2323
[NO_PID]: raising sqlcode -220 in line 35, 'No such connection DEFAULT in line 35.'.
2424
[NO_PID]: sqlca: code: -220, state: 08003

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp