mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-27 13:33:17 +08:00
tests: Added XPath out of memory parse test
git-svn-id: http://pugixml.googlecode.com/svn/trunk@648 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
6b4a375ec3
commit
7aadde4229
@ -269,4 +269,15 @@ TEST_XML(xpath_parse_absolute, "<div><s/></div>")
|
|||||||
CHECK_XPATH_NODESET(doc, STR("/*[/]")) % 2;
|
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
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user