Fix death tests in -Asserts builds.
authorJeffrey Yasskin <jyasskin@google.com>
Wed, 17 Mar 2010 01:18:45 +0000 (01:18 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Wed, 17 Mar 2010 01:18:45 +0000 (01:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98701 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ADT/APFloatTest.cpp
unittests/ADT/APIntTest.cpp
unittests/Support/LeakDetectorTest.cpp

index 571996013e36c395b3873d120bb7fe62f8ebc8ad..964b04da473c19b475417ba782bb7b9c70241ae0 100644 (file)
@@ -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
 
 }
index 0b13aa402ea18705ea9487c716fae3336202e193..d08e86abaa752ae8ce092b4be45ea6297db27fe4 100644 (file)
@@ -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
 
 }
index 85ef04676dcdca48df5c09ba7668c4a04d1d6276..d198c7a8bda0bc7fccc1fd7d454fc91558a657f8 100644 (file)
@@ -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
 
 }