summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-03-17 01:18:45 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-03-17 01:18:45 +0000
commitb5f59f5cf07babed5b4ba872815238e29386b0c5 (patch)
tree680325b87e6e74fb4ad37a121b4afd8a9bff4b7d /unittests
parenta1bdfc3c7fcd7bf8e42c6e4805bfb694230c7a55 (diff)
downloadllvm-b5f59f5cf07babed5b4ba872815238e29386b0c5.tar.gz
llvm-b5f59f5cf07babed5b4ba872815238e29386b0c5.tar.bz2
llvm-b5f59f5cf07babed5b4ba872815238e29386b0c5.tar.xz
Fix death tests in -Asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/APFloatTest.cpp2
-rw-r--r--unittests/ADT/APIntTest.cpp2
-rw-r--r--unittests/Support/LeakDetectorTest.cpp2
3 files changed, 6 insertions, 0 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp
index 571996013e..964b04da47 100644
--- a/unittests/ADT/APFloatTest.cpp
+++ b/unittests/ADT/APFloatTest.cpp
@@ -374,6 +374,7 @@ TEST(APFloatTest, makeNaN) {
}
#ifdef GTEST_HAS_DEATH_TEST
+#ifndef NDEBUG
TEST(APFloatTest, SemanticsDeath) {
EXPECT_DEATH(APFloat(APFloat::IEEEsingle, 0.0f).convertToDouble(), "Float semantics are not IEEEdouble");
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, 0.0 ).convertToFloat(), "Float semantics are not IEEEsingle");
@@ -573,5 +574,6 @@ TEST(APFloatTest, StringHexadecimalExponentDeath) {
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p-"), "Exponent has no digits");
}
#endif
+#endif
}
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp
index 0b13aa402e..d08e86abaa 100644
--- a/unittests/ADT/APIntTest.cpp
+++ b/unittests/ADT/APIntTest.cpp
@@ -328,6 +328,7 @@ TEST(APIntTest, Log2) {
}
#ifdef GTEST_HAS_DEATH_TEST
+#ifndef NDEBUG
TEST(APIntTest, StringDeath) {
EXPECT_DEATH(APInt(0, "", 0), "Bitwidth too small");
EXPECT_DEATH(APInt(32, "", 0), "Invalid string length");
@@ -340,5 +341,6 @@ TEST(APIntTest, StringDeath) {
EXPECT_DEATH(APInt(32, "1L", 10), "Invalid character in digit string");
}
#endif
+#endif
}
diff --git a/unittests/Support/LeakDetectorTest.cpp b/unittests/Support/LeakDetectorTest.cpp
index 85ef04676d..d198c7a8bd 100644
--- a/unittests/Support/LeakDetectorTest.cpp
+++ b/unittests/Support/LeakDetectorTest.cpp
@@ -15,6 +15,7 @@ using namespace llvm;
namespace {
#ifdef GTEST_HAS_DEATH_TEST
+#ifndef NDEBUG
TEST(LeakDetector, Death1) {
LeakDetector::addGarbageObject((void*) 1);
LeakDetector::addGarbageObject((void*) 2);
@@ -25,5 +26,6 @@ TEST(LeakDetector, Death1) {
"Cache != o && \"Object already in set!\"");
}
#endif
+#endif
}