diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-10-30 14:06:15 -0400 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-10-30 14:06:55 -0400 |
commit | 940d0a310dca31ae97080b068cef92eadfee6367 (patch) | |
tree | ffab442393b5687bb381466c59375a2841d8a8c2 /clang/unittests/Basic/FileManagerTest.cpp | |
parent | 5530fb586f30da9dcb434f6be39198dbf016b866 (diff) | |
download | llvm-940d0a310dca31ae97080b068cef92eadfee6367.zip llvm-940d0a310dca31ae97080b068cef92eadfee6367.tar.gz llvm-940d0a310dca31ae97080b068cef92eadfee6367.tar.bz2 |
Revert "FileManager: Improve the FileEntryRef API and customize its OptionalStorage" and follow-ups
This reverts commit 5530fb586f30da9dcb434f6be39198dbf016b866.
This reverts commit 010238a296e61cbf6f4d7f4383e26cf00c4e4992.
This reverts commit 84e8257937ec6a332aa0b688f4dce57016516ffd.
Having trouble getting the bots compiling. Will try again later.
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
-rw-r--r-- | clang/unittests/Basic/FileManagerTest.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp index 0a1f58f3..43680d5 100644 --- a/clang/unittests/Basic/FileManagerTest.cpp +++ b/clang/unittests/Basic/FileManagerTest.cpp @@ -350,58 +350,6 @@ TEST_F(FileManagerTest, getFileReturnsSameFileEntryForAliasedVirtualFiles) { f2 ? *f2 : nullptr); } -TEST_F(FileManagerTest, getFileRefEquality) { - auto StatCache = std::make_unique<FakeStatCache>(); - StatCache->InjectDirectory("dir", 40); - StatCache->InjectFile("dir/f1.cpp", 41); - StatCache->InjectFile("dir/f1-also.cpp", 41); - StatCache->InjectFile("dir/f1-redirect.cpp", 41, "dir/f1.cpp"); - StatCache->InjectFile("dir/f2.cpp", 42); - manager.setStatCache(std::move(StatCache)); - - auto F1 = manager.getFileRef("dir/f1.cpp"); - auto F1Again = manager.getFileRef("dir/f1.cpp"); - auto F1Also = manager.getFileRef("dir/f1-also.cpp"); - auto F1Redirect = manager.getFileRef("dir/f1-redirect.cpp"); - auto F2 = manager.getFileRef("dir/f2.cpp"); - - // Check Expected<FileEntryRef> for error. - ASSERT_FALSE(!F1); - ASSERT_FALSE(!F1Also); - ASSERT_FALSE(!F1Again); - ASSERT_FALSE(!F1Redirect); - ASSERT_FALSE(!F2); - - // Check names. - EXPECT_EQ("dir/f1.cpp", F1->getName()); - EXPECT_EQ("dir/f1.cpp", F1Again->getName()); - EXPECT_EQ("dir/f1-also.cpp", F1Also->getName()); - EXPECT_EQ("dir/f1.cpp", F1Redirect->getName()); - EXPECT_EQ("dir/f2.cpp", F2->getName()); - - // Compare against FileEntry*. - EXPECT_EQ(&F1->getFileEntry(), *F1); - EXPECT_EQ(*F1, &F1->getFileEntry()); - EXPECT_NE(&F2->getFileEntry(), *F1); - EXPECT_NE(*F1, &F2->getFileEntry()); - - // Compare using ==. - EXPECT_EQ(*F1, *F1Also); - EXPECT_EQ(*F1, *F1Again); - EXPECT_EQ(*F1, *F1Redirect); - EXPECT_EQ(*F1Also, *F1Redirect); - EXPECT_NE(*F2, *F1); - EXPECT_NE(*F2, *F1Also); - EXPECT_NE(*F2, *F1Again); - EXPECT_NE(*F2, *F1Redirect); - - // Compare using isSameRef. - EXPECT_TRUE(F1->isSameRef(*F1Again)); - EXPECT_TRUE(F1->isSameRef(*F1Redirect)); - EXPECT_FALSE(F1->isSameRef(*F1Also)); - EXPECT_FALSE(F1->isSameRef(*F2)); -} - // getFile() Should return the same entry as getVirtualFile if the file actually // is a virtual file, even if the name is not exactly the same (but is after // normalisation done by the file system, like on Windows). This can be checked |