Sfoglia il codice sorgente

Merge pull request #611 from Dmitry-Me/testClearResetErrorState

Test Clear() clears the error
Lee Thomason 8 anni fa
parent
commit
4b173cbcf1
1 ha cambiato i file con 10 aggiunte e 0 eliminazioni
  1. 10 0
      xmltest.cpp

+ 10 - 0
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 ------------
 	{