From: Reid Kleckner Date: Fri, 21 Jun 2013 12:58:12 +0000 (+0000) Subject: Disable an assertion death test when using MSVC's assert() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8711da1b6ba7d2bb94fa579f7d58b4d3e45825ac;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184544 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp b/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp index 8206d00b81..c9416728e6 100644 --- a/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp +++ b/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp @@ -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())); EXPECT_TRUE( @@ -112,8 +112,10 @@ TEST(GeneicValueTest, Matcher) { VariantValue(functionDecl()).getTypedMatcher())); // Can't get the wrong matcher. EXPECT_FALSE(VariantValue(varDecl()).hasTypedMatcher()); -#if GTEST_HAS_DEATH_TEST and DEBUG - // Trying to get the wrong matcher fails an assertion in Matcher. +#if !defined(NDEBUG) && GTEST_HAS_DEATH_TEST && !defined(_MSC_VER) + // Trying to get the wrong matcher fails an assertion in Matcher. 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(), "canConstructFrom"); #endif