/** @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.5.2.1 $  $Name: not supported by cvs2svn $
*  @date  $Date: 2005-01-19 02:17:04 $
*
*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
*
*/
#include "pslib.h"
#include "psTest.h"

#ifndef TIME_XML_FILE
#define TIME_XML_FILE "../../config/psTime.xml"
#pragma warning TIME_XML_FILE was not defined in the makefile.
#endif


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, TIME_XML_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;
}
