Skip to content

Commit 3ceaa97

Browse files
author
Michael Meskes
committed
Regression test updates and fixes
1 parent a83437f commit 3ceaa97

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 Aug 3 14:45:06 CEST 2006
2068+
Fr Aug 4 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) -C test clean
2020

21-
check: all
21+
check checktcp: all
2222
$(MAKE) -C test $@

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
#define POSTGRES_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-
all clean install installdirs uninstall dep depend distprep:
20+
all install installdirs uninstall dep depend distprep:
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+
clean distclean maintainer-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.pgc renamed 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 not include regression.h */
11+
exec sql include ../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 to regress1@localhost as second;
25+
exec sql connect to REGRESSDB1 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 not include regression.h */
10+
exec sql include ../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 to regress1@localhost as second;
24+
exec sql connect to REGRESSDB1 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 to regress1@localhost as second;
33+
exec sql connect to REGRESSDB1 as second;
3434
/* will close "second" */
3535
exec sql disconnect DEFAULT;
3636

37-
exec sql connect to regress1@localhost as second;
37+
exec sql connect to REGRESSDB1 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-
#line 102 "test5.pgc"
212+
#line 103 "test5.pgc"
212213

213214
exit (0);
214215
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy