summaryrefslogtreecommitdiff
path: root/tests/test.hpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-12 21:27:12 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-12 21:27:12 -0700
commit5edeaf67658a3ab27e9ace87ccff37aba8352607 (patch)
treeb49648254cc6c4de54dcacb88fcbdccd3bd1ebba /tests/test.hpp
parenta0d065cd22d1d43c417f6d3db88a04bf57b67ed0 (diff)
tests: Add more out of memory tests
Also add tests that verify save_file for absence of FILE leaks.
Diffstat (limited to 'tests/test.hpp')
-rw-r--r--tests/test.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test.hpp b/tests/test.hpp
index 46c3330..d0fd0ca 100644
--- a/tests/test.hpp
+++ b/tests/test.hpp
@@ -143,9 +143,9 @@ struct dummy_fixture {};
#endif
#ifdef PUGIXML_NO_EXCEPTIONS
-#define CHECK_ALLOC_FAIL(code) CHECK(!test_runner::_memory_fail_triggered); code; CHECK(test_runner::_memory_fail_triggered); test_runner::_memory_fail_triggered = false
+#define CHECK_ALLOC_FAIL(code) do { CHECK(!test_runner::_memory_fail_triggered); code; CHECK(test_runner::_memory_fail_triggered); test_runner::_memory_fail_triggered = false; } while (test_runner::_memory_fail_triggered)
#else
-#define CHECK_ALLOC_FAIL(code) CHECK(!test_runner::_memory_fail_triggered); try { code; } catch (std::bad_alloc&) {} CHECK(test_runner::_memory_fail_triggered); test_runner::_memory_fail_triggered = false
+#define CHECK_ALLOC_FAIL(code) do { CHECK(!test_runner::_memory_fail_triggered); try { code; } catch (std::bad_alloc&) {} CHECK(test_runner::_memory_fail_triggered); test_runner::_memory_fail_triggered = false; } while (test_runner::_memory_fail_triggered)
#endif
#define STR(text) PUGIXML_TEXT(text)