[llvm-commits] [llvm] r79218 - in /llvm/trunk/unittests/ADT: APFloatTest.cpp APIntTest.cpp
Erick Tryzelaar
idadesub at users.sourceforge.net
Sun Aug 16 17:55:34 PDT 2009
Author: erickt
Date: Sun Aug 16 19:55:33 2009
New Revision: 79218
URL: http://llvm.org/viewvc/llvm-project?rev=79218&view=rev
Log:
Wrap unit test death tests in GTEST_HAS_DEATH_TEST
Modified:
llvm/trunk/unittests/ADT/APFloatTest.cpp
llvm/trunk/unittests/ADT/APIntTest.cpp
Modified: llvm/trunk/unittests/ADT/APFloatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APFloatTest.cpp?rev=79218&r1=79217&r2=79218&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APFloatTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APFloatTest.cpp Sun Aug 16 19:55:33 2009
@@ -25,11 +25,6 @@
EXPECT_EQ(-0.0, APFloat(APFloat::IEEEdouble, -0.0).convertToDouble());
}
-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");
-}
-
TEST(APFloatTest, fromString) {
EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, "0").convertToDouble());
EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, "0.").convertToDouble());
@@ -69,6 +64,12 @@
EXPECT_EQ(0.0, APFloat(APFloat::IEEEdouble, StringRef("0e1\02", 3)).convertToDouble());
}
+#ifdef GTEST_HAS_DEATH_TEST
+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");
+}
+
TEST(APFloatTest, StringDeath) {
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, ""), "Invalid string length");
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-"), "String is only a minus!");
@@ -102,5 +103,6 @@
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "0x1p0f"), "Invalid character in exponent");
}
+#endif
}
Modified: llvm/trunk/unittests/ADT/APIntTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APIntTest.cpp?rev=79218&r1=79217&r2=79218&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APIntTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APIntTest.cpp Sun Aug 16 19:55:33 2009
@@ -172,6 +172,7 @@
EXPECT_EQ(APInt(1, 1), APInt(1, "1", 16));
}
+#ifdef GTEST_HAS_DEATH_TEST
TEST(APIntTest, StringDeath) {
EXPECT_DEATH(APInt(0, "", 0), "bitwidth too small");
EXPECT_DEATH(APInt(32, "", 0), "Radix should be 2, 8, 10, or 16!");
@@ -182,5 +183,6 @@
EXPECT_DEATH(APInt(32, StringRef("1\02", 3), 10), "Invalid character in digit string");
EXPECT_DEATH(APInt(32, "1L", 10), "Invalid character in digit string");
}
+#endif
}
More information about the llvm-commits
mailing list