r354136 - Exteded test of .

Roman Lebedev via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 15 06:53:31 PST 2019


On Fri, Feb 15, 2019 at 5:42 PM Yitzhak Mandelbaum via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
> Author: ymandel
> Date: Fri Feb 15 06:43:10 2019
> New Revision: 354136
>
> URL: http://llvm.org/viewvc/llvm-project?rev=354136&view=rev
> Log:
> Exteded test of .
Were last few commits were meant to be committed?
Regardless, the commit messages could use at lot more work.

> Modified:
>     cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
>
> Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp?rev=354136&r1=354135&r2=354136&view=diff
> ==============================================================================
> --- cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp (original)
> +++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp Fri Feb 15 06:43:10 2019
> @@ -540,23 +540,27 @@ TEST(MatcherCXXMemberCallExpr, OnImplici
>  }
>
>  TEST(Matcher, HasObjectExpr) {
> -  auto M = memberExpr(hasObjectExpression(hasType(cxxRecordDecl(hasName("X")))));
> -  EXPECT_TRUE(matches(
> -      R"cc(
> +  auto Snippet1 = R"cc(
>          struct X {
>            int m;
>            int f(X x) { return x.m; }
>          };
> -      )cc",
> -      M));
> -  EXPECT_TRUE(notMatches(
> -      R"cc(
> +      )cc";
> +  auto Snippet2 = R"cc(
>          struct X {
>            int m;
>            int f(X x) { return m; }
>          };
> -      )cc",
> -      M));
> +      )cc";
> +  auto MatchesX =
> +      memberExpr(hasObjectExpression(hasType(cxxRecordDecl(hasName("X")))));
> +  EXPECT_TRUE(matches(Snippet1, MatchesX));
> +  EXPECT_TRUE(notMatches(Snippet2, MatchesX));
> +
> +  auto MatchesXPointer = memberExpr(
> +      hasObjectExpression(hasType(pointsTo(cxxRecordDecl(hasName("X"))))));
> +  EXPECT_TRUE(notMatches(Snippet1, MatchesXPointer));
> +  EXPECT_TRUE(matches(Snippet2, MatchesXPointer));
>  }
>
>  TEST(ForEachArgumentWithParam, ReportsNoFalsePositives) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list