Skip to content

Commit

Permalink
Add manifestFree().
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwshang authored and dwsteele committed Sep 8, 2020
1 parent fead004 commit 4239f8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/info/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ struct Manifest
};

OBJECT_DEFINE_MOVE(MANIFEST);
OBJECT_DEFINE_FREE(MANIFEST);

/***********************************************************************************************************************************
Internal functions to add types to their lists
Expand Down
5 changes: 5 additions & 0 deletions src/info/manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
***********************************************************************************************************************************/
Expand Down
5 changes: 4 additions & 1 deletion test/src/module/info/manifestTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ testRun(void)
}

// *****************************************************************************************************************************
if (testBegin("manifestLoadFile()"))
if (testBegin("manifestLoadFile(), manifestFree()"))
{
Manifest *manifest = NULL;

Expand Down Expand Up @@ -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");
}
}

0 comments on commit 4239f8a

Please sign in to comment.