mirror of https://github.com/AxioDL/tinyxml2.git
make the xmltest to return != 0, if one of the tests has failed.
This commit is contained in:
parent
1c9250cab5
commit
721b42da8e
|
@ -21,6 +21,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
|
int gTests = 0;
|
||||||
int gPass = 0;
|
int gPass = 0;
|
||||||
int gFail = 0;
|
int gFail = 0;
|
||||||
|
|
||||||
|
@ -47,6 +48,8 @@ bool XMLTest (const char* testString, const char* expected, const char* found, b
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++gTests;
|
||||||
|
|
||||||
if ( pass )
|
if ( pass )
|
||||||
++gPass;
|
++gPass;
|
||||||
else
|
else
|
||||||
|
@ -68,6 +71,8 @@ template< class T > bool XMLTest( const char* testString, T expected, T found, b
|
||||||
else
|
else
|
||||||
printf (" %s [%d][%d]\n", testString, static_cast<int>(expected), static_cast<int>(found) );
|
printf (" %s [%d][%d]\n", testString, static_cast<int>(expected), static_cast<int>(found) );
|
||||||
|
|
||||||
|
++gTests;
|
||||||
|
|
||||||
if ( pass )
|
if ( pass )
|
||||||
++gPass;
|
++gPass;
|
||||||
else
|
else
|
||||||
|
@ -1262,5 +1267,5 @@ int main( int argc, const char ** argv )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf ("\nPass %d, Fail %d\n", gPass, gFail);
|
printf ("\nPass %d, Fail %d\n", gPass, gFail);
|
||||||
return 0;
|
return (gTests - gPass);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue