summaryrefslogtreecommitdiff
path: root/tests/main.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-21 03:33:47 +0000
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-21 03:33:47 +0000
commit7258aea09be1847b3dcc99ca389990027d4a92d3 (patch)
treed1682fdb0724cd8780df92b988a9703984bd7bda /tests/main.cpp
parent7774cdd96e01b2d89be16f7e240c1ffb2436b4c9 (diff)
tests: Assert on out-of-memory in tests
This should never happen but can improve debugging experience for work-in-progress changes since that avoids memcpy() into negative memory space (debugger can't backtrace from failed memcpy since it does not set up the stack frame). git-svn-id: https://pugixml.googlecode.com/svn/trunk@1070 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/main.cpp')
-rw-r--r--tests/main.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 3bcf9be..75b0108 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -34,6 +34,7 @@ static void* custom_allocate(size_t size)
else
{
void* ptr = memory_allocate(size);
+ assert(ptr);
g_memory_total_size += memory_size(ptr);
g_memory_total_count++;