summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-22 08:38:52 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-22 08:38:52 -0700
commit3643b505a6f95e65037c5d906e7fb81ac16698cf (patch)
tree54ea489fc1426fb326870a429f7a525e53369d28 /tests
parent4223b4a3f0d2058fcfac551055550384b650f70a (diff)
Fix node_pi memory leak
Diffstat (limited to 'tests')
-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 54bbee4..365561f 100644
--- a/tests/test_dom_modify.cpp
+++ b/tests/test_dom_modify.cpp
@@ -948,6 +948,25 @@ TEST(dom_node_memory_limit)
}
}
+TEST(dom_node_memory_limit_pi)
+{
+ 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 * 2 + sizeof(string);
+
+ xml_document doc;
+
+ for (int j = 0; j < 32; ++j)
+ {
+ CHECK(doc.append_child(node_pi).set_value(string));
+ CHECK(doc.remove_child(doc.first_child()));
+ }
+}
+
TEST(dom_node_doctype_top_level)
{
xml_document doc;