1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Convert BackupType enum to StringId.

Allows removal of backupType()/backupTypeStr() and improves debug logging of the enum.

Move BackupType enum and string constants to info/infoBackup.h so they are available to more modules. Also convert InfoBackup to use BackupType instead of a String.
This commit is contained in:
David Steele
2021-05-03 12:15:39 -04:00
committed by GitHub
parent 568dc0ba0c
commit 87df6d7a58
17 changed files with 129 additions and 182 deletions

View File

@ -311,18 +311,5 @@ testRun(void)
TEST_ERROR(ioWrite(write, buffer), AssertError, "should not be possible to see two misaligned pages in a row");
}
// *****************************************************************************************************************************
if (testBegin("backupType() and backupTypeStr()"))
{
TEST_RESULT_UINT(backupType(strNew("full")), backupTypeFull, "backup type full");
TEST_RESULT_UINT(backupType(strNew("diff")), backupTypeDiff, "backup type diff");
TEST_RESULT_UINT(backupType(strNew("incr")), backupTypeIncr, "backup type incr");
TEST_ERROR(backupType(strNew("bogus")), AssertError, "invalid backup type 'bogus'");
TEST_RESULT_STR_Z(backupTypeStr(backupTypeFull), "full", "backup type str full");
TEST_RESULT_STR_Z(backupTypeStr(backupTypeDiff), "diff", "backup type str diff");
TEST_RESULT_STR_Z(backupTypeStr(backupTypeIncr), "incr", "backup type str incr");
}
FUNCTION_HARNESS_RETURN_VOID();
}