From 9ba26b94c74a03ac937a5d5972f8f12a2916f301 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 10 Feb 2014 16:56:55 +0000 Subject: 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 --- tests/main.cpp | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3