diff options
Diffstat (limited to 'vespalib/src')
-rw-r--r-- | vespalib/src/tests/alloc/alloc_test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vespalib/src/tests/alloc/alloc_test.cpp b/vespalib/src/tests/alloc/alloc_test.cpp index d46d2374dfc..8a1a842ac28 100644 --- a/vespalib/src/tests/alloc/alloc_test.cpp +++ b/vespalib/src/tests/alloc/alloc_test.cpp @@ -8,6 +8,14 @@ using namespace vespalib; using namespace vespalib::alloc; +#ifndef __SANITIZE_ADDRESS__ +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define __SANITIZE_ADDRESS__ +#endif +#endif +#endif + template <typename T> void testSwap(T & a, T & b) @@ -192,6 +200,7 @@ TEST("auto alloced mmap alloc can not be extended if no room") { TEST_DO(verifyNoExtensionWhenNoRoom(buf, reserved, SZ)); } +#ifndef __SANITIZE_ADDRESS__ TEST("mmap alloc can be extended if room") { Alloc dummy = Alloc::allocMMap(100); Alloc reserved = Alloc::allocMMap(100); @@ -209,6 +218,7 @@ TEST("mmap alloc can not be extended if no room") { TEST_DO(verifyNoExtensionWhenNoRoom(buf, reserved, 4096)); } #endif +#endif TEST("heap alloc can not be shrinked") { Alloc buf = Alloc::allocHeap(101); |