summaryrefslogtreecommitdiff
path: root/tests/test_dom_traverse.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-29 07:17:30 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-29 07:17:30 +0000
commitfc602fd37554f5e2d58fcee71a58e380d23d22d4 (patch)
tree2955c7999c2053c06a81c21a79fd55670bb6940e /tests/test_dom_traverse.cpp
parent0640f87859a5a676b41783be4741a62f4d1ea266 (diff)
tests: Supported all pugixml compilation modes
git-svn-id: http://pugixml.googlecode.com/svn/trunk@191 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_dom_traverse.cpp')
-rw-r--r--tests/test_dom_traverse.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index ab3ed35..eef3e83 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -8,11 +8,20 @@
#pragma warning(disable: 4996)
#endif
+#ifdef PUGIXML_NO_STL
+template <typename I> static I move_iter(I base, int n)
+{
+ if (n > 0) while (n--) ++base;
+ else while (n++) --base;
+ return base;
+}
+#else
template <typename I> static I move_iter(I base, int n)
{
std::advance(base, n);
return base;
}
+#endif
template <typename T> static void generic_bool_ops_test(const T& obj)
{
@@ -566,6 +575,7 @@ TEST_XML(dom_node_find_node, "<node><child1/><child2/></node>")
CHECK(doc.find_node(find_predicate_prefix("child3")) == xml_node());
}
+#ifndef PUGIXML_NO_STL
TEST_XML(dom_node_path, "<node><child1>text<child2/></child1></node>")
{
CHECK(xml_node().path() == "");
@@ -578,6 +588,7 @@ TEST_XML(dom_node_path, "<node><child1>text<child2/></child1></node>")
CHECK(doc.child("node").child("child1").path('\\') == "\\node\\child1");
}
+#endif
TEST_XML(dom_node_first_element_by_path, "<node><child1>text<child2/></child1></node>")
{
@@ -591,7 +602,10 @@ TEST_XML(dom_node_first_element_by_path, "<node><child1>text<child2/></child1></
CHECK(doc.first_element_by_path("node") == doc.child("node"));
CHECK(doc.first_element_by_path("/node") == doc.child("node"));
+#ifndef PUGIXML_NO_STL
CHECK(doc.first_element_by_path("/node/child1/child2").path() == "/node/child1/child2");
+#endif
+
CHECK(doc.first_element_by_path("/node/child2") == xml_node());
CHECK(doc.first_element_by_path("\\node\\child1", '\\') == doc.child("node").child("child1"));