summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-02-10 16:56:55 +0000
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-02-10 16:56:55 +0000
commit9ba26b94c74a03ac937a5d5972f8f12a2916f301 (patch)
tree70812fdb6d0cc9e8fe70d962713ab2c81e8adef1
parent9d9fd0a71f0a6655c10b3671395cb172bb8041ac (diff)
Replace memory-management functions before every test.
In case a test sets memory-management functions to perform custom testing and fails midway, all subsequent tests that rely on custom memory handling (i.e. threshold) can fail unexpectedly. Setting up the functions before every test fixes this, making all tests self-contained. git-svn-id: https://pugixml.googlecode.com/svn/trunk@976 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--tests/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 6641e8d..95e1243 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -81,6 +81,8 @@ static bool run_test(test_runner* test)
g_memory_total_count = 0;
test_runner::_memory_fail_threshold = 0;
+ pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
+
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4611) // interaction between _setjmp and C++ object destruction is non-portable