r184544 - Disable an assertion death test when using MSVC's assert()
Reid Kleckner
reid at kleckner.net
Fri Jun 21 05:58:12 PDT 2013
Author: rnk
Date: Fri Jun 21 07:58:12 2013
New Revision: 184544
URL: http://llvm.org/viewvc/llvm-project?rev=184544&view=rev
Log:
Disable an assertion death test when using MSVC's assert()
MSVC's debug runtime prints assertion failures in wide characters, which
gtest doesn't understand.
Modified:
cfe/trunk/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp
Modified: cfe/trunk/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp?rev=184544&r1=184543&r2=184544&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp Fri Jun 21 07:58:12 2013
@@ -103,7 +103,7 @@ TEST(VariantValueTest, Assignment) {
EXPECT_EQ("Nothing", Value.getTypeAsString());
}
-TEST(GeneicValueTest, Matcher) {
+TEST(GenericValueTest, Matcher) {
EXPECT_TRUE(matches("class X {};", VariantValue(recordDecl(hasName("X")))
.getTypedMatcher<Decl>()));
EXPECT_TRUE(
@@ -112,8 +112,10 @@ TEST(GeneicValueTest, Matcher) {
VariantValue(functionDecl()).getTypedMatcher<Decl>()));
// Can't get the wrong matcher.
EXPECT_FALSE(VariantValue(varDecl()).hasTypedMatcher<Stmt>());
-#if GTEST_HAS_DEATH_TEST and DEBUG
- // Trying to get the wrong matcher fails an assertion in Matcher<T>.
+#if !defined(NDEBUG) && GTEST_HAS_DEATH_TEST && !defined(_MSC_VER)
+ // Trying to get the wrong matcher fails an assertion in Matcher<T>. We don't
+ // do this test when building with MSVC because its debug C runtime prints the
+ // assertion failure message as a wide string, which gtest doesn't understand.
EXPECT_DEATH(VariantValue(varDecl()).getTypedMatcher<Stmt>(),
"canConstructFrom");
#endif
More information about the cfe-commits
mailing list