aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/examples/testlibpq.c17
-rw-r--r--src/test/examples/testlibpq2.c18
-rw-r--r--src/test/examples/testlibpq3.c31
-rw-r--r--src/test/examples/testlibpq4.c11
-rw-r--r--src/test/regress/regress.c24
5 files changed, 47 insertions, 54 deletions
diff --git a/src/test/examples/testlibpq.c b/src/test/examples/testlibpq.c
index 3295076481e..b27c17386aa 100644
--- a/src/test/examples/testlibpq.c
+++ b/src/test/examples/testlibpq.c
@@ -26,9 +26,8 @@ main(int argc, char **argv)
/*
* If the user supplies a parameter on the command line, use it as the
- * conninfo string; otherwise default to setting dbname=postgres and
- * using environment variables or defaults for all other connection
- * parameters.
+ * conninfo string; otherwise default to setting dbname=postgres and using
+ * environment variables or defaults for all other connection parameters.
*/
if (argc > 1)
conninfo = argv[1];
@@ -47,10 +46,10 @@ main(int argc, char **argv)
}
/*
- * Our test case here involves using a cursor, for which we must be
- * inside a transaction block. We could do the whole thing with a
- * single PQexec() of "select * from pg_database", but that's too
- * trivial to make a good example.
+ * Our test case here involves using a cursor, for which we must be inside
+ * a transaction block. We could do the whole thing with a single
+ * PQexec() of "select * from pg_database", but that's too trivial to make
+ * a good example.
*/
/* Start a transaction block */
@@ -63,8 +62,8 @@ main(int argc, char **argv)
}
/*
- * Should PQclear PGresult whenever it is no longer needed to avoid
- * memory leaks
+ * Should PQclear PGresult whenever it is no longer needed to avoid memory
+ * leaks
*/
PQclear(res);
diff --git a/src/test/examples/testlibpq2.c b/src/test/examples/testlibpq2.c
index 9f1e96d8dac..5949c1364e4 100644
--- a/src/test/examples/testlibpq2.c
+++ b/src/test/examples/testlibpq2.c
@@ -46,9 +46,8 @@ main(int argc, char **argv)
/*
* If the user supplies a parameter on the command line, use it as the
- * conninfo string; otherwise default to setting dbname=postgres and
- * using environment variables or defaults for all other connection
- * parameters.
+ * conninfo string; otherwise default to setting dbname=postgres and using
+ * environment variables or defaults for all other connection parameters.
*/
if (argc > 1)
conninfo = argv[1];
@@ -67,8 +66,7 @@ main(int argc, char **argv)
}
/*
- * Issue LISTEN command to enable notifications from the rule's
- * NOTIFY.
+ * Issue LISTEN command to enable notifications from the rule's NOTIFY.
*/
res = PQexec(conn, "LISTEN TBL2");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
@@ -79,8 +77,8 @@ main(int argc, char **argv)
}
/*
- * should PQclear PGresult whenever it is no longer needed to avoid
- * memory leaks
+ * should PQclear PGresult whenever it is no longer needed to avoid memory
+ * leaks
*/
PQclear(res);
@@ -89,9 +87,9 @@ main(int argc, char **argv)
while (nnotifies < 4)
{
/*
- * Sleep until something happens on the connection. We use
- * select(2) to wait for input, but you could also use poll() or
- * similar facilities.
+ * Sleep until something happens on the connection. We use select(2)
+ * to wait for input, but you could also use poll() or similar
+ * facilities.
*/
int sock;
fd_set input_mask;
diff --git a/src/test/examples/testlibpq3.c b/src/test/examples/testlibpq3.c
index 49b03066cd8..918d142c7b6 100644
--- a/src/test/examples/testlibpq3.c
+++ b/src/test/examples/testlibpq3.c
@@ -51,9 +51,8 @@ main(int argc, char **argv)
/*
* If the user supplies a parameter on the command line, use it as the
- * conninfo string; otherwise default to setting dbname=postgres and
- * using environment variables or defaults for all other connection
- * parameters.
+ * conninfo string; otherwise default to setting dbname=postgres and using
+ * environment variables or defaults for all other connection parameters.
*/
if (argc > 1)
conninfo = argv[1];
@@ -72,12 +71,11 @@ main(int argc, char **argv)
}
/*
- * The point of this program is to illustrate use of PQexecParams()
- * with out-of-line parameters, as well as binary transmission of
- * results. By using out-of-line parameters we can avoid a lot of
- * tedious mucking about with quoting and escaping. Notice how we
- * don't have to do anything special with the quote mark in the
- * parameter value.
+ * The point of this program is to illustrate use of PQexecParams() with
+ * out-of-line parameters, as well as binary transmission of results. By
+ * using out-of-line parameters we can avoid a lot of tedious mucking
+ * about with quoting and escaping. Notice how we don't have to do
+ * anything special with the quote mark in the parameter value.
*/
/* Here is our out-of-line parameter value */
@@ -118,19 +116,18 @@ main(int argc, char **argv)
bptr = PQgetvalue(res, i, b_fnum);
/*
- * The binary representation of INT4 is in network byte order,
- * which we'd better coerce to the local byte order.
+ * The binary representation of INT4 is in network byte order, which
+ * we'd better coerce to the local byte order.
*/
ival = ntohl(*((uint32_t *) iptr));
/*
- * The binary representation of TEXT is, well, text, and since
- * libpq was nice enough to append a zero byte to it, it'll work
- * just fine as a C string.
+ * The binary representation of TEXT is, well, text, and since libpq
+ * was nice enough to append a zero byte to it, it'll work just fine
+ * as a C string.
*
- * The binary representation of BYTEA is a bunch of bytes, which
- * could include embedded nulls so we have to pay attention to
- * field length.
+ * The binary representation of BYTEA is a bunch of bytes, which could
+ * include embedded nulls so we have to pay attention to field length.
*/
blen = PQgetlength(res, i, b_fnum);
diff --git a/src/test/examples/testlibpq4.c b/src/test/examples/testlibpq4.c
index 977e4edd996..71b7d25f13f 100644
--- a/src/test/examples/testlibpq4.c
+++ b/src/test/examples/testlibpq4.c
@@ -66,8 +66,8 @@ main(int argc, char **argv)
/*
* begin, by setting the parameters for a backend connection if the
* parameters are null, then the system will try to use reasonable
- * defaults by looking up environment variables or, failing that,
- * using hardwired constants
+ * defaults by looking up environment variables or, failing that, using
+ * hardwired constants
*/
pghost = NULL; /* host name of the backend server */
pgport = NULL; /* port of the backend server */
@@ -92,14 +92,13 @@ main(int argc, char **argv)
}
/*
- * make sure to PQclear() a PGresult whenever it is no longer
- * needed to avoid memory leaks
+ * make sure to PQclear() a PGresult whenever it is no longer needed to
+ * avoid memory leaks
*/
PQclear(res1);
/*
- * fetch instances from the pg_database, the system catalog of
- * databases
+ * fetch instances from the pg_database, the system catalog of databases
*/
res1 = PQexec(conn1, "DECLARE myportal CURSOR FOR select * from pg_database");
if (PQresultStatus(res1) != PGRES_COMMAND_OK)
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index b0421332f8b..97fe608602a 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -1,5 +1,5 @@
/*
- * $PostgreSQL: pgsql/src/test/regress/regress.c,v 1.63 2005/07/23 14:18:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/test/regress/regress.c,v 1.64 2005/10/15 02:49:51 momjian Exp $
*/
#include "postgres.h"
@@ -54,16 +54,16 @@ regress_dist_ptpath(PG_FUNCTION_ARGS)
default:
/*
- * the distance from a point to a path is the smallest
- * distance from the point to any of its constituent segments.
+ * the distance from a point to a path is the smallest distance
+ * from the point to any of its constituent segments.
*/
Assert(path->npts > 1);
for (i = 0; i < path->npts - 1; ++i)
{
regress_lseg_construct(&lseg, &path->p[i], &path->p[i + 1]);
tmp = DatumGetFloat8(DirectFunctionCall2(dist_ps,
- PointPGetDatum(pt),
- LsegPGetDatum(&lseg)));
+ PointPGetDatum(pt),
+ LsegPGetDatum(&lseg)));
if (i == 0 || tmp < result)
result = tmp;
}
@@ -100,7 +100,7 @@ regress_path_dist(PG_FUNCTION_ARGS)
tmp = DatumGetFloat8(DirectFunctionCall2(lseg_distance,
LsegPGetDatum(&seg1),
- LsegPGetDatum(&seg2)));
+ LsegPGetDatum(&seg2)));
if (!have_min || tmp < min)
{
min = tmp;
@@ -422,11 +422,11 @@ funny_dup17(PG_FUNCTION_ARGS)
if (SPI_processed > 0)
{
selected = DatumGetInt32(DirectFunctionCall1(int4in,
- CStringGetDatum(SPI_getvalue(
- SPI_tuptable->vals[0],
- SPI_tuptable->tupdesc,
- 1
- ))));
+ CStringGetDatum(SPI_getvalue(
+ SPI_tuptable->vals[0],
+ SPI_tuptable->tupdesc,
+ 1
+ ))));
}
elog(DEBUG4, "funny_dup17 (fired %s) on level %3d: %d/%d tuples inserted/selected",
@@ -554,7 +554,7 @@ ttdummy(PG_FUNCTION_ARGS)
{
text *seqname = DatumGetTextP(DirectFunctionCall1(textin,
- CStringGetDatum("ttdummy_seq")));
+ CStringGetDatum("ttdummy_seq")));
newoff = DirectFunctionCall1(nextval,
PointerGetDatum(seqname));