Skip to content

Commit

Permalink
Compile out test_memory_leak_detection if leak detection is disabled
Browse files Browse the repository at this point in the history
(cherry picked from commit 616ad76)
  • Loading branch information
qris committed Jan 21, 2018
1 parent cabec10 commit 716a3a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/common/testcommon.cpp
Expand Up @@ -395,6 +395,7 @@ bool test_named_locks()
TEARDOWN();
}

#ifdef BOX_MEMORY_LEAK_TESTING
// Test that memory leak detection doesn't crash
bool test_memory_leak_detection()
{
Expand All @@ -407,7 +408,6 @@ bool test_memory_leak_detection()
delete s;
}

#ifdef BOX_MEMORY_LEAK_TESTING
{
Timers::Cleanup();

Expand All @@ -429,10 +429,10 @@ bool test_memory_leak_detection()

Timers::Init();
}
#endif // BOX_MEMORY_LEAK_TESTING

TEARDOWN();
}
#endif // BOX_MEMORY_LEAK_TESTING

bool test_timers()
{
Expand Down Expand Up @@ -1114,7 +1114,9 @@ int test(int argc, const char *argv[])
test_stream_large_files();
test_invisible_temp_file_stream();
test_named_locks();
#ifdef BOX_MEMORY_LEAK_TESTING
test_memory_leak_detection();
#endif
test_timers();
test_getline();
test_configuration();
Expand Down

0 comments on commit 716a3a9

Please sign in to comment.