[llvm-branch-commits] [cfe-branch] r159536 - in /cfe/branches/tooling/unittests/ASTMatchers/Dynamic: ParserTest.cpp RegistryTest.cpp

Manuel Klimek klimek at google.com
Mon Jul 2 09:21:31 PDT 2012


Author: klimek
Date: Mon Jul  2 11:21:30 2012
New Revision: 159536

URL: http://llvm.org/viewvc/llvm-project?rev=159536&view=rev
Log:
Fixed dynamic matcher tests.

Modified:
    cfe/branches/tooling/unittests/ASTMatchers/Dynamic/ParserTest.cpp
    cfe/branches/tooling/unittests/ASTMatchers/Dynamic/RegistryTest.cpp

Modified: cfe/branches/tooling/unittests/ASTMatchers/Dynamic/ParserTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/ASTMatchers/Dynamic/ParserTest.cpp?rev=159536&r1=159535&r2=159536&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/ASTMatchers/Dynamic/ParserTest.cpp (original)
+++ cfe/branches/tooling/unittests/ASTMatchers/Dynamic/ParserTest.cpp Mon Jul  2 11:21:30 2012
@@ -195,17 +195,17 @@
 TEST(ParserTest, FullParserTest) {
   RealProcessor Processor;
   const GenericValue Value = Parser::parseMatcher(
-      "BinaryOperator( HasOperatorName(\"+\"),\n"
-      "               HasLHS(IntegerLiteral(Equals(1))))", &Processor);
+      "BinaryOperator( hasOperatorName(\"+\"),\n"
+      "               hasLHS(IntegerLiteral(Equals(1))))", &Processor);
   EXPECT_TRUE(matchesGeneric("int x = 1 + 1;", Value));
   EXPECT_FALSE(matchesGeneric("int x = 2 + 1;", Value));
 
   const GenericValue Error = Parser::parseMatcher(
-      "BinaryOperator( HasOperatorName(6),\n"
-      "               HasLHS(IntegerLiteral(Equals(1))))", &Processor);
+      "BinaryOperator( hasOperatorName(6),\n"
+      "               hasLHS(IntegerLiteral(Equals(1))))", &Processor);
   EXPECT_EQ("Error parsing argument 0 for matcher BinaryOperator: "
-            "Error building matcher HasOperatorName: "
-            "Incorrect type on function HasOperatorName for arg 0",
+            "Error building matcher hasOperatorName: "
+            "Incorrect type on function hasOperatorName for arg 0",
             Error.get<GenericError>().Message);
 }
 

Modified: cfe/branches/tooling/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/ASTMatchers/Dynamic/RegistryTest.cpp?rev=159536&r1=159535&r2=159536&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/ASTMatchers/Dynamic/RegistryTest.cpp (original)
+++ cfe/branches/tooling/unittests/ASTMatchers/Dynamic/RegistryTest.cpp Mon Jul  2 11:21:30 2012
@@ -59,7 +59,7 @@
 }
 
 TEST(RegistryTest, CanConstructNoArgs) {
-  const GenericValue IsArrowValue = constructMatcher("IsArrow");
+  const GenericValue IsArrowValue = constructMatcher("isArrow");
   const GenericValue BoolValue = constructMatcher("BoolLiteral");
 
   const std::string ClassSnippet =
@@ -75,19 +75,19 @@
 }
 
 TEST(RegistryTest, ConstructWithSimpleArgs) {
-  const GenericValue Value = constructMatcher("HasName", std::string("X"));
+  const GenericValue Value = constructMatcher("hasName", std::string("X"));
   EXPECT_TRUE(matchesGeneric("class X {};", Value));
   EXPECT_FALSE(matchesGeneric("int x;", Value));
 }
 
 TEST(RegistryTest, ContructWithMatcherArgs) {
   const GenericValue OperatorPlus =
-      constructMatcher("HasOperatorName", std::string("+"));
+      constructMatcher("hasOperatorName", std::string("+"));
   const GenericValue OperatorMinus =
-      constructMatcher("HasOperatorName", std::string("-"));
+      constructMatcher("hasOperatorName", std::string("-"));
   const GenericValue One =
       constructMatcher("IntegerLiteral", constructMatcher("Equals", 1));
-  const GenericValue HasLHSOne = constructMatcher("HasLHS", One);
+  const GenericValue HasLHSOne = constructMatcher("hasLHS", One);
 
   const GenericValue OnePlus =
       constructMatcher("BinaryOperator", OperatorPlus, HasLHSOne);
@@ -117,18 +117,18 @@
 
 TEST(RegistryTest, Errors) {
   // Incorrect argument count.
-  GenericValue BadArgCount = constructMatcher("HasBody");
-  EXPECT_EQ("Incorrect argument count on function HasBody. "
+  GenericValue BadArgCount = constructMatcher("hasBody");
+  EXPECT_EQ("Incorrect argument count on function hasBody. "
             "(Expected = 1) != (Actual = 0)",
             BadArgCount.get<GenericError>().Message);
-  BadArgCount = constructMatcher("IsArrow", std::string());
-  EXPECT_EQ("Incorrect argument count on function IsArrow. "
+  BadArgCount = constructMatcher("isArrow", std::string());
+  EXPECT_EQ("Incorrect argument count on function isArrow. "
             "(Expected = 0) != (Actual = 1)",
             BadArgCount.get<GenericError>().Message);
 
   // Bad argument type
-  GenericValue BadArgType = constructMatcher("OfClass", true);
-  EXPECT_EQ("Incorrect type on function OfClass for arg 0",
+  GenericValue BadArgType = constructMatcher("ofClass", true);
+  EXPECT_EQ("Incorrect type on function ofClass for arg 0",
             BadArgType.get<GenericError>().Message);
   BadArgType = constructMatcher("Class", Class(), 3);
   EXPECT_EQ("Incorrect type on function Class for arg 1",





More information about the llvm-branch-commits mailing list