summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-06-29 13:59:18 +0200
committerTor Egge <Tor.Egge@broadpark.no>2020-06-29 13:59:18 +0200
commitc233afaff7b238b9f19af77b58151b30ad71d4c2 (patch)
tree7d43639f946b57a6c1e06e4351c4a634b79602d6 /vespalib
parenta58193603b25fbf75fac825aa44e789cb711e70c (diff)
Partially disable alloc test when using address sanitizer.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/tests/alloc/alloc_test.cpp10
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);