Browse Source

Better tests for empty document

Dmitry-Me 11 years ago
parent
commit
588bb8de49
1 changed files with 9 additions and 1 deletions
  1. 9 1
      xmltest.cpp

+ 9 - 1
xmltest.cpp

@@ -863,12 +863,20 @@ int main( int argc, const char ** argv )
 
 	{
 		// Empty documents should return TIXML_XML_ERROR_PARSING_EMPTY, bug 1070717
-		const char* str = "    ";
+		const char* str = "";
 		XMLDocument doc;
 		doc.Parse( str );
 		XMLTest( "Empty document error", XML_ERROR_EMPTY_DOCUMENT, doc.ErrorID() );
 	}
 
+	{
+		// Documents with all whitespaces should return TIXML_XML_ERROR_PARSING_EMPTY, bug 1070717
+		const char* str = "    ";
+		XMLDocument doc;
+		doc.Parse( str );
+		XMLTest( "All whitespaces document error", XML_ERROR_EMPTY_DOCUMENT, doc.ErrorID() );
+	}
+
 	{
 		// Low entities
 		XMLDocument doc;