Merge pull request #305 from Dmitry-Me/errorShouldBeClearedAfterLoad
If LoadFile() fails then subsequent successful LoadFile() must clear the error
diff --git a/xmltest.cpp b/xmltest.cpp
index 3fef541..d090863 100644
--- a/xmltest.cpp
+++ b/xmltest.cpp
@@ -1442,6 +1442,17 @@
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 --------------
{
#if defined( _MSC_VER )