From 7aadde422950e7787ed13c56f3ca1c6504cb3634 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 29 Aug 2010 15:14:48 +0000 Subject: tests: Added XPath out of memory parse test git-svn-id: http://pugixml.googlecode.com/svn/trunk@648 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_xpath_parse.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') 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, "
") 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 -- cgit v1.2.3