summaryrefslogtreecommitdiff
path: root/tests/test_dom_modify.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-04 13:07:35 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-04 13:07:35 +0000
commit6df3609007d59dfa5f6cc218902da49ff258befc (patch)
tree37dcabafa260e3bb3481e8bb957fc6ff1b681b28 /tests/test_dom_modify.cpp
parent05c651d87f95268823f4f0ed5a9206b5cd734507 (diff)
tests: Added even more tests for better code coverage
git-svn-id: http://pugixml.googlecode.com/svn/trunk@627 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_dom_modify.cpp')
-rw-r--r--tests/test_dom_modify.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp
index c14d8eb..e29cbb9 100644
--- a/tests/test_dom_modify.cpp
+++ b/tests/test_dom_modify.cpp
@@ -658,3 +658,22 @@ TEST(dom_node_out_of_memory)
CHECK(!n.insert_copy_after(a, a));
CHECK(!n.insert_copy_before(a, a));
}
+
+TEST(dom_node_memory_limit)
+{
+ const unsigned int length = 65536;
+ static char_t string[length + 1];
+
+ for (unsigned int i = 0; i < length; ++i) string[i] = 'a';
+ string[length] = 0;
+
+ test_runner::_memory_fail_threshold = 32768 * 4;
+
+ xml_document doc;
+
+ for (int i = 0; i < 32; ++i)
+ {
+ CHECK(doc.append_child().set_name(string));
+ CHECK(doc.remove_child(doc.first_child()));
+ }
+}