/*
Test program for TinyXML.
*/
#ifdef TIXML_USE_STL
#include <iostream>
#include <sstream>
using namespace std;
#else
#include <stdio.h>
#endif
#if defined( WIN32 ) && defined( TUNE )
#include <crtdbg.h>
_CrtMemState startMemState;
_CrtMemState endMemState;
#endif
#include "tinyxml.h"
bool XmlTest (const char* testString, const char* expected, const char* found, bool noEcho = false);
bool XmlTest( const char* testString, int expected, int found, bool noEcho = false );
static int gPass = 0;
static int gFail = 0;
bool XmlTest (const char* testString, const char* expected, const char* found, bool noEcho )
{
bool pass = !strcmp( expected, found );
if ( pass ) {
printf ("[pass]");
}
else {
printf ("[fail]");
}
if ( noEcho ) {
printf (" %s\n", testString);
}
else {
printf (" %s [%s][%s]\n", testString, expected, found);
}
if ( pass ) {
++gPass;
}
else {
++gFail;
}
return pass;
}
bool XmlTest( const char* testString, int expected, int found, bool noEcho )
{
bool pass = ( expected == found );
if ( pass ) {
printf ("[pass]");
}
else {
printf ("[fail]");
}