summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2017-06-21 19:35:54 +0000
committerTom Lane2017-06-21 19:35:54 +0000
commit382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch)
treef558251492f2c6f86e3566f7a82f9d00509122c2 /src/test
parentc7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff)
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/test')
-rw-r--r--src/test/isolation/isolationtester.c4
-rw-r--r--src/test/modules/test_shm_mq/setup.c2
-rw-r--r--src/test/modules/test_shm_mq/test.c4
-rw-r--r--src/test/modules/test_shm_mq/worker.c2
-rw-r--r--src/test/modules/worker_spi/worker_spi.c10
-rw-r--r--src/test/regress/pg_regress.c2
-rw-r--r--src/test/regress/regress.c14
7 files changed, 19 insertions, 19 deletions
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index 3af5a706ce..ba8082c980 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -224,7 +224,7 @@ main(int argc, char **argv)
*/
initPQExpBuffer(&wait_query);
appendPQExpBufferStr(&wait_query,
- "SELECT pg_catalog.pg_isolation_test_session_is_blocked($1, '{");
+ "SELECT pg_catalog.pg_isolation_test_session_is_blocked($1, '{");
/* The spec syntax requires at least one session; assume that here. */
appendPQExpBufferStr(&wait_query, backend_pids[1]);
for (i = 2; i < nconns; i++)
@@ -841,7 +841,7 @@ try_complete_step(Step *step, int flags)
const char *sev = PQresultErrorField(res,
PG_DIAG_SEVERITY);
const char *msg = PQresultErrorField(res,
- PG_DIAG_MESSAGE_PRIMARY);
+ PG_DIAG_MESSAGE_PRIMARY);
if (sev && msg)
step->errormsg = psprintf("%s: %s", sev, msg);
diff --git a/src/test/modules/test_shm_mq/setup.c b/src/test/modules/test_shm_mq/setup.c
index 06c49bdb40..3ae9018360 100644
--- a/src/test/modules/test_shm_mq/setup.c
+++ b/src/test/modules/test_shm_mq/setup.c
@@ -231,7 +231,7 @@ setup_background_workers(int nworkers, dsm_segment *seg)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
errmsg("could not register background process"),
- errhint("You may need to increase max_worker_processes.")));
+ errhint("You may need to increase max_worker_processes.")));
++wstate->nworkers;
}
diff --git a/src/test/modules/test_shm_mq/test.c b/src/test/modules/test_shm_mq/test.c
index ea3657d5f0..7a6ad23f75 100644
--- a/src/test/modules/test_shm_mq/test.c
+++ b/src/test/modules/test_shm_mq/test.c
@@ -218,8 +218,8 @@ test_shm_mq_pipelined(PG_FUNCTION_ARGS)
if (send_count != receive_count)
ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
- errmsg("message sent %d times, but received %d times",
- send_count, receive_count)));
+ errmsg("message sent %d times, but received %d times",
+ send_count, receive_count)));
break;
}
diff --git a/src/test/modules/test_shm_mq/worker.c b/src/test/modules/test_shm_mq/worker.c
index f8aef263f7..e7e29f89c2 100644
--- a/src/test/modules/test_shm_mq/worker.c
+++ b/src/test/modules/test_shm_mq/worker.c
@@ -85,7 +85,7 @@ test_shm_mq_main(Datum main_arg)
if (toc == NULL)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
- errmsg("bad magic number in dynamic shared memory segment")));
+ errmsg("bad magic number in dynamic shared memory segment")));
/*
* Acquire a worker number.
diff --git a/src/test/modules/worker_spi/worker_spi.c b/src/test/modules/worker_spi/worker_spi.c
index d6390ac648..12c8cd5774 100644
--- a/src/test/modules/worker_spi/worker_spi.c
+++ b/src/test/modules/worker_spi/worker_spi.c
@@ -137,11 +137,11 @@ initialize_worker_spi(worktable *table)
appendStringInfo(&buf,
"CREATE SCHEMA \"%s\" "
"CREATE TABLE \"%s\" ("
- " type text CHECK (type IN ('total', 'delta')), "
+ " type text CHECK (type IN ('total', 'delta')), "
" value integer)"
- "CREATE UNIQUE INDEX \"%s_unique_total\" ON \"%s\" (type) "
+ "CREATE UNIQUE INDEX \"%s_unique_total\" ON \"%s\" (type) "
"WHERE type = 'total'",
- table->schema, table->name, table->name, table->name);
+ table->schema, table->name, table->name, table->name);
/* set statement start time */
SetCurrentStatementStartTimestamp();
@@ -399,11 +399,11 @@ worker_spi_launch(PG_FUNCTION_ARGS)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
errmsg("could not start background process"),
- errhint("More details may be available in the server log.")));
+ errhint("More details may be available in the server log.")));
if (status == BGWH_POSTMASTER_DIED)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
- errmsg("cannot start background processes without postmaster"),
+ errmsg("cannot start background processes without postmaster"),
errhint("Kill all remaining database processes and restart the database.")));
Assert(status == BGWH_STARTED);
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 832a138da5..abb742b1ed 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1934,7 +1934,7 @@ create_database(const char *dbname)
"ALTER DATABASE \"%s\" SET lc_numeric TO 'C';"
"ALTER DATABASE \"%s\" SET lc_time TO 'C';"
"ALTER DATABASE \"%s\" SET bytea_output TO 'hex';"
- "ALTER DATABASE \"%s\" SET timezone_abbreviations TO 'Default';",
+ "ALTER DATABASE \"%s\" SET timezone_abbreviations TO 'Default';",
dbname, dbname, dbname, dbname, dbname, dbname);
/*
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index d2a821f3d5..b73bccec3d 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -85,7 +85,7 @@ regress_dist_ptpath(PG_FUNCTION_ARGS)
regress_lseg_construct(&lseg, &path->p[i], &path->p[i + 1]);
tmp = DatumGetFloat8(DirectFunctionCall2(dist_ps,
PointPGetDatum(pt),
- LsegPGetDatum(&lseg)));
+ LsegPGetDatum(&lseg)));
if (i == 0 || tmp < result)
result = tmp;
}
@@ -277,7 +277,7 @@ widget_out(PG_FUNCTION_ARGS)
{
WIDGET *widget = (WIDGET *) PG_GETARG_POINTER(0);
char *str = psprintf("(%g,%g,%g)",
- widget->center.x, widget->center.y, widget->radius);
+ widget->center.x, widget->center.y, widget->radius);
PG_RETURN_CSTRING(str);
}
@@ -426,11 +426,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: " UINT64_FORMAT "/%d tuples inserted/selected",