summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-02 16:19:55 +0000
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-02 16:19:55 +0000
commit59409f70ef52036cecced28d3e7d95f52de9a26a (patch)
tree84ccdd6bf6b06542e9b449b09fd497ee373f2a7f /tests
parent4d39ae9e45363b5082c308fc79bb90fa96dc3ed3 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dom_modify.cpp9
1 files changed, 9 insertions, 0 deletions
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, "<node attr=\"value\" />")
CHECK_NODE(doc, STR("<nod1 attr=\"value\" /><node attr=\"valu2\" /><node att3=\"value\" />"));
}
+
+TEST_XML(dom_node_copy_out_of_memory, "<node><child1 attr1='value1' attr2='value2' /><child2 /><child3>text1<child4 />text2</child3></node>")
+{
+ test_runner::_memory_fail_threshold = 32768 * 2 + 4096;
+
+ xml_document copy;
+ for (int i = 0; i < 100; ++i)
+ copy.append_copy(doc.first_child());
+}