From 4f6ecee14cbbf72009ef1c7c27007773c9efa385 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Mon, 2 Aug 2010 20:16:53 +0000 Subject: tests: More miscellaneous tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@619 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_dom_modify.cpp | 1 + tests/test_dom_traverse.cpp | 3 +++ tests/test_write.cpp | 20 ++++++++++++++++++++ tests/test_xpath.cpp | 5 +++++ tests/test_xpath_api.cpp | 1 - 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index 38cc89e..5a5d3ff 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -163,6 +163,7 @@ TEST_XML(dom_node_append_copy_attribute, " CHECK(xml_node().append_copy(xml_attribute()) == xml_attribute()); CHECK(xml_node().append_copy(doc.child(STR("node")).attribute(STR("a1"))) == xml_attribute()); CHECK(doc.append_copy(doc.child(STR("node")).attribute(STR("a1"))) == xml_attribute()); + CHECK(doc.child(STR("node")).append_copy(xml_attribute()) == xml_attribute()); xml_node node = doc.child(STR("node")); xml_node child = node.child(STR("child")); diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp index 8075dc3..fa6c6ef 100644 --- a/tests/test_dom_traverse.cpp +++ b/tests/test_dom_traverse.cpp @@ -577,6 +577,7 @@ TEST_XML(dom_node_path, "text") TEST_XML(dom_node_first_element_by_path, "text") { CHECK(xml_node().first_element_by_path(STR("/")) == xml_node()); + CHECK(xml_node().first_element_by_path(STR("a")) == xml_node()); CHECK(doc.first_element_by_path(STR("")) == doc); CHECK(doc.first_element_by_path(STR("/")) == doc); @@ -603,6 +604,8 @@ TEST_XML(dom_node_first_element_by_path, "text")); } + +TEST(write_print_empty) +{ + test_writer writer; + xml_node().print(writer); +} + +#ifndef PUGIXML_NO_STL +TEST(write_print_stream_empty) +{ + std::ostringstream oss; + xml_node().print(oss); +} + +TEST(write_print_stream_empty_wide) +{ + std::basic_ostringstream oss; + xml_node().print(oss); +} +#endif diff --git a/tests/test_xpath.cpp b/tests/test_xpath.cpp index fe0a25f..29e7244 100644 --- a/tests/test_xpath.cpp +++ b/tests/test_xpath.cpp @@ -267,4 +267,9 @@ TEST(xpath_miscellaneous) CHECK_XPATH_NODESET(xml_node(), STR("foo/@FOO/@bar")); } +TEST(xpath_document_order) +{ + CHECK(xml_attribute().document_order() == 0); + CHECK(xml_node().document_order() == 0); +} #endif diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp index f7fc868..bf35b62 100644 --- a/tests/test_xpath_api.cpp +++ b/tests/test_xpath_api.cpp @@ -146,5 +146,4 @@ TEST(xpath_api_return_type) CHECK(xpath_query(STR("'s'")).return_type() == xpath_type_string); CHECK(xpath_query(STR("true()")).return_type() == xpath_type_boolean); } - #endif -- cgit v1.2.3