r176181 - Make the negative test of recordType depend on a specific record.

Manuel Klimek klimek at google.com
Wed Feb 27 03:56:58 PST 2013


Author: klimek
Date: Wed Feb 27 05:56:58 2013
New Revision: 176181

URL: http://llvm.org/viewvc/llvm-project?rev=176181&view=rev
Log:
Make the negative test of recordType depend on a specific record.

Otherwise it'll break if there's a record type in the AST by default.

Modified:
    cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp

Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp?rev=176181&r1=176180&r2=176181&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp Wed Feb 27 05:56:58 2013
@@ -3436,8 +3436,10 @@ TEST(TypeMatching, MatchesTemplateSpecia
 
 TEST(TypeMatching, MatchesRecordType) {
   EXPECT_TRUE(matches("class C{}; C c;", recordType()));
-  EXPECT_TRUE(matches("struct S{}; S s;", recordType()));
-  EXPECT_TRUE(notMatches("int i;", recordType()));
+  EXPECT_TRUE(matches("struct S{}; S s;",
+                      recordType(hasDeclaration(recordDecl(hasName("S"))))));
+  EXPECT_TRUE(notMatches("int i;",
+                         recordType(hasDeclaration(recordDecl(hasName("S"))))));
 }
 
 TEST(TypeMatching, MatchesElaboratedType) {





More information about the cfe-commits mailing list