You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-13 01:00:23 +02:00
Change meaning of TEST_RESULT_STR() macro.
This macro was created before the String object existed so subsequent usage with String always included a lot of strPtr() wrapping. TEST_RESULT_STR_Z() had already been introduced but a wholesale replacement of TEST_RESULT_STR() was not done since the priority was on the C migration. Update all calls to (old) TEST_RESULT_STR() with one of the following variants: (new) TEST_RESULT_STR(), TEST_RESULT_STR_Z(), TEST_RESULT_Z(), TEST_RESULT_Z_STR().
This commit is contained in:
@ -67,12 +67,12 @@ testRun(void)
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000005.ready")), NULL);
|
||||
storagePutP(storageNewWriteP(storagePgWrite(), strNew("pg_wal/archive_status/000000010000000100000006.ready")), NULL);
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(archivePushProcessList(strNewFmt("%s/db/pg_wal", testPath())), "|")),
|
||||
TEST_RESULT_STR_Z(
|
||||
strLstJoin(archivePushProcessList(strNewFmt("%s/db/pg_wal", testPath())), "|"),
|
||||
"000000010000000100000002|000000010000000100000005|000000010000000100000006", "ready list");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
TEST_RESULT_STR_Z(
|
||||
strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|"),
|
||||
"000000010000000100000003.ok", "remaining status list");
|
||||
|
||||
// Test drop
|
||||
@ -168,8 +168,8 @@ testRun(void)
|
||||
TEST_RESULT_UINT(result.pgVersion, PG_VERSION_96, "check pg version");
|
||||
TEST_RESULT_UINT(result.pgSystemId, 0xFACEFACEFACEFACE, "check pg system id");
|
||||
TEST_RESULT_UINT(result.pgWalSegmentSize, 16 * 1024 * 1024, "check wal segment size");
|
||||
TEST_RESULT_STR(strPtr(result.archiveId), "9.6-1", "check archive id");
|
||||
TEST_RESULT_STR(strPtr(result.archiveCipherPass), NULL, "check archive cipher pass (not set in this test)");
|
||||
TEST_RESULT_STR_Z(result.archiveId, "9.6-1", "check archive id");
|
||||
TEST_RESULT_STR_Z(result.archiveCipherPass, NULL, "check archive cipher pass (not set in this test)");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
@ -351,8 +351,8 @@ testRun(void)
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
archivePushProtocol(PROTOCOL_COMMAND_ARCHIVE_PUSH_STR, paramList, server), true, "protocol archive put");
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(serverWrite)),
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(serverWrite),
|
||||
"{\"out\":\"WAL file '000000010000000100000002' already exists in the archive with the same checksum"
|
||||
"\\nHINT: this is valid in some recovery scenarios but may also indicate a problem.\"}\n",
|
||||
"check result");
|
||||
@ -580,12 +580,12 @@ testRun(void)
|
||||
|
||||
TEST_ERROR(cmdArchivePushAsync(), AssertError, "no WAL files to process");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strNewBuf(storageGetP(storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error"))))),
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(storageGetP(storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/global.error")))),
|
||||
"25\nno WAL files to process", "check global.error");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
TEST_RESULT_STR_Z(
|
||||
strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|"),
|
||||
"global.error", "check status files");
|
||||
|
||||
// Push WAL
|
||||
@ -614,8 +614,8 @@ testRun(void)
|
||||
TEST_64BIT() ? "f81d63dd5e258cd607534f3531bbd71442797e37" : "02d228126281e8e102b35a2737e45a0527946296")),
|
||||
true, "check repo for WAL 1 file");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
TEST_RESULT_STR_Z(
|
||||
strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|"),
|
||||
"000000010000000100000001.ok|000000010000000100000002.error", "check status files");
|
||||
|
||||
// Create WAL 2 segment
|
||||
@ -643,8 +643,8 @@ testRun(void)
|
||||
TEST_64BIT() ? "0aea6fa5d53500ce548b84a86bc3a29ae77fa048" : "408822a89ef44ef6740e785743bf1b870d8024a2")),
|
||||
true, "check repo for WAL 2 file");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
TEST_RESULT_STR_Z(
|
||||
strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|"),
|
||||
"000000010000000100000001.ok|000000010000000100000002.ok", "check status files");
|
||||
|
||||
// Check that drop functionality works
|
||||
@ -663,22 +663,18 @@ testRun(void)
|
||||
"P00 WARN: dropped WAL file '000000010000000100000001' because archive queue exceeded 16MB\n"
|
||||
"P00 WARN: dropped WAL file '000000010000000100000002' because archive queue exceeded 16MB");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(
|
||||
strNewBuf(
|
||||
storageGetP(
|
||||
storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.ok"))))),
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(
|
||||
storageGetP(storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.ok")))),
|
||||
"0\ndropped WAL file '000000010000000100000001' because archive queue exceeded 16MB", "check WAL 1 warning");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(
|
||||
strNewBuf(
|
||||
storageGetP(
|
||||
storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000002.ok"))))),
|
||||
TEST_RESULT_STR_Z(
|
||||
strNewBuf(
|
||||
storageGetP(storageNewReadP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000002.ok")))),
|
||||
"0\ndropped WAL file '000000010000000100000002' because archive queue exceeded 16MB", "check WAL 2 warning");
|
||||
|
||||
TEST_RESULT_STR(
|
||||
strPtr(strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|")),
|
||||
TEST_RESULT_STR_Z(
|
||||
strLstJoin(strLstSort(storageListP(storageSpool(), strNew(STORAGE_SPOOL_ARCHIVE_OUT)), sortOrderAsc), "|"),
|
||||
"000000010000000100000001.ok|000000010000000100000002.ok", "check status files");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user