mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-14 11:21:38 +00:00
Merge pull request #305 from Dmitry-Me/errorShouldBeClearedAfterLoad
If LoadFile() fails then subsequent successful LoadFile() must clear the error
This commit is contained in:
commit
28c7c8c14f
11
xmltest.cpp
11
xmltest.cpp
@ -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 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user