diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-05-19 17:24:48 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-05-19 17:24:48 -0400 |
commit | 0245f8db36f375326c2bae0c3420d3c77714e72d (patch) | |
tree | 7ce91f23658a05ea24be4703fb06cdc6b56248f7 /src/test/modules/test_custom_rmgrs | |
parent | df6b19fbbc20d830de91d9bea68715a39635b568 (diff) | |
download | postgresql-0245f8db36f375326c2bae0c3420d3c77714e72d.tar.gz postgresql-0245f8db36f375326c2bae0c3420d3c77714e72d.zip |
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files.
This set of diffs is a bit larger than typical. We've updated to
pg_bsd_indent 2.1.2, which properly indents variable declarations that
have multi-line initialization expressions (the continuation lines are
now indented one tab stop). We've also updated to perltidy version
20230309 and changed some of its settings, which reduces its desire to
add whitespace to lines to make assignments etc. line up. Going
forward, that should make for fewer random-seeming changes to existing
code.
Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
Diffstat (limited to 'src/test/modules/test_custom_rmgrs')
-rw-r--r-- | src/test/modules/test_custom_rmgrs/t/001_basic.pl | 20 | ||||
-rw-r--r-- | src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/test/modules/test_custom_rmgrs/t/001_basic.pl b/src/test/modules/test_custom_rmgrs/t/001_basic.pl index 347a001823e..50655d3788a 100644 --- a/src/test/modules/test_custom_rmgrs/t/001_basic.pl +++ b/src/test/modules/test_custom_rmgrs/t/001_basic.pl @@ -27,7 +27,8 @@ $node->safe_psql('postgres', 'CREATE EXTENSION pg_walinspect'); # make sure checkpoints don't interfere with the test. my $start_lsn = $node->safe_psql('postgres', - qq[SELECT lsn FROM pg_create_physical_replication_slot('regress_test_slot1', true, false);]); + qq[SELECT lsn FROM pg_create_physical_replication_slot('regress_test_slot1', true, false);] +); # write and save the WAL record's returned end LSN for verifying it later my $record_end_lsn = $node->safe_psql('postgres', @@ -36,11 +37,12 @@ my $record_end_lsn = $node->safe_psql('postgres', # ensure the WAL is written and flushed to disk $node->safe_psql('postgres', 'SELECT pg_switch_wal()'); -my $end_lsn = $node->safe_psql('postgres', 'SELECT pg_current_wal_flush_lsn()'); +my $end_lsn = + $node->safe_psql('postgres', 'SELECT pg_current_wal_flush_lsn()'); # check if our custom WAL resource manager has successfully registered with the server -my $row_count = - $node->safe_psql('postgres', +my $row_count = $node->safe_psql( + 'postgres', qq[SELECT count(*) FROM pg_get_wal_resource_managers() WHERE rm_name = 'test_custom_rmgrs';]); is($row_count, '1', @@ -48,14 +50,14 @@ is($row_count, '1', ); # check if our custom WAL resource manager has successfully written a WAL record -my $expected = qq($record_end_lsn|test_custom_rmgrs|TEST_CUSTOM_RMGRS_MESSAGE|0|payload (10 bytes): payload123); -my $result = - $node->safe_psql('postgres', +my $expected = + qq($record_end_lsn|test_custom_rmgrs|TEST_CUSTOM_RMGRS_MESSAGE|0|payload (10 bytes): payload123); +my $result = $node->safe_psql( + 'postgres', qq[SELECT end_lsn, resource_manager, record_type, fpi_length, description FROM pg_get_wal_records_info('$start_lsn', '$end_lsn') WHERE resource_manager = 'test_custom_rmgrs';]); is($result, $expected, - 'custom WAL resource manager has successfully written a WAL record' -); + 'custom WAL resource manager has successfully written a WAL record'); $node->stop; done_testing(); diff --git a/src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c b/src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c index 1727910ce7e..a304ba54bb9 100644 --- a/src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c +++ b/src/test/modules/test_custom_rmgrs/test_custom_rmgrs.c @@ -31,7 +31,7 @@ PG_MODULE_MAGIC; */ typedef struct xl_testcustomrmgrs_message { - Size message_size; /* size of the message */ + Size message_size; /* size of the message */ char message[FLEXIBLE_ARRAY_MEMBER]; /* payload */ } xl_testcustomrmgrs_message; |