From 59409f70ef52036cecced28d3e7d95f52de9a26a Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 2 Oct 2014 16:19:55 +0000 Subject: tests: Add a test for out-of-memory during copy git-svn-id: https://pugixml.googlecode.com/svn/trunk@1040 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_dom_modify.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index cf202e0..2c53914 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -1344,3 +1344,12 @@ TEST_XML(dom_node_copyless_taint, "") CHECK_NODE(doc, STR("")); } + +TEST_XML(dom_node_copy_out_of_memory, "text1text2") +{ + test_runner::_memory_fail_threshold = 32768 * 2 + 4096; + + xml_document copy; + for (int i = 0; i < 100; ++i) + copy.append_copy(doc.first_child()); +} -- cgit v1.2.3