From 4eadece45f559825b236709ffb92037c6af5e962 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 21 Apr 2015 19:44:19 -0700 Subject: tests: Add move semantics tests Also test ranged for and copying big xpath_variable_set objects (to make sure we actually handle hash collisions properly) --- tests/test_dom_traverse.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/test_dom_traverse.cpp') diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp index 4423dbe..e4b8c44 100644 --- a/tests/test_dom_traverse.cpp +++ b/tests/test_dom_traverse.cpp @@ -1106,3 +1106,27 @@ TEST_XML(dom_unspecified_bool_coverage, "text") static_cast(qn)(0); #endif } + +#if __cplusplus >= 201103 +TEST_XML(dom_ranged_for, "354") +{ + int index = 1; + + for (xml_node n: doc.children()) + { + for (xml_attribute a: n.attributes()) + { + CHECK(a.as_int() == index); + index++; + } + + for (xml_node c: n.children(STR("test"))) + { + CHECK(c.text().as_int() == index); + index++; + } + } + + CHECK(index == 5); +} +#endif -- cgit v1.2.3