diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-12 03:05:58 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-12 03:05:58 -0700 |
commit | a19da1c246f244da57197915df3ab70f24bf1502 (patch) | |
tree | 08522294870adb468c37042365095ebbae2c0177 /tests/test_xpath_api.cpp | |
parent | e90d2ac8ba44fbcf4d5702643f708f2c86bde42e (diff) | |
parent | a0d065cd22d1d43c417f6d3db88a04bf57b67ed0 (diff) |
Merge branch 'master' into compact
Diffstat (limited to 'tests/test_xpath_api.cpp')
-rw-r--r-- | tests/test_xpath_api.cpp | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp index deb3beb..df078a0 100644 --- a/tests/test_xpath_api.cpp +++ b/tests/test_xpath_api.cpp @@ -356,6 +356,7 @@ TEST(xpath_api_exception_what) CHECK(e.what()[0] != 0); } } +#endif TEST(xpath_api_node_set_ctor_out_of_memory) { @@ -363,15 +364,7 @@ TEST(xpath_api_node_set_ctor_out_of_memory) xpath_node data[2]; - try - { - xpath_node_set ns(data, data + 2); - - CHECK_FORCE_FAIL("Expected out of memory exception"); - } - catch (const std::bad_alloc&) - { - } + CHECK_ALLOC_FAIL(xpath_node_set ns(data, data + 2)); } TEST(xpath_api_node_set_copy_ctor_out_of_memory) @@ -381,15 +374,7 @@ TEST(xpath_api_node_set_copy_ctor_out_of_memory) test_runner::_memory_fail_threshold = 1; - try - { - xpath_node_set copy = ns; - - CHECK_FORCE_FAIL("Expected out of memory exception"); - } - catch (const std::bad_alloc&) - { - } + CHECK_ALLOC_FAIL(xpath_node_set copy = ns); } TEST_XML(xpath_api_node_set_assign_out_of_memory_preserve, "<node><a/><b/></node>") @@ -402,19 +387,10 @@ TEST_XML(xpath_api_node_set_assign_out_of_memory_preserve, "<node><a/><b/></node test_runner::_memory_fail_threshold = 1; - try - { - ns = nsall; - - CHECK_FORCE_FAIL("Expected out of memory exception"); - } - catch (const std::bad_alloc&) - { - } + CHECK_ALLOC_FAIL(ns = nsall); CHECK(ns.size() == 2 && ns[0] == doc.child(STR("node")).child(STR("a")) && ns[1] == doc.child(STR("node")).child(STR("b"))); } -#endif TEST_XML(xpath_api_deprecated_select_single_node, "<node><head/><foo id='1'/><foo/><tail/></node>") { |