summaryrefslogtreecommitdiff
path: root/tests/test_xpath_parse.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:14:48 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:14:48 +0000
commit7aadde422950e7787ed13c56f3ca1c6504cb3634 (patch)
tree8fe67931477694cc72af35cdcddb0304749ced44 /tests/test_xpath_parse.cpp
parent6b4a375ec3ff855b202dd2746d5a78212fdb1978 (diff)
tests: Added XPath out of memory parse test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@648 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_xpath_parse.cpp')
-rw-r--r--tests/test_xpath_parse.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_xpath_parse.cpp b/tests/test_xpath_parse.cpp
index 8c08ef9..b8e46d9 100644
--- a/tests/test_xpath_parse.cpp
+++ b/tests/test_xpath_parse.cpp
@@ -269,4 +269,15 @@ TEST_XML(xpath_parse_absolute, "<div><s/></div>")
CHECK_XPATH_NODESET(doc, STR("/*[/]")) % 2;
}
+TEST(xpath_parse_out_of_memory)
+{
+ test_runner::_memory_fail_threshold = 1;
+
+ CHECK_XPATH_FAIL(STR("1"));
+
+ test_runner::_memory_fail_threshold = 8192;
+
+ CHECK_XPATH_FAIL(STR("1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1"));
+}
+
#endif