Author: Kirill Bobyrev Date: 2021-09-28T08:13:01+02:00 New Revision: e50771181b7e0d96b30ee33049dc05172125b927
URL: https://github.com/llvm/llvm-project/commit/e50771181b7e0d96b30ee33049dc05172125b927 DIFF: https://github.com/llvm/llvm-project/commit/e50771181b7e0d96b30ee33049dc05172125b927.diff LOG: Attempt to fix Windows builds after D110386 http://45.33.8.238/win/46013/summary.html Added: Modified: clang-tools-extra/clangd/unittests/HeadersTests.cpp clang-tools-extra/clangd/unittests/ParsedASTTests.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/unittests/HeadersTests.cpp b/clang-tools-extra/clangd/unittests/HeadersTests.cpp index aeca6d8fa0196..8a6f5e8b4619e 100644 --- a/clang-tools-extra/clangd/unittests/HeadersTests.cpp +++ b/clang-tools-extra/clangd/unittests/HeadersTests.cpp @@ -163,10 +163,9 @@ TEST_F(HeadersTest, CollectRewrittenAndResolved) { EXPECT_THAT(Includes.MainFileIncludes, UnorderedElementsAre( AllOf(Written("\"sub/bar.h\""), Resolved(BarHeader)))); - EXPECT_THAT(collectIncludes().includeDepth(getID(MainFile, Includes)), - UnorderedElementsAre( - Distance(getID(MainFile, Includes), 0u), - Distance(getID(testPath("sub/bar.h"), Includes), 1u))); + EXPECT_THAT(Includes.includeDepth(getID(MainFile, Includes)), + UnorderedElementsAre(Distance(getID(MainFile, Includes), 0u), + Distance(getID(BarHeader, Includes), 1u))); } TEST_F(HeadersTest, OnlyCollectInclusionsInMain) { @@ -180,20 +179,17 @@ TEST_F(HeadersTest, OnlyCollectInclusionsInMain) { #include "bar.h" )cpp"; auto Includes = collectIncludes(); - EXPECT_THAT( - collectIncludes().MainFileIncludes, - UnorderedElementsAre(AllOf(Written("\"bar.h\""), Resolved(BarHeader)))); - EXPECT_THAT(Includes.includeDepth(getID(MainFile, Includes)), + EXPECT_THAT(Includes.MainFileIncludes, UnorderedElementsAre( - Distance(getID(MainFile, Includes), 0u), - Distance(getID(testPath("sub/bar.h"), Includes), 1u), - Distance(getID(testPath("sub/baz.h"), Includes), 2u))); + AllOf(Written("\"bar.h\""), Resolved(BarHeader)))); + EXPECT_THAT(Includes.includeDepth(getID(MainFile, Includes)), + UnorderedElementsAre(Distance(getID(MainFile, Includes), 0u), + Distance(getID(BarHeader, Includes), 1u), + Distance(getID(BazHeader, Includes), 2u))); // includeDepth() also works for non-main files. - EXPECT_THAT( - collectIncludes().includeDepth(getID(testPath("sub/bar.h"), Includes)), - UnorderedElementsAre( - Distance(getID(testPath("sub/bar.h"), Includes), 0u), - Distance(getID(testPath("sub/baz.h"), Includes), 1u))); + EXPECT_THAT(Includes.includeDepth(getID(BarHeader, Includes)), + UnorderedElementsAre(Distance(getID(BarHeader, Includes), 0u), + Distance(getID(BazHeader, Includes), 1u))); } TEST_F(HeadersTest, PreambleIncludesPresentOnce) { diff --git a/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp b/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp index ab45c68c9e569..9195865294f19 100644 --- a/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp +++ b/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp @@ -519,7 +519,7 @@ TEST(ParsedASTTest, PatchesAdditionalIncludes) { auto AuxFE = FM.getFile(testPath("sub/aux.h")); ASSERT_TRUE(AuxFE); auto AuxID = Includes.getID(*AuxFE); - EXPECT_THAT(Includes.IncludeChildren[*MainID], Contains(AuxID)); + EXPECT_THAT(Includes.IncludeChildren[*MainID], Contains(*AuxID)); } TEST(ParsedASTTest, PatchesDeletedIncludes) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits