[llvm-commits] [llvm] r98701 - in /llvm/trunk/unittests: ADT/APFloatTest.cpp ADT/APIntTest.cpp Support/LeakDetectorTest.cpp
Jeffrey Yasskin
jyasskin at google.com
Tue Mar 16 18:18:45 PDT 2010
Author: jyasskin
Date: Tue Mar 16 20:18:45 2010
New Revision: 98701
URL: http://llvm.org/viewvc/llvm-project?rev=98701&view=rev
Log:
Fix death tests in -Asserts builds.
Modified:
llvm/trunk/unittests/ADT/APFloatTest.cpp
llvm/trunk/unittests/ADT/APIntTest.cpp
llvm/trunk/unittests/Support/LeakDetectorTest.cpp
Modified: llvm/trunk/unittests/ADT/APFloatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APFloatTest.cpp?rev=98701&r1=98700&r2=98701&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APFloatTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APFloatTest.cpp Tue Mar 16 20:18:45 2010
@@ -374,6 +374,7 @@
}
#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 @@
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p-"), "Exponent has no digits");
}
#endif
+#endif
}
Modified: llvm/trunk/unittests/ADT/APIntTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APIntTest.cpp?rev=98701&r1=98700&r2=98701&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APIntTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APIntTest.cpp Tue Mar 16 20:18:45 2010
@@ -328,6 +328,7 @@
}
#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 @@
EXPECT_DEATH(APInt(32, "1L", 10), "Invalid character in digit string");
}
#endif
+#endif
}
Modified: llvm/trunk/unittests/Support/LeakDetectorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/LeakDetectorTest.cpp?rev=98701&r1=98700&r2=98701&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/LeakDetectorTest.cpp (original)
+++ llvm/trunk/unittests/Support/LeakDetectorTest.cpp Tue Mar 16 20:18:45 2010
@@ -15,6 +15,7 @@
namespace {
#ifdef GTEST_HAS_DEATH_TEST
+#ifndef NDEBUG
TEST(LeakDetector, Death1) {
LeakDetector::addGarbageObject((void*) 1);
LeakDetector::addGarbageObject((void*) 2);
@@ -25,5 +26,6 @@
"Cache != o && \"Object already in set!\"");
}
#endif
+#endif
}
More information about the llvm-commits
mailing list