Merge pull request #305 from Dmitry-Me/errorShouldBeClearedAfterLoad

If LoadFile() fails then subsequent successful LoadFile() must clear the error
This commit is contained in:
Lee Thomason 2015-03-26 11:19:28 -07:00
commit 28c7c8c14f

View File

@ -1442,6 +1442,17 @@ int main( int argc, const char ** argv )
XMLTest( "Issue 302. Subsequent success in saving", doc.ErrorName(), "XML_SUCCESS" ); XMLTest( "Issue 302. Subsequent success in saving", doc.ErrorName(), "XML_SUCCESS" );
} }
{
// 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 )