1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Add manifestFree().

This commit is contained in:
Cynthia Shang 2020-09-08 12:47:35 -04:00 committed by David Steele
parent fead004691
commit 4239f8a81a
3 changed files with 10 additions and 1 deletions

View File

@ -164,6 +164,7 @@ struct Manifest
};
OBJECT_DEFINE_MOVE(MANIFEST);
OBJECT_DEFINE_FREE(MANIFEST);
/***********************************************************************************************************************************
Internal functions to add types to their lists

View File

@ -264,6 +264,11 @@ const ManifestData *manifestData(const Manifest *this);
// Set backup label
void manifestBackupLabelSet(Manifest *this, const String *backupLabel);
/***********************************************************************************************************************************
Destructor
***********************************************************************************************************************************/
void manifestFree(Manifest *this);
/***********************************************************************************************************************************
Helper functions
***********************************************************************************************************************************/

View File

@ -2010,7 +2010,7 @@ testRun(void)
}
// *****************************************************************************************************************************
if (testBegin("manifestLoadFile()"))
if (testBegin("manifestLoadFile(), manifestFree()"))
{
Manifest *manifest = NULL;
@ -2090,5 +2090,8 @@ testRun(void)
storagePutP(storageNewWriteP(storageTest, BACKUP_MANIFEST_FILE_STR), content), "write main");
TEST_ASSIGN(manifest, manifestLoadFile(storageTest, STRDEF(BACKUP_MANIFEST_FILE), cipherTypeNone, NULL), "load main");
TEST_RESULT_UINT(manifestData(manifest)->pgSystemId, 1000000000000000094, " check file loaded");
TEST_RESULT_VOID(manifestFree(manifest), "free manifest");
TEST_RESULT_VOID(manifestFree(NULL), "free null manifest");
}
}