summaryrefslogtreecommitdiff
path: root/tests/test_xpath_api.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-02-05 21:34:54 -0800
committerGitHub <noreply@github.com>2017-02-05 21:34:54 -0800
commita9fe2bb62e0976ab74fdb5266cc3725250eca075 (patch)
tree85c96e92afb2e3437b0eb20c805227b91e5e69f2 /tests/test_xpath_api.cpp
parentd3b9e4e1e85d0aca562d0e6b62533e68e5a4a749 (diff)
parent10676b6b8548ddbf9458993062e6a27c2c233d48 (diff)
Merge pull request #131 from zeux/xpath-noeh
XPath: Remove exceptional control flow
Diffstat (limited to 'tests/test_xpath_api.cpp')
-rw-r--r--tests/test_xpath_api.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp
index c1a4968..3f05e13 100644
--- a/tests/test_xpath_api.cpp
+++ b/tests/test_xpath_api.cpp
@@ -107,6 +107,7 @@ TEST_XML(xpath_api_nodeset_accessors, "<node><foo/><foo/></node>")
TEST_XML(xpath_api_nodeset_copy, "<node><foo/><foo/></node>")
{
+ xpath_node_set empty;
xpath_node_set set = doc.select_nodes(STR("node/foo"));
xpath_node_set copy1 = set;
@@ -132,7 +133,7 @@ TEST_XML(xpath_api_nodeset_copy, "<node><foo/><foo/></node>")
xpath_node_set copy5;
copy5 = set;
- copy5 = xpath_node_set();
+ copy5 = empty;
CHECK(copy5.size() == 0);
}
@@ -572,6 +573,18 @@ TEST(xpath_api_nodeset_move_assign_empty)
CHECK(move.type() == xpath_node_set::type_sorted);
}
+TEST_XML(xpath_api_nodeset_move_assign_self, "<node><foo/><foo/><bar/></node>")
+{
+ xpath_node_set set = doc.select_nodes(STR("node/bar"));
+
+ CHECK(set.size() == 1);
+ CHECK(set.type() == xpath_node_set::type_sorted);
+
+ test_runner::_memory_fail_threshold = 1;
+
+ set = std::move(*&set);
+}
+
TEST(xpath_api_query_move)
{
xml_node c;