mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #611 from Dmitry-Me/testClearResetErrorState
Test Clear() clears the error
This commit is contained in:
commit
4b173cbcf1
10
xmltest.cpp
10
xmltest.cpp
|
@ -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 ------------
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue