summaryrefslogtreecommitdiff
path: root/tests/test_xpath_api.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-01-30 21:36:05 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-01-30 21:58:48 -0800
commit02cee98492233f4ae91f025fc38f9df8b4bc0efe (patch)
treed862fa9912ff932b4b4b52a7932d6ae1c814979b /tests/test_xpath_api.cpp
parentcac1d8ad9f602e74841acb05596396ee00994ebb (diff)
tests: Add more tests for branch coverage
gcov -b surfaced many lines with partial coverage, where branch is only ever taken or not taken, or one of the expressions in a complex conditional is always either true or false. This change adds a series of tests (mostly focusing on XPath) to reduce the number of partially covered lines.
Diffstat (limited to 'tests/test_xpath_api.cpp')
-rw-r--r--tests/test_xpath_api.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp
index 6b32b68..1e7f924 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);
}
@@ -418,13 +419,6 @@ TEST(xpath_api_empty)
CHECK(!q.evaluate_boolean(c));
}
-TEST(xpath_api_query_out_of_memory)
-{
- test_runner::_memory_fail_threshold = 1;
-
- CHECK_ALLOC_FAIL(xpath_query q(STR("node")));
-}
-
#ifdef PUGIXML_HAS_MOVE
TEST_XML(xpath_api_nodeset_move_ctor, "<node><foo/><foo/><bar/></node>")
{