summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2017-06-21 19:18:54 +0000
committerTom Lane2017-06-21 19:19:25 +0000
commitc7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch)
treee85979fb1213a731b7b557f8a830df541f26b135 /src/test
parentf669c09989bda894d6ba01634ccb229f0687c08a (diff)
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. 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/[email protected] Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/test')
-rw-r--r--src/test/isolation/isolationtester.h2
-rw-r--r--src/test/regress/pg_regress.c8
-rw-r--r--src/test/regress/regress.c9
-rw-r--r--src/test/thread/thread_test.c2
4 files changed, 10 insertions, 11 deletions
diff --git a/src/test/isolation/isolationtester.h b/src/test/isolation/isolationtester.h
index a15d5be8970..1f28272d650 100644
--- a/src/test/isolation/isolationtester.h
+++ b/src/test/isolation/isolationtester.h
@@ -60,4 +60,4 @@ extern int spec_yyparse(void);
extern int spec_yylex(void);
extern void spec_yyerror(const char *str);
-#endif /* ISOLATIONTESTER_H */
+#endif /* ISOLATIONTESTER_H */
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index b685aeb1fa6..832a138da56 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -357,7 +357,7 @@ make_temp_sockdir(void)
return temp_sockdir;
}
-#endif /* HAVE_UNIX_SOCKETS */
+#endif /* HAVE_UNIX_SOCKETS */
/*
* Check whether string matches pattern
@@ -1520,7 +1520,7 @@ wait_for_tests(PID_TYPE * pids, int *statuses, char **names, int num_tests)
p = active_pids[r - WAIT_OBJECT_0];
/* compact the active_pids array */
active_pids[r - WAIT_OBJECT_0] = active_pids[tests_left - 1];
-#endif /* WIN32 */
+#endif /* WIN32 */
for (i = 0; i < num_tests; i++)
{
@@ -1747,8 +1747,8 @@ run_schedule(const char *schedule, test_function tfunc)
bool newdiff;
if (tl)
- tl = tl->next; /* tl has the same length as rl and el
- * if it exists */
+ tl = tl->next; /* tl has the same length as rl and el if
+ * it exists */
newdiff = results_differ(tests[i], rl->str, el->str);
if (newdiff && tl)
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index e408e5ea4cf..d2a821f3d5d 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -550,7 +550,7 @@ ttdummy(PG_FUNCTION_ARGS)
return PointerGetDatum(NULL);
}
}
- else if (oldoff != TTDUMMY_INFINITY) /* DELETE */
+ else if (oldoff != TTDUMMY_INFINITY) /* DELETE */
{
pfree(relname);
return PointerGetDatum(NULL);
@@ -579,7 +579,7 @@ ttdummy(PG_FUNCTION_ARGS)
{
cvals[attnum[0] - 1] = newoff; /* start_date eq current date */
cnulls[attnum[0] - 1] = ' ';
- cvals[attnum[1] - 1] = TTDUMMY_INFINITY; /* stop_date eq INFINITY */
+ cvals[attnum[1] - 1] = TTDUMMY_INFINITY; /* stop_date eq INFINITY */
cnulls[attnum[1] - 1] = ' ';
}
else
@@ -708,8 +708,7 @@ Datum
int44out(PG_FUNCTION_ARGS)
{
int32 *an_array = (int32 *) PG_GETARG_POINTER(0);
- char *result = (char *) palloc(16 * 4); /* Allow 14 digits +
- * sign */
+ char *result = (char *) palloc(16 * 4); /* Allow 14 digits + sign */
int i;
char *walk;
@@ -896,7 +895,7 @@ test_atomic_flag(void)
pg_atomic_clear_flag(&flag);
}
-#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */
+#endif /* PG_HAVE_ATOMIC_FLAG_SIMULATION */
static void
test_atomic_uint32(void)
diff --git a/src/test/thread/thread_test.c b/src/test/thread/thread_test.c
index cb93bcc5ab7..32ce80e57f9 100644
--- a/src/test/thread/thread_test.c
+++ b/src/test/thread/thread_test.c
@@ -466,4 +466,4 @@ func_call_2(void)
pthread_mutex_unlock(&init_mutex);
}
-#endif /* !ENABLE_THREAD_SAFETY && !IN_CONFIGURE */
+#endif /* !ENABLE_THREAD_SAFETY && !IN_CONFIGURE */