From 8aa8e11ba6473ae35844930ac4319c647a8d9679 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 29 Jan 2017 21:53:40 -0800 Subject: tests: Add query out of memory test --- tests/test_xpath_api.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_xpath_api.cpp') diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp index c1a4968..6b32b68 100644 --- a/tests/test_xpath_api.cpp +++ b/tests/test_xpath_api.cpp @@ -418,6 +418,13 @@ TEST(xpath_api_empty) CHECK(!q.evaluate_boolean(c)); } +TEST(xpath_api_query_out_of_memory) +{ + test_runner::_memory_fail_threshold = 1; + + CHECK_ALLOC_FAIL(xpath_query q(STR("node"))); +} + #ifdef PUGIXML_HAS_MOVE TEST_XML(xpath_api_nodeset_move_ctor, "") { -- cgit v1.2.3