mirror of https://github.com/AxioDL/tinyxml2.git
If LoadFile() fails then subsequent successful LoadFile() must clear the error
This commit is contained in:
parent
ea21390f28
commit
d9852a53af
11
xmltest.cpp
11
xmltest.cpp
|
@ -1434,6 +1434,17 @@ int main( int argc, const char ** argv )
|
||||||
newElement->Accept( &printer );
|
newElement->Accept( &printer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// If a document fails to load then subsequent
|
||||||
|
// successful loads should clear the error
|
||||||
|
XMLDocument doc;
|
||||||
|
doc.LoadFile( "resources/no-such-file.xml" );
|
||||||
|
XMLTest( "No such file - should fail", true, doc.Error() );
|
||||||
|
|
||||||
|
doc.LoadFile( "resources/dream.xml" );
|
||||||
|
XMLTest( "Error should be cleared", false, doc.Error() );
|
||||||
|
}
|
||||||
|
|
||||||
// ----------- Performance tracking --------------
|
// ----------- Performance tracking --------------
|
||||||
{
|
{
|
||||||
#if defined( _MSC_VER )
|
#if defined( _MSC_VER )
|
||||||
|
|
Loading…
Reference in New Issue