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_variables.cpp | |
parent | e90d2ac8ba44fbcf4d5702643f708f2c86bde42e (diff) | |
parent | a0d065cd22d1d43c417f6d3db88a04bf57b67ed0 (diff) |
Merge branch 'master' into compact
Diffstat (limited to 'tests/test_xpath_variables.cpp')
-rw-r--r-- | tests/test_xpath_variables.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/tests/test_xpath_variables.cpp b/tests/test_xpath_variables.cpp index 53b40cf..0d33312 100644 --- a/tests/test_xpath_variables.cpp +++ b/tests/test_xpath_variables.cpp @@ -177,7 +177,8 @@ TEST(xpath_variables_set_out_of_memory) xpath_variable_set set;
- xpath_variable* var = set.add(STR("target"), xpath_type_number);
+ xpath_variable* var = 0;
+ CHECK_ALLOC_FAIL(var = set.add(STR("target"), xpath_type_number));
CHECK(!var);
}
@@ -190,7 +191,7 @@ TEST(xpath_variables_out_of_memory) xpath_variable* var = set.add(STR("target"), xpath_type_string);
CHECK(var);
- CHECK(!var->set(STR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")));
+ CHECK_ALLOC_FAIL(CHECK(!var->set(STR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))));
}
TEST_XML(xpath_variables_evaluate, "<node/>")
@@ -283,20 +284,7 @@ TEST(xpath_variables_long_name_out_of_memory) test_runner::_memory_fail_threshold = 4096 + 64 + 52 * sizeof(char_t);
-#ifdef PUGIXML_NO_EXCEPTIONS
- xpath_query q(STR("$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &set);
- CHECK(!q);
-#else
- try
- {
- xpath_query q(STR("$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &set);
-
- CHECK_FORCE_FAIL("Expected exception");
- }
- catch (const xpath_exception&)
- {
- }
-#endif
+ CHECK_ALLOC_FAIL(CHECK(!xpath_query(STR("$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &set)));
}
TEST_XML(xpath_variables_select, "<node attr='1'/><node attr='2'/>")
|