Merge pull request #611 from Dmitry-Me/testClearResetErrorState

Test Clear() clears the error
This commit is contained in:
Lee Thomason 2017-08-29 11:13:37 -07:00 committed by GitHub
commit 4b173cbcf1
1 changed files with 10 additions and 0 deletions

View File

@ -1549,6 +1549,16 @@ int main( int argc, const char ** argv )
doc.Clear();
XMLTest( "Document Clear()'s", true, doc.NoChildren() );
}
{
XMLDocument doc;
XMLTest( "No error initially", false, doc.Error() );
XMLError error = doc.Parse( "This is not XML" );
XMLTest( "Error after invalid XML", true, doc.Error() );
XMLTest( "Error after invalid XML", error, doc.ErrorID() );
doc.Clear();
XMLTest( "No error after Clear()", false, doc.Error() );
}
// ----------- Whitespace ------------
{