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

Add protocolStorageType*() to manage protocol storage types.

Abstract the string representation of storage types that are passed over the protocol layer.
This commit is contained in:
David Steele
2019-11-23 10:22:11 -05:00
parent a4b9440d35
commit ab65ffdfac
6 changed files with 66 additions and 6 deletions

View File

@ -100,6 +100,18 @@ testRun(void)
Storage *storageTest = storagePosixNew(
strNew(testPath()), STORAGE_MODE_FILE_DEFAULT, STORAGE_MODE_PATH_DEFAULT, true, NULL);
// *****************************************************************************************************************************
if (testBegin("protocolStorageTypeEnum() and protocolStorageTypeEnum()"))
{
TEST_RESULT_UINT(protocolStorageTypeEnum(PROTOCOL_STORAGE_TYPE_PG_STR), protocolStorageTypePg, "pg enum");
TEST_RESULT_UINT(protocolStorageTypeEnum(PROTOCOL_STORAGE_TYPE_REPO_STR), protocolStorageTypeRepo, "repo enum");
TEST_ERROR(protocolStorageTypeEnum(STRDEF(BOGUS_STR)), AssertError, "invalid protocol storage type 'BOGUS'");
TEST_RESULT_STR_STR(protocolStorageTypeStr(protocolStorageTypePg), PROTOCOL_STORAGE_TYPE_PG_STR, "pg str");
TEST_RESULT_STR_STR(protocolStorageTypeStr(protocolStorageTypeRepo), PROTOCOL_STORAGE_TYPE_REPO_STR, "repo str");
TEST_ERROR(protocolStorageTypeStr((ProtocolStorageType)999), AssertError, "invalid protocol storage type 999");
}
// *****************************************************************************************************************************
if (testBegin("repoIsLocal() and pgIsLocal()"))
{