Skip to content

Commit

Permalink
Merge b961c91 into 0cabd9f
Browse files Browse the repository at this point in the history
  • Loading branch information
basvodde committed May 9, 2020
2 parents 0cabd9f + b961c91 commit c8f40b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion include/CppUTest/CppUTestConfig.h
Expand Up @@ -188,6 +188,13 @@
#if CPPUTEST_SANITIZE_ADDRESS
#define CPPUTEST_SANITIZE_ADDRESS 1
#define CPPUTEST_DO_NOT_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#if defined(__linux__) && defined(__clang__)
#if CPPUTEST_USE_MEM_LEAK_DETECTION
#warning Compiling with Address Sanitizer with clang on linux will cause duplicate symbols for operator new. Turning off memory leak detection. Compile with -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED to get rid of this warning.
#undef CPPUTEST_USE_MEM_LEAK_DETECTION
#define CPPUTEST_USE_MEM_LEAK_DETECTION 0
#endif
#endif
#else
#define CPPUTEST_SANITIZER_ADDRESS 0
#define CPPUTEST_DO_NOT_SANITIZE_ADDRESS
Expand Down Expand Up @@ -239,7 +246,7 @@
/*
* Support for "long long" type.
*
* Not supported when CPUTEST_LONG_LONG_DISABLED is set.
* Not supported when CPPUTEST_LONG_LONG_DISABLED is set.
* Can be overridden by using CPPUTEST_USE_LONG_LONG
*
* CPPUTEST_HAVE_LONG_LONG_INT is set by configure
Expand Down
4 changes: 2 additions & 2 deletions tests/CppUTest/MemoryLeakWarningTest.cpp
Expand Up @@ -266,7 +266,7 @@ TEST(MemoryLeakWarningGlobalDetectorTest, MemoryWarningPluginCanBeSetToDestroyTh
CHECK(DummyMemoryLeakDetector::wasDeleted());
}

#ifndef CPPUTEST_MEM_LEAK_DETECTION_DISABLED
#if CPPUTEST_USE_MEM_LEAK_DETECTION

TEST(MemoryLeakWarningGlobalDetectorTest, crashOnLeakWithOperatorNew)
{
Expand Down Expand Up @@ -390,7 +390,7 @@ TEST(MemoryLeakWarningGlobalDetectorTest, turnOffNewOverloadsNoThrowCausesNoAddi
#endif
}

#ifndef CPPUTEST_MEM_LEAK_DETECTION_DISABLED
#if CPPUTEST_USE_MEM_LEAK_DETECTION

static int mutexLockCount = 0;
static int mutexUnlockCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/CppUTest/MemoryOperatorOverloadTest.cpp
Expand Up @@ -20,7 +20,7 @@ TEST(BasicBehavior, CanDeleteNullPointers)
delete [] (char*) NULLPTR;
}

#ifndef CPPUTEST_MEM_LEAK_DETECTION_DISABLED
#if CPPUTEST_USE_MEM_LEAK_DETECTION

CPPUTEST_DO_NOT_SANITIZE_ADDRESS
static void deleteArrayInvalidatesMemory()
Expand Down

0 comments on commit c8f40b2

Please sign in to comment.