From 630be2edb3110b9627718bd7b735348e4940fdd4 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 26 Sep 2010 19:01:36 +0000 Subject: tests: Added node_doctype and parse_doctype tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@757 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_dom_traverse.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'tests/test_dom_traverse.cpp') diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp index 09055f0..865b90a 100644 --- a/tests/test_dom_traverse.cpp +++ b/tests/test_dom_traverse.cpp @@ -347,7 +347,7 @@ TEST_XML(dom_node_root, "") CHECK(doc.child(STR("node")).root() == doc); } -TEST_XML_FLAGS(dom_node_type, "pcdata", parse_default | parse_pi | parse_comments | parse_declaration) +TEST_XML_FLAGS(dom_node_type, "pcdata", parse_default | parse_pi | parse_comments | parse_declaration | parse_doctype) { CHECK(xml_node().type() == node_null); CHECK(doc.type() == node_document); @@ -355,6 +355,7 @@ TEST_XML_FLAGS(dom_node_type, "pcdatatype() == node_declaration); + CHECK((it++)->type() == node_doctype); CHECK((it++)->type() == node_pi); CHECK((it++)->type() == node_comment); CHECK((it++)->type() == node_element); @@ -365,7 +366,7 @@ TEST_XML_FLAGS(dom_node_type, "pcdatatype() == node_cdata); } -TEST_XML_FLAGS(dom_node_name_value, "pcdata", parse_default | parse_pi | parse_comments | parse_declaration) +TEST_XML_FLAGS(dom_node_name_value, "pcdata", parse_default | parse_pi | parse_comments | parse_declaration | parse_doctype) { CHECK_NAME_VALUE(xml_node(), STR(""), STR("")); CHECK_NAME_VALUE(doc, STR(""), STR("")); @@ -373,6 +374,7 @@ TEST_XML_FLAGS(dom_node_name_value, "pcdatatext") CHECK(walker.log == STR("|-1 <=|0 !node=|1 !child=|2 !=text|-1 >=")); } -TEST_XML_FLAGS(dom_offset_debug, "pcdata", parse_default | parse_pi | parse_comments | parse_declaration) +TEST_XML_FLAGS(dom_offset_debug, "pcdata", parse_default | parse_pi | parse_comments | parse_declaration | parse_doctype) { CHECK(xml_node().offset_debug() == -1); CHECK(doc.offset_debug() == 0); @@ -748,14 +750,15 @@ TEST_XML_FLAGS(dom_offset_debug, "pcdataoffset_debug() == 2); - CHECK((it++)->offset_debug() == 9); - CHECK((it++)->offset_debug() == 17); - CHECK((it++)->offset_debug() == 28); + CHECK((it++)->offset_debug() == 16); + CHECK((it++)->offset_debug() == 19); + CHECK((it++)->offset_debug() == 27); + CHECK((it++)->offset_debug() == 38); xml_node_iterator cit = doc.child(STR("node")).begin(); - CHECK((cit++)->offset_debug() == 33); - CHECK((cit++)->offset_debug() == 48); + CHECK((cit++)->offset_debug() == 43); + CHECK((cit++)->offset_debug() == 58); } TEST_XML(dom_internal_object, "value") -- cgit v1.2.3