From 8f27f244d0a0525a43d7acd840d71e6ecbe9e046 Mon Sep 17 00:00:00 2001
From: "arseny.kapoulkine"
 <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>
Date: Thu, 1 Jul 2010 18:01:12 +0000
Subject: [PATCH] parse_wnorm_attribute is no longer deprecated (it's part of
 W3C recommendations, after all)

git-svn-id: http://pugixml.googlecode.com/svn/trunk@557 99668b35-9821-0410-8761-19e4c4f06640
---
 src/pugixml.cpp           |  2 +-
 src/pugixml.hpp           |  5 -----
 tests/test_deprecated.cpp | 35 ----------------------------------
 tests/test_parse.cpp      | 40 +++++++++++++++++++++++++++------------
 4 files changed, 29 insertions(+), 53 deletions(-)

diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index ef30fb08..79a8fdf2 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -1771,7 +1771,7 @@ namespace
 
 	strconv_attribute_t get_strconv_attribute(unsigned int optmask)
 	{
-		STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20 && parse_wconv_attribute == 0x40);
+		STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20 && parse_wconv_attribute == 0x40 && parse_wnorm_attribute == 0x80);
 		
 		switch ((optmask >> 4) & 15) // get bitmask for flags (wconv wnorm eol escapes)
 		{
diff --git a/src/pugixml.hpp b/src/pugixml.hpp
index afc4ddc5..376d4e4c 100644
--- a/src/pugixml.hpp
+++ b/src/pugixml.hpp
@@ -227,12 +227,7 @@ namespace pugi
  	 * 3. Leading/trailing whitespace characters are trimmed
  	 * 
  	 * This flag is off by default.
-	 *
-	 * \deprecated This flag is deprecated
  	 */
-#if !defined(__INTEL_COMPILER) || __INTEL_COMPILER > 800
-	PUGIXML_DEPRECATED
-#endif
  	const unsigned int parse_wnorm_attribute	= 0x0080;
 
  	/**
diff --git a/tests/test_deprecated.cpp b/tests/test_deprecated.cpp
index 68a3ff9f..bcf96955 100644
--- a/tests/test_deprecated.cpp
+++ b/tests/test_deprecated.cpp
@@ -173,41 +173,6 @@ TEST_XML(dom_node_wildcard_star, "<node cd='1'/>")
 	CHECK(node.attribute_w(STR("*?*d*")).as_int() == 1);
 }
 
-// parse_wnorm_attribute flag
-TEST(parse_attribute_wnorm)
-{
-	xml_document doc;
-
-	for (int eol = 0; eol < 2; ++eol)
-		for (int wconv = 0; wconv < 2; ++wconv)
-		{
-			unsigned int flags = parse_minimal | parse_wnorm_attribute | (eol ? parse_eol : 0) | (wconv ? parse_wconv_attribute : 0);
-			CHECK(doc.load(STR("<node id=' \t\r\rval1  \rval2\r\nval3\nval4\r\r'/>"), flags));
-			CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("val1 val2 val3 val4"));
-		}
-}
-
-TEST(parse_attribute_variations_wnorm)
-{
-	xml_document doc;
-
-	for (int wnorm = 0; wnorm < 2; ++wnorm)
-		for (int eol = 0; eol < 2; ++eol)
-			for (int wconv = 0; wconv < 2; ++wconv)
-				for (int escapes = 0; escapes < 2; ++escapes)
-				{
-					unsigned int flags = parse_minimal;
-					
-					 flags |= (wnorm ? parse_wnorm_attribute : 0);
-					 flags |= (eol ? parse_eol : 0);
-					 flags |= (wconv ? parse_wconv_attribute : 0);
-					 flags |= (escapes ? parse_escapes : 0);
-
-					CHECK(doc.load(STR("<node id='1'/>"), flags));
-					CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("1"));
-				}
-}
-
 // document order
 TEST_XML(document_order_coverage, "<node id='1'/>")
 {
diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp
index d8aabd34..7f52d096 100644
--- a/tests/test_parse.cpp
+++ b/tests/test_parse.cpp
@@ -424,25 +424,41 @@ TEST(parse_attribute_eol_wconv)
 	CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("    val1   val2 val3 val4  "));
 }
 
-TEST(parse_attribute_variations)
+TEST(parse_attribute_wnorm)
 {
 	xml_document doc;
 
 	for (int eol = 0; eol < 2; ++eol)
 		for (int wconv = 0; wconv < 2; ++wconv)
-			for (int escapes = 0; escapes < 2; ++escapes)
-			{
-				unsigned int flags = parse_minimal;
-				
-				 flags |= (eol ? parse_eol : 0);
-				 flags |= (wconv ? parse_wconv_attribute : 0);
-				 flags |= (escapes ? parse_escapes : 0);
-
-				CHECK(doc.load(STR("<node id='1'/>"), flags));
-				CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("1"));
-			}
+		{
+			unsigned int flags = parse_minimal | parse_wnorm_attribute | (eol ? parse_eol : 0) | (wconv ? parse_wconv_attribute : 0);
+			CHECK(doc.load(STR("<node id=' \t\r\rval1  \rval2\r\nval3\nval4\r\r'/>"), flags));
+			CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("val1 val2 val3 val4"));
+		}
 }
 
+TEST(parse_attribute_variations)
+{
+	xml_document doc;
+
+	for (int wnorm = 0; wnorm < 2; ++wnorm)
+		for (int eol = 0; eol < 2; ++eol)
+			for (int wconv = 0; wconv < 2; ++wconv)
+				for (int escapes = 0; escapes < 2; ++escapes)
+				{
+					unsigned int flags = parse_minimal;
+					
+					 flags |= (wnorm ? parse_wnorm_attribute : 0);
+					 flags |= (eol ? parse_eol : 0);
+					 flags |= (wconv ? parse_wconv_attribute : 0);
+					 flags |= (escapes ? parse_escapes : 0);
+
+					CHECK(doc.load(STR("<node id='1'/>"), flags));
+					CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("1"));
+				}
+}
+
+
 TEST(parse_attribute_error)
 {
 	xml_document doc;
-- 
GitLab