/** @file  tst_psMetadata_07.c
*
*  @brief Test driver for psMetadataIO functions
*
*  This test driver contains the following tests for psMetadata:
*     Test A - Read an XML config file
*     Test B - Free data
*
*  @author  Ross Harman, MHPCC
*
*  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
*  @date  $Date: 2005-02-03 00:54:12 $
*
*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
*
*/
#include "config.h"
#include "pslib.h"
#include "psTest.h"

int main(int argc, char* argv[])
{
    // Test A - Read an XML config file
    printPositiveTestHeader(stdout, "psMetadata", "Test A - Read an XML config file");
    int res = 0;
    psU32 nFail = 0;
    psMetadata *md = NULL;
    md = psMetadataParseConfigXml(md, &nFail, XML_CONFIG_FILE, true);
    if (nFail != 0) {
        printf("psMetadataParseConfigXml returned error %d\n", res);
    }
    psFree(md);
    printFooter(stdout, "psMetadata", "Test A - Read an XML config file", true);


    // Test B - Free data
    printPositiveTestHeader(stdout, "psMetadata", "Test B - Free data");
    psMemCheckLeaks(0, NULL, stdout, false);
    psS32 nBad = psMemCheckCorruption(0);
    if(nBad) {
        printf("ERROR: Found %d bad memory blocks\n", nBad);
    }
    printFooter(stdout, "psMetadata", "Test B - Free data", true);

    return 0;
}
