summaryrefslogtreecommitdiff
path: root/tests/test_xpath_variables.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-02-08 00:09:32 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-02-08 00:09:32 -0800
commit1688f44185c1d2c81afa6541d25e8bd7c35ce81b (patch)
treeda4f6deeb30a949f9494bc3a46b37a1f3efdf001 /tests/test_xpath_variables.cpp
parent0991c1d2835a6939d8213352e1c5cb0befd1b054 (diff)
tests: Add more XPath out of memory tests
Diffstat (limited to 'tests/test_xpath_variables.cpp')
-rw-r--r--tests/test_xpath_variables.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_xpath_variables.cpp b/tests/test_xpath_variables.cpp
index 2033a8e..c64e0e6 100644
--- a/tests/test_xpath_variables.cpp
+++ b/tests/test_xpath_variables.cpp
@@ -474,6 +474,18 @@ TEST_XML(xpath_variables_copy_out_of_memory, "<node1 /><node2 />")
CHECK(set2.get(STR("d"))->get_node_set().size() == 2);
}
+TEST(xpath_variables_copy_out_of_memory_clone)
+{
+ xpath_variable_set set1;
+ set1.set(STR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"), true);
+
+ xpath_variable_set set2 = set1;
+
+ test_runner::_memory_fail_threshold = 60;
+
+ CHECK_ALLOC_FAIL(xpath_variable_set set3 = set1);
+}
+
#ifdef PUGIXML_HAS_MOVE
TEST_XML(xpath_variables_move, "<node />")
{