From: JINMEI Tatuya Date: Wed, 13 Mar 2013 07:28:22 +0000 (-0700) Subject: [2831] skip death test if run on valgrind X-Git-Tag: bind10-1.2.0beta1-release~457^2~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14023798bdf7385a96500cf8bb7d93d485def18a;p=thirdparty%2Fkea.git [2831] skip death test if run on valgrind --- diff --git a/src/lib/util/tests/memory_segment_mapped_unittest.cc b/src/lib/util/tests/memory_segment_mapped_unittest.cc index c8082ac1da..1c8740312c 100644 --- a/src/lib/util/tests/memory_segment_mapped_unittest.cc +++ b/src/lib/util/tests/memory_segment_mapped_unittest.cc @@ -13,6 +13,7 @@ // PERFORMANCE OF THIS SOFTWARE. #include +#include #include #include @@ -185,12 +186,14 @@ TEST_F(MemorySegmentMappedTest, badDeallocate) { // Deallocating at an invalid address; this would result in crash (the // behavior may not be portable enough; if so we should disable it by // default). - ptr = segment_->allocate(4); - EXPECT_NE(static_cast(0), ptr); - EXPECT_DEATH_IF_SUPPORTED({ - segment_->deallocate(static_cast(ptr) + 1, 3); - }, ""); - resetSegment(); + if (!isc::util::unittests::runningOnValgrind()) { + ptr = segment_->allocate(4); + EXPECT_NE(static_cast(0), ptr); + EXPECT_DEATH_IF_SUPPORTED({ + segment_->deallocate(static_cast(ptr) + 1, 3); + }, ""); + resetSegment(); + } // Invalid size; this implementation doesn't detect such errors. ptr = segment_->allocate(4);