mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-27 13:33:17 +08:00
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
This commit is contained in:
parent
9d9fd0a71f
commit
9ba26b94c7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user