[clang-tools-extra] r360026 - [clangd] Qualify uses of ::testing everywhere. NFC

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon May 6 03:08:48 PDT 2019


Author: ibiryukov
Date: Mon May  6 03:08:47 2019
New Revision: 360026

URL: http://llvm.org/viewvc/llvm-project?rev=360026&view=rev
Log:
[clangd] Qualify uses of ::testing everywhere. NFC

Add an initial '::' qualifier to all usages of 'testing' namespace that
did not have one.

The goal is to make our code style in tests more consistent.

Modified:
    clang-tools-extra/trunk/clangd/unittests/BackgroundIndexTests.cpp
    clang-tools-extra/trunk/clangd/unittests/ClangdUnitTests.cpp
    clang-tools-extra/trunk/clangd/unittests/DexTests.cpp
    clang-tools-extra/trunk/clangd/unittests/DiagnosticsTests.cpp
    clang-tools-extra/trunk/clangd/unittests/FileIndexTests.cpp
    clang-tools-extra/trunk/clangd/unittests/FindSymbolsTests.cpp
    clang-tools-extra/trunk/clangd/unittests/FuzzyMatchTests.cpp
    clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp
    clang-tools-extra/trunk/clangd/unittests/IndexTests.cpp
    clang-tools-extra/trunk/clangd/unittests/PrintASTTests.cpp
    clang-tools-extra/trunk/clangd/unittests/SerializationTests.cpp
    clang-tools-extra/trunk/clangd/unittests/SymbolCollectorTests.cpp
    clang-tools-extra/trunk/clangd/unittests/SymbolInfoTests.cpp
    clang-tools-extra/trunk/clangd/unittests/TypeHierarchyTests.cpp
    clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp

Modified: clang-tools-extra/trunk/clangd/unittests/BackgroundIndexTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/BackgroundIndexTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/BackgroundIndexTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/BackgroundIndexTests.cpp Mon May  6 03:08:47 2019
@@ -7,12 +7,12 @@
 #include "gtest/gtest.h"
 #include <thread>
 
-using testing::_;
-using testing::AllOf;
-using testing::Contains;
-using testing::ElementsAre;
-using testing::Not;
-using testing::UnorderedElementsAre;
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::Contains;
+using ::testing::ElementsAre;
+using ::testing::Not;
+using ::testing::UnorderedElementsAre;
 
 namespace clang {
 namespace clangd {
@@ -23,9 +23,9 @@ MATCHER(Declared, "") {
 }
 MATCHER(Defined, "") { return !StringRef(arg.Definition.FileURI).empty(); }
 MATCHER_P(FileURI, F, "") { return StringRef(arg.Location.FileURI) == F; }
-testing::Matcher<const RefSlab &>
-RefsAre(std::vector<testing::Matcher<Ref>> Matchers) {
-  return ElementsAre(testing::Pair(_, UnorderedElementsAreArray(Matchers)));
+::testing::Matcher<const RefSlab &>
+RefsAre(std::vector<::testing::Matcher<Ref>> Matchers) {
+  return ElementsAre(::testing::Pair(_, UnorderedElementsAreArray(Matchers)));
 }
 // URI cannot be empty since it references keys in the IncludeGraph.
 MATCHER(EmptyIncludeNode, "") {

Modified: clang-tools-extra/trunk/clangd/unittests/ClangdUnitTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/ClangdUnitTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/ClangdUnitTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/ClangdUnitTests.cpp Mon May  6 03:08:47 2019
@@ -18,7 +18,7 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::ElementsAre;
+using ::testing::ElementsAre;
 
 TEST(ClangdUnitTest, GetBeginningOfIdentifier) {
   std::string Preamble = R"cpp(

Modified: clang-tools-extra/trunk/clangd/unittests/DexTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/DexTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/DexTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/DexTests.cpp Mon May  6 03:08:47 2019
@@ -352,16 +352,16 @@ TEST(DexIterators, Optimizations) {
 // Search token tests.
 //===----------------------------------------------------------------------===//
 
-testing::Matcher<std::vector<Token>>
+::testing::Matcher<std::vector<Token>>
 tokensAre(std::initializer_list<std::string> Strings, Token::Kind Kind) {
   std::vector<Token> Tokens;
   for (const auto &TokenData : Strings) {
     Tokens.push_back(Token(Kind, TokenData));
   }
-  return testing::UnorderedElementsAreArray(Tokens);
+  return ::testing::UnorderedElementsAreArray(Tokens);
 }
 
-testing::Matcher<std::vector<Token>>
+::testing::Matcher<std::vector<Token>>
 trigramsAre(std::initializer_list<std::string> Trigrams) {
   return tokensAre(Trigrams, Token::Kind::Trigram);
 }

Modified: clang-tools-extra/trunk/clangd/unittests/DiagnosticsTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/DiagnosticsTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/DiagnosticsTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/DiagnosticsTests.cpp Mon May  6 03:08:47 2019
@@ -27,23 +27,24 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::_;
-using testing::ElementsAre;
-using testing::Field;
-using testing::IsEmpty;
-using testing::Pair;
-using testing::UnorderedElementsAre;
+using ::testing::_;
+using ::testing::ElementsAre;
+using ::testing::Field;
+using ::testing::IsEmpty;
+using ::testing::Pair;
+using ::testing::UnorderedElementsAre;
 
-testing::Matcher<const Diag &> WithFix(testing::Matcher<Fix> FixMatcher) {
+::testing::Matcher<const Diag &> WithFix(::testing::Matcher<Fix> FixMatcher) {
   return Field(&Diag::Fixes, ElementsAre(FixMatcher));
 }
 
-testing::Matcher<const Diag &> WithFix(testing::Matcher<Fix> FixMatcher1,
-                                       testing::Matcher<Fix> FixMatcher2) {
+::testing::Matcher<const Diag &> WithFix(::testing::Matcher<Fix> FixMatcher1,
+                                         ::testing::Matcher<Fix> FixMatcher2) {
   return Field(&Diag::Fixes, UnorderedElementsAre(FixMatcher1, FixMatcher2));
 }
 
-testing::Matcher<const Diag &> WithNote(testing::Matcher<Note> NoteMatcher) {
+::testing::Matcher<const Diag &>
+WithNote(::testing::Matcher<Note> NoteMatcher) {
   return Field(&Diag::Notes, ElementsAre(NoteMatcher));
 }
 
@@ -54,7 +55,7 @@ MATCHER_P2(Diag, Range, Message,
 
 MATCHER_P3(Fix, Range, Replacement, Message,
            "Fix " + llvm::to_string(Range) + " => " +
-               testing::PrintToString(Replacement) + " = [" + Message + "]") {
+               ::testing::PrintToString(Replacement) + " = [" + Message + "]") {
   return arg.Message == Message && arg.Edits.size() == 1 &&
          arg.Edits[0].range == Range && arg.Edits[0].newText == Replacement;
 }
@@ -159,7 +160,7 @@ TEST(DiagnosticsTest, DiagnosticPreamble
 
   auto TU = TestTU::withCode(Test.code());
   EXPECT_THAT(TU.build().getDiagnostics(),
-              ElementsAre(testing::AllOf(
+              ElementsAre(::testing::AllOf(
                   Diag(Test.range(), "'not-found.h' file not found"),
                   DiagSource(Diag::Clang), DiagName("pp_file_not_found"))));
 }

Modified: clang-tools-extra/trunk/clangd/unittests/FileIndexTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/FileIndexTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/FileIndexTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/FileIndexTests.cpp Mon May  6 03:08:47 2019
@@ -23,13 +23,13 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-using testing::_;
-using testing::AllOf;
-using testing::Contains;
-using testing::ElementsAre;
-using testing::IsEmpty;
-using testing::Pair;
-using testing::UnorderedElementsAre;
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::Contains;
+using ::testing::ElementsAre;
+using ::testing::IsEmpty;
+using ::testing::Pair;
+using ::testing::UnorderedElementsAre;
 
 MATCHER_P(RefRange, Range, "") {
   return std::make_tuple(arg.Location.Start.line(), arg.Location.Start.column(),
@@ -49,9 +49,9 @@ MATCHER_P(QName, N, "") { return (arg.Sc
 namespace clang {
 namespace clangd {
 namespace {
-testing::Matcher<const RefSlab &>
-RefsAre(std::vector<testing::Matcher<Ref>> Matchers) {
-  return ElementsAre(testing::Pair(_, UnorderedElementsAreArray(Matchers)));
+::testing::Matcher<const RefSlab &>
+RefsAre(std::vector<::testing::Matcher<Ref>> Matchers) {
+  return ElementsAre(::testing::Pair(_, UnorderedElementsAreArray(Matchers)));
 }
 
 Symbol symbol(llvm::StringRef ID) {

Modified: clang-tools-extra/trunk/clangd/unittests/FindSymbolsTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/FindSymbolsTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/FindSymbolsTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/FindSymbolsTests.cpp Mon May  6 03:08:47 2019
@@ -44,7 +44,7 @@ MATCHER_P(SymRange, Range, "") { return
 // GMock helpers for matching DocumentSymbol.
 MATCHER_P(SymNameRange, Range, "") { return arg.selectionRange == Range; }
 template <class... ChildMatchers>
-testing::Matcher<DocumentSymbol> Children(ChildMatchers... ChildrenM) {
+::testing::Matcher<DocumentSymbol> Children(ChildMatchers... ChildrenM) {
   return Field(&DocumentSymbol::children, ElementsAre(ChildrenM...));
 }
 
@@ -573,7 +573,7 @@ TEST_F(DocumentSymbolsTest, Namespaces)
       )cpp");
   EXPECT_THAT(
       getSymbols(FilePath),
-      ElementsAreArray<testing::Matcher<DocumentSymbol>>(
+      ElementsAreArray<::testing::Matcher<DocumentSymbol>>(
           {AllOf(WithName("ans1"),
                  Children(AllOf(WithName("ai1"), Children()),
                           AllOf(WithName("ans2"), Children(WithName("ai2"))))),

Modified: clang-tools-extra/trunk/clangd/unittests/FuzzyMatchTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/FuzzyMatchTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/FuzzyMatchTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/FuzzyMatchTests.cpp Mon May  6 03:08:47 2019
@@ -15,7 +15,7 @@
 namespace clang {
 namespace clangd {
 namespace {
-using testing::Not;
+using ::testing::Not;
 
 struct ExpectedMatch {
   // Annotations are optional, and will not be asserted if absent.
@@ -43,7 +43,7 @@ private:
   llvm::Optional<llvm::StringRef> Annotated;
 };
 
-struct MatchesMatcher : public testing::MatcherInterface<llvm::StringRef> {
+struct MatchesMatcher : public ::testing::MatcherInterface<llvm::StringRef> {
   ExpectedMatch Candidate;
   llvm::Optional<float> Score;
   MatchesMatcher(ExpectedMatch Candidate, llvm::Optional<float> Score)
@@ -56,7 +56,7 @@ struct MatchesMatcher : public testing::
   }
 
   bool MatchAndExplain(llvm::StringRef Pattern,
-                       testing::MatchResultListener *L) const override {
+                       ::testing::MatchResultListener *L) const override {
     std::unique_ptr<llvm::raw_ostream> OS(
         L->stream()
             ? (llvm::raw_ostream *)(new llvm::raw_os_ostream(*L->stream()))
@@ -65,15 +65,15 @@ struct MatchesMatcher : public testing::
     auto Result = Matcher.match(Candidate.Word);
     auto AnnotatedMatch = Matcher.dumpLast(*OS << "\n");
     return Result && Candidate.accepts(AnnotatedMatch) &&
-           (!Score || testing::Value(*Result, testing::FloatEq(*Score)));
+           (!Score || ::testing::Value(*Result, ::testing::FloatEq(*Score)));
   }
 };
 
 // Accepts patterns that match a given word, optionally requiring a score.
 // Dumps the debug tables on match failure.
-testing::Matcher<llvm::StringRef> matches(llvm::StringRef M,
-                                          llvm::Optional<float> Score = {}) {
-  return testing::MakeMatcher<llvm::StringRef>(new MatchesMatcher(M, Score));
+::testing::Matcher<llvm::StringRef> matches(llvm::StringRef M,
+                                            llvm::Optional<float> Score = {}) {
+  return ::testing::MakeMatcher<llvm::StringRef>(new MatchesMatcher(M, Score));
 }
 
 TEST(FuzzyMatch, Matches) {
@@ -179,7 +179,7 @@ TEST(FuzzyMatch, Matches) {
   EXPECT_THAT("std", Not(matches("pthread_condattr_setpshared")));
 }
 
-struct RankMatcher : public testing::MatcherInterface<llvm::StringRef> {
+struct RankMatcher : public ::testing::MatcherInterface<llvm::StringRef> {
   std::vector<ExpectedMatch> RankedStrings;
   RankMatcher(std::initializer_list<ExpectedMatch> RankedStrings)
       : RankedStrings(RankedStrings) {}
@@ -193,7 +193,7 @@ struct RankMatcher : public testing::Mat
   }
 
   bool MatchAndExplain(llvm::StringRef Pattern,
-                       testing::MatchResultListener *L) const override {
+                       ::testing::MatchResultListener *L) const override {
     std::unique_ptr<llvm::raw_ostream> OS(
         L->stream()
             ? (llvm::raw_ostream *)(new llvm::raw_os_ostream(*L->stream()))
@@ -236,8 +236,8 @@ struct RankMatcher : public testing::Mat
 // Accepts patterns that match all the strings and rank them in the given order.
 // Dumps the debug tables on match failure.
 template <typename... T>
-testing::Matcher<llvm::StringRef> ranks(T... RankedStrings) {
-  return testing::MakeMatcher<llvm::StringRef>(
+::testing::Matcher<llvm::StringRef> ranks(T... RankedStrings) {
+  return ::testing::MakeMatcher<llvm::StringRef>(
       new RankMatcher{ExpectedMatch(RankedStrings)...});
 }
 

Modified: clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/IndexActionTests.cpp Mon May  6 03:08:47 2019
@@ -32,12 +32,12 @@ MATCHER_P(HasDigest, Digest, "") { retur
 MATCHER_P(HasName, Name, "") { return arg.Name == Name; }
 
 MATCHER(HasSameURI, "") {
-  llvm::StringRef URI = testing::get<0>(arg);
-  const std::string &Path = testing::get<1>(arg);
+  llvm::StringRef URI = ::testing::get<0>(arg);
+  const std::string &Path = ::testing::get<1>(arg);
   return toUri(Path) == URI;
 }
 
-testing::Matcher<const IncludeGraphNode &>
+::testing::Matcher<const IncludeGraphNode &>
 IncludesAre(const std::vector<std::string> &Includes) {
   return ::testing::Field(&IncludeGraphNode::DirectIncludes,
                           UnorderedPointwise(HasSameURI(), Includes));

Modified: clang-tools-extra/trunk/clangd/unittests/IndexTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/IndexTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/IndexTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/IndexTests.cpp Mon May  6 03:08:47 2019
@@ -18,14 +18,14 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-using testing::_;
-using testing::AllOf;
-using testing::AnyOf;
-using testing::ElementsAre;
-using testing::IsEmpty;
-using testing::Pair;
-using testing::Pointee;
-using testing::UnorderedElementsAre;
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::AnyOf;
+using ::testing::ElementsAre;
+using ::testing::IsEmpty;
+using ::testing::Pair;
+using ::testing::Pointee;
+using ::testing::UnorderedElementsAre;
 
 namespace clang {
 namespace clangd {

Modified: clang-tools-extra/trunk/clangd/unittests/PrintASTTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/PrintASTTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/PrintASTTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/PrintASTTests.cpp Mon May  6 03:08:47 2019
@@ -21,13 +21,13 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::ElementsAreArray;
+using ::testing::ElementsAreArray;
 
 struct Case {
   const char *AnnotatedCode;
   std::vector<const char *> Expected;
 };
-class ASTUtils : public testing::Test,
+class ASTUtils : public ::testing::Test,
                  public ::testing::WithParamInterface<Case> {};
 
 TEST_P(ASTUtils, PrintTemplateArgs) {
@@ -55,7 +55,7 @@ TEST_P(ASTUtils, PrintTemplateArgs) {
 }
 
 INSTANTIATE_TEST_CASE_P(ASTUtilsTests, ASTUtils,
-                        testing::ValuesIn(std::vector<Case>({
+                        ::testing::ValuesIn(std::vector<Case>({
                             {
                                 R"cpp(
                                   template <class X> class Bar {};

Modified: clang-tools-extra/trunk/clangd/unittests/SerializationTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/SerializationTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/SerializationTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/SerializationTests.cpp Mon May  6 03:08:47 2019
@@ -13,11 +13,11 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-using testing::_;
-using testing::AllOf;
-using testing::Pair;
-using testing::UnorderedElementsAre;
-using testing::UnorderedElementsAreArray;
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::Pair;
+using ::testing::UnorderedElementsAre;
+using ::testing::UnorderedElementsAreArray;
 
 namespace clang {
 namespace clangd {
@@ -135,7 +135,7 @@ TEST(SerializationTest, YAMLConversions)
   EXPECT_THAT(
       *ParsedYAML->Refs,
       UnorderedElementsAre(Pair(cantFail(SymbolID::fromStr("057557CEBF6E6B2D")),
-                                testing::SizeIs(1))));
+                                ::testing::SizeIs(1))));
   auto Ref1 = ParsedYAML->Refs->begin()->second.front();
   EXPECT_EQ(Ref1.Kind, RefKind::Reference);
   EXPECT_EQ(StringRef(Ref1.Location.FileURI), "file:///path/foo.cc");

Modified: clang-tools-extra/trunk/clangd/unittests/SymbolCollectorTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/SymbolCollectorTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/SymbolCollectorTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/SymbolCollectorTests.cpp Mon May  6 03:08:47 2019
@@ -32,16 +32,16 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::_;
-using testing::AllOf;
-using testing::Contains;
-using testing::Each;
-using testing::ElementsAre;
-using testing::Field;
-using testing::Not;
-using testing::Pair;
-using testing::UnorderedElementsAre;
-using testing::UnorderedElementsAreArray;
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::Contains;
+using ::testing::Each;
+using ::testing::ElementsAre;
+using ::testing::Field;
+using ::testing::Not;
+using ::testing::Pair;
+using ::testing::UnorderedElementsAre;
+using ::testing::UnorderedElementsAreArray;
 
 // GMock helpers for matching Symbol.
 MATCHER_P(Labeled, Label, "") {
@@ -96,16 +96,16 @@ MATCHER(VisibleOutsideFile, "") {
   return static_cast<bool>(arg.Flags & Symbol::VisibleOutsideFile);
 }
 MATCHER(RefRange, "") {
-  const Ref &Pos = testing::get<0>(arg);
-  const Range &Range = testing::get<1>(arg);
+  const Ref &Pos = ::testing::get<0>(arg);
+  const Range &Range = ::testing::get<1>(arg);
   return std::make_tuple(Pos.Location.Start.line(), Pos.Location.Start.column(),
                          Pos.Location.End.line(), Pos.Location.End.column()) ==
          std::make_tuple(Range.start.line, Range.start.character,
                          Range.end.line, Range.end.character);
 }
-testing::Matcher<const std::vector<Ref> &>
+::testing::Matcher<const std::vector<Ref> &>
 HaveRanges(const std::vector<Range> Ranges) {
-  return testing::UnorderedPointwise(RefRange(), Ranges);
+  return ::testing::UnorderedPointwise(RefRange(), Ranges);
 }
 
 class ShouldCollectSymbolTest : public ::testing::Test {
@@ -121,8 +121,8 @@ public:
   // build() must have been called.
   bool shouldCollect(llvm::StringRef Name, bool Qualified = true) {
     assert(AST.hasValue());
-    const NamedDecl& ND = Qualified ? findDecl(*AST, Name) 
-                                    : findUnqualifiedDecl(*AST, Name);
+    const NamedDecl &ND =
+        Qualified ? findDecl(*AST, Name) : findUnqualifiedDecl(*AST, Name);
     ASTContext& Ctx = AST->getASTContext();
     const SourceManager& SM = Ctx.getSourceManager();
     bool MainFile = SM.isWrittenInMainFile(SM.getExpansionLoc(ND.getBeginLoc()));
@@ -655,19 +655,15 @@ TEST_F(SymbolCollectorTest, References)
   )";
   CollectorOpts.CountReferences = true;
   runSymbolCollector(Header, Main);
-  EXPECT_THAT(Symbols,
-              UnorderedElementsAreArray(
-                {AllOf(QName("W"), RefCount(1)),
-                 AllOf(QName("X"), RefCount(1)),
-                 AllOf(QName("Y"), RefCount(0)),
-                 AllOf(QName("Z"), RefCount(0)), 
-                 AllOf(QName("y"), RefCount(0)),
-                 AllOf(QName("z"), RefCount(0)),
-                 AllOf(QName("x"), RefCount(0)),
-                 AllOf(QName("w"), RefCount(0)),
-                 AllOf(QName("w2"), RefCount(0)),
-                 AllOf(QName("V"), RefCount(1)),
-                 AllOf(QName("v"), RefCount(0))}));
+  EXPECT_THAT(
+      Symbols,
+      UnorderedElementsAreArray(
+          {AllOf(QName("W"), RefCount(1)), AllOf(QName("X"), RefCount(1)),
+           AllOf(QName("Y"), RefCount(0)), AllOf(QName("Z"), RefCount(0)),
+           AllOf(QName("y"), RefCount(0)), AllOf(QName("z"), RefCount(0)),
+           AllOf(QName("x"), RefCount(0)), AllOf(QName("w"), RefCount(0)),
+           AllOf(QName("w2"), RefCount(0)), AllOf(QName("V"), RefCount(1)),
+           AllOf(QName("v"), RefCount(0))}));
 }
 
 TEST_F(SymbolCollectorTest, SymbolRelativeNoFallback) {

Modified: clang-tools-extra/trunk/clangd/unittests/SymbolInfoTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/SymbolInfoTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/SymbolInfoTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/SymbolInfoTests.cpp Mon May  6 03:08:47 2019
@@ -24,7 +24,7 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::ElementsAreArray;
+using ::testing::ElementsAreArray;
 
 auto CreateExpectedSymbolDetails = [](const std::string &name,
                                       const std::string &container,

Modified: clang-tools-extra/trunk/clangd/unittests/TypeHierarchyTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/TypeHierarchyTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/TypeHierarchyTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/TypeHierarchyTests.cpp Mon May  6 03:08:47 2019
@@ -27,21 +27,21 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::AllOf;
-using testing::ElementsAre;
-using testing::Eq;
-using testing::Field;
-using testing::IsEmpty;
-using testing::Matcher;
-using testing::Pointee;
-using testing::UnorderedElementsAreArray;
+using ::testing::AllOf;
+using ::testing::ElementsAre;
+using ::testing::Eq;
+using ::testing::Field;
+using ::testing::IsEmpty;
+using ::testing::Matcher;
+using ::testing::Pointee;
+using ::testing::UnorderedElementsAreArray;
 
 // GMock helpers for matching TypeHierarchyItem.
 MATCHER_P(WithName, N, "") { return arg.name == N; }
 MATCHER_P(WithKind, Kind, "") { return arg.kind == Kind; }
 MATCHER_P(SelectionRangeIs, R, "") { return arg.selectionRange == R; }
 template <class... ParentMatchers>
-testing::Matcher<TypeHierarchyItem> Parents(ParentMatchers... ParentsM) {
+::testing::Matcher<TypeHierarchyItem> Parents(ParentMatchers... ParentsM) {
   return Field(&TypeHierarchyItem::parents, HasValue(ElementsAre(ParentsM...)));
 }
 

Modified: clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp?rev=360026&r1=360025&r2=360026&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp Mon May  6 03:08:47 2019
@@ -25,10 +25,10 @@ namespace clang {
 namespace clangd {
 namespace {
 
-using testing::ElementsAre;
-using testing::IsEmpty;
-using testing::Matcher;
-using testing::UnorderedElementsAreArray;
+using ::testing::ElementsAre;
+using ::testing::IsEmpty;
+using ::testing::Matcher;
+using ::testing::UnorderedElementsAreArray;
 
 class IgnoreDiagnostics : public DiagnosticsConsumer {
   void onDiagnosticsReady(PathRef File,
@@ -120,7 +120,7 @@ MATCHER_P3(Sym, Name, Decl, DefOrNone, "
   }
   return true;
 }
-testing::Matcher<LocatedSymbol> Sym(std::string Name, Range Decl) {
+::testing::Matcher<LocatedSymbol> Sym(std::string Name, Range Decl) {
   return Sym(Name, Decl, llvm::None);
 }
 MATCHER_P(Sym, Name, "") { return arg.Name == Name; }




More information about the cfe-commits mailing list