Imported Upstream version 5.0.1 upstream/5.0.1
authorJinWang An <jinwang.an@samsung.com>
Fri, 30 Oct 2020 05:30:06 +0000 (14:30 +0900)
committerJinWang An <jinwang.an@samsung.com>
Fri, 30 Oct 2020 05:30:06 +0000 (14:30 +0900)
.travis.yml
CMakeLists.txt
dox
tinyxml2.cpp
tinyxml2.h
xmltest.cpp

index 50e9a6f..0634ccb 100644 (file)
@@ -12,4 +12,4 @@ before_script: cmake .
 
 script:
   - make -j3
-  - ./xmltest
+  - make test
index bb6a7ce..cec4470 100644 (file)
@@ -13,6 +13,7 @@ endif()
 \r
 project(tinyxml2)\r
 include(GNUInstallDirs)\r
+include(CTest)\r
 #enable_testing()\r
 \r
 #CMAKE_BUILD_TOOL\r
@@ -20,7 +21,7 @@ include(GNUInstallDirs)
 ################################\r
 # set lib version here\r
 \r
-set(GENERIC_LIB_VERSION "5.0.0")\r
+set(GENERIC_LIB_VERSION "5.0.1")\r
 set(GENERIC_LIB_SOVERSION "5")\r
 \r
 ################################\r
@@ -39,7 +40,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
 \r
 option(BUILD_SHARED_LIBS "build as shared library" ON)\r
 option(BUILD_STATIC_LIBS "build as static library" OFF)\r
-option(BUILD_TESTS "build xmltest" ON)\r
+option(BUILD_TESTS "build xmltest (deprecated: Use BUILD_TESTING)" ON)\r
 \r
 set(CMAKE_CXX_VISIBILITY_PRESET hidden)\r
 set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)\r
@@ -91,7 +92,7 @@ set_target_properties(tinyxml2_static PROPERTIES
         SOVERSION "${GENERIC_LIB_SOVERSION}")\r
 set_target_properties( tinyxml2_static PROPERTIES OUTPUT_NAME tinyxml2 )\r
 \r
-target_compile_definitions(tinyxml2 PUBLIC -D_CRT_SECURE_NO_WARNINGS)\r
+target_compile_definitions(tinyxml2_static PUBLIC -D_CRT_SECURE_NO_WARNINGS)\r
 \r
 if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")\r
     target_include_directories(tinyxml2_static PUBLIC \r
@@ -99,7 +100,7 @@ if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
                           $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>)\r
 \r
     if(MSVC)\r
-      target_compile_definitions(tinyxml2 PUBLIC -D_CRT_SECURE_NO_WARNINGS)\r
+      target_compile_definitions(tinyxml2_static PUBLIC -D_CRT_SECURE_NO_WARNINGS)\r
     endif(MSVC)\r
 else()\r
     include_directories(${PROJECT_SOURCE_DIR})\r
@@ -120,7 +121,7 @@ install(TARGETS tinyxml2_static
         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\r
 endif()\r
 \r
-if(BUILD_TESTS)\r
+if(BUILD_TESTING AND BUILD_TESTS)\r
   add_executable(xmltest xmltest.cpp)\r
   if(BUILD_SHARED_LIBS)\r
     add_dependencies(xmltest tinyxml2)\r
@@ -136,6 +137,8 @@ if(BUILD_TESTS)
     COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:xmltest>/resources/out\r
     COMMENT "Configuring xmltest resources directory: ${CMAKE_BINARY_DIR}/resources"\r
   )\r
+\r
+  add_test(NAME xmltest COMMAND xmltest)\r
 endif()\r
 \r
 install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\r
@@ -151,13 +154,15 @@ configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)\r
 \r
 # uninstall target\r
-configure_file(\r
-    "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"\r
-    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"\r
-    IMMEDIATE @ONLY)\r
-\r
-add_custom_target(uninstall\r
-    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)\r
+if(NOT TARGET uninstall)\r
+  configure_file(\r
+      "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"\r
+      "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"\r
+      IMMEDIATE @ONLY)\r
+\r
+  add_custom_target(uninstall\r
+      COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)\r
+endif()\r
 \r
 file(WRITE\r
     ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake\r
@@ -168,4 +173,4 @@ install(FILES
         DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})\r
 \r
 install(EXPORT ${CMAKE_PROJECT_NAME}Targets\r
-        DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
\ No newline at end of file
+        DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})\r
diff --git a/dox b/dox
index 9e27136..601feed 100644 (file)
--- a/dox
+++ b/dox
@@ -38,7 +38,7 @@ PROJECT_NAME           = "TinyXML-2"
 # could be handy for archiving the generated documentation or if some version\r
 # control system is used.\r
 \r
-PROJECT_NUMBER = 5.0.0\r
+PROJECT_NUMBER = 5.0.1\r
 \r
 # Using the PROJECT_BRIEF tag one can provide an optional one line description\r
 # for a project that appears at the top of each page and should give viewer a\r
index b8c45e6..3043ab3 100755 (executable)
@@ -1966,10 +1966,10 @@ const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = {
     "XML_ERROR_FILE_NOT_FOUND",\r
     "XML_ERROR_FILE_COULD_NOT_BE_OPENED",\r
     "XML_ERROR_FILE_READ_ERROR",\r
-    "XML_ERROR_ELEMENT_MISMATCH",\r
+    "UNUSED_XML_ERROR_ELEMENT_MISMATCH",\r
     "XML_ERROR_PARSING_ELEMENT",\r
     "XML_ERROR_PARSING_ATTRIBUTE",\r
-    "XML_ERROR_IDENTIFYING_TAG",\r
+    "UNUSED_XML_ERROR_IDENTIFYING_TAG",\r
     "XML_ERROR_PARSING_TEXT",\r
     "XML_ERROR_PARSING_CDATA",\r
     "XML_ERROR_PARSING_COMMENT",\r
@@ -2308,6 +2308,16 @@ void XMLDocument::SetError( XMLError error, const char* str1, const char* str2,
     return errorName;\r
 }\r
 \r
+const char* XMLDocument::GetErrorStr1() const \r
+{\r
+       return _errorStr1.GetStr();\r
+}\r
+\r
+const char* XMLDocument::GetErrorStr2() const \r
+{\r
+       return _errorStr2.GetStr();\r
+}\r
+\r
 const char* XMLDocument::ErrorName() const\r
 {\r
     return ErrorIDToName(_errorID);\r
index dea324e..e6a0ced 100755 (executable)
@@ -100,7 +100,7 @@ distribution.
 */\r
 static const int TIXML2_MAJOR_VERSION = 5;\r
 static const int TIXML2_MINOR_VERSION = 0;\r
-static const int TIXML2_PATCH_VERSION = 0;\r
+static const int TIXML2_PATCH_VERSION = 1;\r
 \r
 namespace tinyxml2\r
 {\r
@@ -513,10 +513,10 @@ enum XMLError {
     XML_ERROR_FILE_NOT_FOUND,\r
     XML_ERROR_FILE_COULD_NOT_BE_OPENED,\r
     XML_ERROR_FILE_READ_ERROR,\r
-    XML_ERROR_ELEMENT_MISMATCH,\r
+    UNUSED_XML_ERROR_ELEMENT_MISMATCH, // remove at next major version\r
     XML_ERROR_PARSING_ELEMENT,\r
     XML_ERROR_PARSING_ATTRIBUTE,\r
-    XML_ERROR_IDENTIFYING_TAG,\r
+    UNUSED_XML_ERROR_IDENTIFYING_TAG,  // remove at next major version\r
     XML_ERROR_PARSING_TEXT,\r
     XML_ERROR_PARSING_CDATA,\r
     XML_ERROR_PARSING_COMMENT,\r
@@ -1803,13 +1803,11 @@ public:
     static const char* ErrorIDToName(XMLError errorID);\r
 \r
     /// Return a possibly helpful diagnostic location or string.\r
-    const char* GetErrorStr1() const {\r
-        return _errorStr1.GetStr();\r
-    }\r
+       const char* GetErrorStr1() const;\r
+\r
     /// Return a possibly helpful secondary diagnostic location or string.\r
-    const char* GetErrorStr2() const {\r
-        return _errorStr2.GetStr();\r
-    }\r
+       const char* GetErrorStr2() const;\r
+\r
     /// Return the line where the error occured, or zero if unknown.\r
     int GetErrorLineNum() const\r
     {\r
index 3ed25b8..276c61b 100644 (file)
@@ -435,10 +435,10 @@ int main( int argc, const char ** argv )
                XMLTest( "Programmatic DOM", true, doc->FirstChildElement()->FirstChildElement()->BoolAttribute( "attrib" ) );\r
                int value1 = 10;\r
                int value2 = doc->FirstChildElement()->LastChildElement()->IntAttribute( "attrib", 10 );\r
-               int result = doc->FirstChildElement()->LastChildElement()->QueryIntAttribute( "attrib", &value1 );\r
-               XMLTest( "Programmatic DOM", result, (int)XML_NO_ATTRIBUTE );\r
-               XMLTest( "Programmatic DOM", value1, 10 );\r
-               XMLTest( "Programmatic DOM", value2, 10 );\r
+               XMLError result = doc->FirstChildElement()->LastChildElement()->QueryIntAttribute( "attrib", &value1 );\r
+               XMLTest( "Programmatic DOM", XML_NO_ATTRIBUTE, result );\r
+               XMLTest( "Programmatic DOM", 10, value1 );\r
+               XMLTest( "Programmatic DOM", 10, value2 );\r
 \r
                doc->Print();\r
 \r
@@ -499,7 +499,7 @@ int main( int argc, const char ** argv )
 \r
                XMLDocument doc;\r
                doc.Parse( error );\r
-               XMLTest( "Bad XML", doc.ErrorID(), XML_ERROR_PARSING_ATTRIBUTE );\r
+               XMLTest( "Bad XML", XML_ERROR_PARSING_ATTRIBUTE, doc.ErrorID() );\r
        }\r
 \r
        {\r
@@ -510,30 +510,31 @@ int main( int argc, const char ** argv )
 \r
                XMLElement* ele = doc.FirstChildElement();\r
 \r
-               int iVal, result;\r
+               int iVal;\r
+               XMLError result;\r
                double dVal;\r
 \r
                result = ele->QueryDoubleAttribute( "attr0", &dVal );\r
-               XMLTest( "Query attribute: int as double", result, (int)XML_SUCCESS);\r
-               XMLTest( "Query attribute: int as double", (int)dVal, 1 );\r
-               XMLTest( "Query attribute: int as double", (int)ele->DoubleAttribute("attr0"), 1);\r
+               XMLTest( "Query attribute: int as double", XML_SUCCESS, result);\r
+               XMLTest( "Query attribute: int as double", 1, (int)dVal );\r
+               XMLTest( "Query attribute: int as double", 1, (int)ele->DoubleAttribute("attr0"));\r
 \r
                result = ele->QueryDoubleAttribute( "attr1", &dVal );\r
-               XMLTest( "Query attribute: double as double", result, (int)XML_SUCCESS);\r
-               XMLTest( "Query attribute: double as double", dVal, 2.0 );\r
-               XMLTest( "Query attribute: double as double", ele->DoubleAttribute("attr1"), 2.0 );\r
+               XMLTest( "Query attribute: double as double", XML_SUCCESS, result);\r
+               XMLTest( "Query attribute: double as double", 2.0, dVal );\r
+               XMLTest( "Query attribute: double as double", 2.0, ele->DoubleAttribute("attr1") );\r
 \r
                result = ele->QueryIntAttribute( "attr1", &iVal );\r
-               XMLTest( "Query attribute: double as int", result, (int)XML_SUCCESS);\r
-               XMLTest( "Query attribute: double as int", iVal, 2 );\r
+               XMLTest( "Query attribute: double as int", XML_SUCCESS, result);\r
+               XMLTest( "Query attribute: double as int", 2, iVal );\r
 \r
                result = ele->QueryIntAttribute( "attr2", &iVal );\r
-               XMLTest( "Query attribute: not a number", result, (int)XML_WRONG_ATTRIBUTE_TYPE );\r
-               XMLTest( "Query attribute: not a number", ele->DoubleAttribute("attr2", 4.0), 4.0 );\r
+               XMLTest( "Query attribute: not a number", XML_WRONG_ATTRIBUTE_TYPE, result );\r
+               XMLTest( "Query attribute: not a number", 4.0, ele->DoubleAttribute("attr2", 4.0) );\r
 \r
                result = ele->QueryIntAttribute( "bar", &iVal );\r
-               XMLTest( "Query attribute: does not exist", result, (int)XML_NO_ATTRIBUTE );\r
-               XMLTest( "Query attribute: does not exist", ele->BoolAttribute("bar", true), true );\r
+               XMLTest( "Query attribute: does not exist", XML_NO_ATTRIBUTE, result );\r
+               XMLTest( "Query attribute: does not exist", true, ele->BoolAttribute("bar", true) );\r
        }\r
 \r
        {\r
@@ -558,7 +559,7 @@ int main( int argc, const char ** argv )
                ele->QueryAttribute( "int", &iVal2 );\r
                ele->QueryAttribute( "double", &dVal2 );\r
 \r
-               XMLTest( "Attribute match test", ele->Attribute( "str", "strValue" ), "strValue" );\r
+               XMLTest( "Attribute match test", "strValue", ele->Attribute( "str", "strValue" ) );\r
                XMLTest( "Attribute round trip. c-string.", "strValue", cStr );\r
                XMLTest( "Attribute round trip. int.", 1, iVal );\r
                XMLTest( "Attribute round trip. double.", -1, (int)dVal );\r
@@ -796,7 +797,7 @@ int main( int argc, const char ** argv )
                {\r
                        XMLDocument doc;\r
                        doc.LoadFile("resources/printer.xml");\r
-                       XMLTest("XMLPrinter Stream mode: load", doc.ErrorID(), XML_SUCCESS, true);\r
+                       XMLTest("XMLPrinter Stream mode: load", XML_SUCCESS, doc.ErrorID(), true);\r
 \r
                        const XMLDocument& cdoc = doc;\r
 \r
@@ -829,8 +830,8 @@ int main( int argc, const char ** argv )
                doc.Parse( str );\r
                doc.Print();\r
 \r
-               XMLTest( "CDATA parse.", doc.FirstChildElement()->FirstChild()->Value(),\r
-                                                                "I am > the rules!\n...since I make symbolic puns",\r
+               XMLTest( "CDATA parse.", "I am > the rules!\n...since I make symbolic puns",\r
+                                                                doc.FirstChildElement()->FirstChild()->Value(),\r
                                                                 false );\r
        }\r
 \r
@@ -846,8 +847,9 @@ int main( int argc, const char ** argv )
                doc.Parse( str );\r
                doc.Print();\r
 \r
-               XMLTest( "CDATA parse. [ tixml1:1480107 ]", doc.FirstChildElement()->FirstChild()->Value(),\r
+               XMLTest( "CDATA parse. [ tixml1:1480107 ]",\r
                                                                 "<b>I am > the rules!</b>\n...since I make symbolic puns",\r
+                                                                doc.FirstChildElement()->FirstChild()->Value(),\r
                                                                 false );\r
        }\r
 \r
@@ -864,7 +866,7 @@ int main( int argc, const char ** argv )
                XMLNode* childNode0 = parent->InsertEndChild( childText0 );\r
                XMLNode* childNode1 = parent->InsertAfterChild( childNode0, childText1 );\r
 \r
-               XMLTest( "Test InsertAfterChild on empty node. ", ( childNode1 == parent->LastChild() ), true );\r
+               XMLTest( "Test InsertAfterChild on empty node. ", true, ( childNode1 == parent->LastChild() ) );\r
        }\r
 \r
        {\r
@@ -919,10 +921,11 @@ int main( int argc, const char ** argv )
                XMLDocument doc( false );\r
                doc.Parse( passages );\r
 \r
-               XMLTest( "No entity parsing.", doc.FirstChildElement()->FirstChildElement()->Attribute( "context" ),\r
-                                "Line 5 has &quot;quotation marks&quot; and &apos;apostrophe marks&apos;." );\r
-               XMLTest( "No entity parsing.", doc.FirstChildElement()->FirstChildElement()->FirstChild()->Value(),\r
-                                "Crazy &ttk;" );\r
+               XMLTest( "No entity parsing.",\r
+                                "Line 5 has &quot;quotation marks&quot; and &apos;apostrophe marks&apos;.",\r
+                                doc.FirstChildElement()->FirstChildElement()->Attribute( "context" ) );\r
+               XMLTest( "No entity parsing.", "Crazy &ttk;",\r
+                                doc.FirstChildElement()->FirstChildElement()->FirstChild()->Value() );\r
                doc.Print();\r
        }\r
 \r
@@ -931,9 +934,9 @@ int main( int argc, const char ** argv )
 \r
                XMLDocument doc;\r
                doc.Parse( test );\r
-               XMLTest( "dot in names", doc.Error(), false );\r
-               XMLTest( "dot in names", doc.FirstChildElement()->Name(), "a.elem" );\r
-               XMLTest( "dot in names", doc.FirstChildElement()->Attribute( "xmi.version" ), "2.0" );\r
+               XMLTest( "dot in names", false, doc.Error() );\r
+               XMLTest( "dot in names", "a.elem", doc.FirstChildElement()->Name() );\r
+               XMLTest( "dot in names", "2.0", doc.FirstChildElement()->Attribute( "xmi.version" ) );\r
        }\r
 \r
        {\r
@@ -944,7 +947,7 @@ int main( int argc, const char ** argv )
 \r
                XMLText* text = doc.FirstChildElement()->FirstChildElement()->FirstChild()->ToText();\r
                XMLTest( "Entity with one digit.",\r
-                                text->Value(), "1.1 Start easy ignore fin thickness\n",\r
+                                "1.1 Start easy ignore fin thickness\n", text->Value(),\r
                                 false );\r
        }\r
 \r
@@ -1022,7 +1025,7 @@ int main( int argc, const char ** argv )
                XMLDocument doc;\r
                doc.Parse( "<test>&#x0e;</test>" );\r
                const char result[] = { 0x0e, 0 };\r
-               XMLTest( "Low entities.", doc.FirstChildElement()->GetText(), result );\r
+               XMLTest( "Low entities.", result, doc.FirstChildElement()->GetText() );\r
                doc.Print();\r
        }\r
 \r
@@ -1030,18 +1033,18 @@ int main( int argc, const char ** argv )
                // Attribute values with trailing quotes not handled correctly\r
                XMLDocument doc;\r
                doc.Parse( "<foo attribute=bar\" />" );\r
-               XMLTest( "Throw error with bad end quotes.", doc.Error(), true );\r
+               XMLTest( "Throw error with bad end quotes.", true, doc.Error() );\r
        }\r
 \r
        {\r
                // [ 1663758 ] Failure to report error on bad XML\r
                XMLDocument xml;\r
                xml.Parse("<x>");\r
-               XMLTest("Missing end tag at end of input", xml.Error(), true);\r
+               XMLTest("Missing end tag at end of input", true, xml.Error());\r
                xml.Parse("<x> ");\r
-               XMLTest("Missing end tag with trailing whitespace", xml.Error(), true);\r
+               XMLTest("Missing end tag with trailing whitespace", true, xml.Error());\r
                xml.Parse("<x></y>");\r
-               XMLTest("Mismatched tags", xml.ErrorID(), XML_ERROR_MISMATCHED_ELEMENT);\r
+               XMLTest("Mismatched tags", XML_ERROR_MISMATCHED_ELEMENT, xml.ErrorID() );\r
        }\r
 \r
 \r
@@ -1286,7 +1289,7 @@ int main( int argc, const char ** argv )
                doc.Parse( xml );\r
 \r
                XMLElement* ele = XMLHandle( doc ).FirstChildElement( "element" ).FirstChild().ToElement();\r
-               XMLTest( "Handle, success, mutable", ele->Value(), "sub" );\r
+               XMLTest( "Handle, success, mutable", "sub", ele->Value() );\r
 \r
                XMLHandle docH( doc );\r
                ele = docH.FirstChildElement( "none" ).FirstChildElement( "element" ).ToElement();\r
@@ -1315,8 +1318,8 @@ int main( int argc, const char ** argv )
                doc.Print( &printer );\r
 \r
                static const char* result  = "\xef\xbb\xbf<?xml version=\"1.0\" encoding=\"UTF-8\"?>";\r
-               XMLTest( "BOM and default declaration", printer.CStr(), result, false );\r
-               XMLTest( "CStrSize", printer.CStrSize(), 42, false );\r
+               XMLTest( "BOM and default declaration", result, printer.CStr(), false );\r
+               XMLTest( "CStrSize", 42, printer.CStrSize(), false );\r
        }\r
        {\r
                const char* xml = "<ipxml ws='1'><info bla=' /></ipxml>";\r
@@ -1346,50 +1349,50 @@ int main( int argc, const char ** argv )
                pointElement->FirstChildElement( "valid" )->QueryBoolText( &boolValue );\r
 \r
 \r
-               XMLTest( "QueryIntText", intValue, 1,                                           false );\r
-               XMLTest( "QueryUnsignedText", unsignedValue, (unsigned)1,       false );\r
-               XMLTest( "QueryFloatText", floatValue, 1.2f,                            false );\r
-               XMLTest( "QueryDoubleText", doubleValue, 1.2,                           false );\r
-               XMLTest( "QueryBoolText", boolValue, true,                                      false );\r
+               XMLTest( "QueryIntText", 1, intValue,                                           false );\r
+               XMLTest( "QueryUnsignedText", (unsigned)1, unsignedValue,       false );\r
+               XMLTest( "QueryFloatText", 1.2f, floatValue,                            false );\r
+               XMLTest( "QueryDoubleText", 1.2, doubleValue,                           false );\r
+               XMLTest( "QueryBoolText", true, boolValue,                                      false );\r
        }\r
 \r
        {\r
                const char* xml = "<element><_sub/><:sub/><sub:sub/><sub-sub/></element>";\r
                XMLDocument doc;\r
                doc.Parse( xml );\r
-               XMLTest( "Non-alpha element lead letter parses.", doc.Error(), false );\r
+               XMLTest( "Non-alpha element lead letter parses.", false, doc.Error() );\r
        }\r
     \r
     {\r
         const char* xml = "<element _attr1=\"foo\" :attr2=\"bar\"></element>";\r
         XMLDocument doc;\r
         doc.Parse( xml );\r
-        XMLTest("Non-alpha attribute lead character parses.", doc.Error(), false);\r
+        XMLTest("Non-alpha attribute lead character parses.", false, doc.Error());\r
     }\r
     \r
     {\r
         const char* xml = "<3lement></3lement>";\r
         XMLDocument doc;\r
         doc.Parse( xml );\r
-        XMLTest("Element names with lead digit fail to parse.", doc.Error(), true);\r
+        XMLTest("Element names with lead digit fail to parse.", true, doc.Error());\r
     }\r
 \r
        {\r
                const char* xml = "<element/>WOA THIS ISN'T GOING TO PARSE";\r
                XMLDocument doc;\r
                doc.Parse( xml, 10 );\r
-               XMLTest( "Set length of incoming data", doc.Error(), false );\r
+               XMLTest( "Set length of incoming data", false, doc.Error() );\r
        }\r
 \r
     {\r
         XMLDocument doc;\r
-        XMLTest( "Document is initially empty", doc.NoChildren(), true );\r
+        XMLTest( "Document is initially empty", true, doc.NoChildren() );\r
         doc.Clear();\r
-        XMLTest( "Empty is empty after Clear()", doc.NoChildren(), true );\r
+        XMLTest( "Empty is empty after Clear()", true, doc.NoChildren() );\r
         doc.LoadFile( "resources/dream.xml" );\r
-        XMLTest( "Document has something to Clear()", doc.NoChildren(), false );\r
+        XMLTest( "Document has something to Clear()", false, doc.NoChildren() );\r
         doc.Clear();\r
-        XMLTest( "Document Clear()'s", doc.NoChildren(), true );\r
+        XMLTest( "Document Clear()'s", true, doc.NoChildren() );\r
     }\r
     \r
        // ----------- Whitespace ------------\r
@@ -1693,15 +1696,15 @@ int main( int argc, const char ** argv )
 \r
            XMLDocument doc;\r
            doc.Parse(xml0);\r
-           XMLTest("Test that the code changes do not affect normal parsing", doc.Error(), false);\r
+           XMLTest("Test that the code changes do not affect normal parsing", false, doc.Error() );\r
            doc.Parse(xml1);\r
-           XMLTest("Test that the second declaration is allowed", doc.Error(), false);\r
+           XMLTest("Test that the second declaration is allowed", false, doc.Error() );\r
            doc.Parse(xml2);\r
-           XMLTest("Test that declaration after a child is not allowed", doc.ErrorID(), XML_ERROR_PARSING_DECLARATION);\r
+           XMLTest("Test that declaration after a child is not allowed", XML_ERROR_PARSING_DECLARATION, doc.ErrorID() );\r
            doc.Parse(xml3);\r
-           XMLTest("Test that declaration after a child is not allowed", doc.ErrorID(), XML_ERROR_PARSING_DECLARATION);\r
+           XMLTest("Test that declaration after a child is not allowed", XML_ERROR_PARSING_DECLARATION, doc.ErrorID() );\r
            doc.Parse(xml4);\r
-           XMLTest("Test that declaration inside a child is not allowed", doc.ErrorID(), XML_ERROR_PARSING_DECLARATION);\r
+           XMLTest("Test that declaration inside a child is not allowed", XML_ERROR_PARSING_DECLARATION, doc.ErrorID() );\r
        }\r
 \r
     {\r
@@ -1774,9 +1777,9 @@ int main( int argc, const char ** argv )
                // an interesting test case.\r
                XMLDocument doc;\r
                XMLError err = doc.Parse(xml);\r
-               XMLElement* playlist = doc.FirstChildElement("playlist");\r
+               XMLTest("Crash bug parsing", XML_SUCCESS, err );\r
 \r
-               XMLTest("Crash bug parsing", err, XML_SUCCESS);\r
+               XMLElement* playlist = doc.FirstChildElement("playlist");\r
                XMLTest("Crash bug parsing", true, playlist != 0);\r
 \r
                tinyxml2::XMLElement* entry = playlist->FirstChildElement("entry");\r
@@ -1803,7 +1806,7 @@ int main( int argc, const char ** argv )
                for (const XMLElement* p = playlist->FirstChildElement("property"); p; p = p->NextSiblingElement("property")) {\r
                        nProperty++;\r
                }\r
-               XMLTest("Crash bug parsing", nProperty, 2);\r
+               XMLTest("Crash bug parsing", 2, nProperty);\r
        }\r
 \r
     // ----------- Line Number Tracking --------------\r