summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-06 18:51:29 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-06 18:51:29 +0000
commit8e0c64401f1b6f7b8a1ad5cc68227fc344f149dc (patch)
tree88f073e87a6d0408614e604102eb383ba71b7f29 /tests
parent382a33ce4b19ccc9b6f89268a0de17eeac63f559 (diff)
xml_node::all_elements_by_name is now deprecated
git-svn-id: http://pugixml.googlecode.com/svn/trunk@563 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/test_deprecated.cpp20
-rw-r--r--tests/test_dom_traverse.cpp20
2 files changed, 20 insertions, 20 deletions
diff --git a/tests/test_deprecated.cpp b/tests/test_deprecated.cpp
index bcf9695..d81810e 100644
--- a/tests/test_deprecated.cpp
+++ b/tests/test_deprecated.cpp
@@ -132,6 +132,26 @@ TEST_XML(dom_node_find_child_by_attribute_w, "<node><child1 attr='value1'/><chil
CHECK(node.find_child_by_attribute_w(STR("attr3"), STR("val*[0123456789]")) == xml_node());
}
+TEST_XML(dom_node_all_elements_by_name, "<node><child><child/><child/></child></node>")
+{
+ std::vector<xml_node> v;
+
+ v.clear();
+ xml_node().all_elements_by_name(STR("node"), std::back_inserter(v));
+ CHECK(v.empty());
+
+ v.clear();
+ doc.all_elements_by_name(STR("node"), std::back_inserter(v));
+ CHECK(v.size() == 1 && v[0] == doc.child(STR("node")));
+
+ v.clear();
+ doc.all_elements_by_name(STR("child"), std::back_inserter(v));
+ CHECK(v.size() == 3);
+ CHECK(v[0] == doc.child(STR("node")).child(STR("child")));
+ CHECK(v[1] == doc.child(STR("node")).child(STR("child")).first_child());
+ CHECK(v[2] == doc.child(STR("node")).child(STR("child")).last_child());
+}
+
TEST_XML(dom_node_all_elements_by_name_w, "<node><child><child/><child/></child></node>")
{
std::vector<xml_node> v;
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index 0ca554a..1a4835b 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -391,26 +391,6 @@ TEST_XML(dom_node_find_child_by_attribute, "<node><child1 attr='value1'/><child2
CHECK(node.find_child_by_attribute(STR("attr3"), STR("value")) == xml_node());
}
-TEST_XML(dom_node_all_elements_by_name, "<node><child><child/><child/></child></node>")
-{
- std::vector<xml_node> v;
-
- v.clear();
- xml_node().all_elements_by_name(STR("node"), std::back_inserter(v));
- CHECK(v.empty());
-
- v.clear();
- doc.all_elements_by_name(STR("node"), std::back_inserter(v));
- CHECK(v.size() == 1 && v[0] == doc.child(STR("node")));
-
- v.clear();
- doc.all_elements_by_name(STR("child"), std::back_inserter(v));
- CHECK(v.size() == 3);
- CHECK(v[0] == doc.child(STR("node")).child(STR("child")));
- CHECK(v[1] == doc.child(STR("node")).child(STR("child")).first_child());
- CHECK(v[2] == doc.child(STR("node")).child(STR("child")).last_child());
-}
-
struct find_predicate_const
{
bool result;