summaryrefslogtreecommitdiff
path: root/unittests/Basic/FileManagerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Basic/FileManagerTest.cpp')
-rw-r--r--unittests/Basic/FileManagerTest.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/unittests/Basic/FileManagerTest.cpp b/unittests/Basic/FileManagerTest.cpp
index 746d9ad5e89bb..8e98f44fa46d8 100644
--- a/unittests/Basic/FileManagerTest.cpp
+++ b/unittests/Basic/FileManagerTest.cpp
@@ -222,33 +222,6 @@ TEST_F(FileManagerTest, getFileReturnsNULLForNonexistentFile) {
EXPECT_EQ(nullptr, file);
}
-// When calling getFile(OpenFile=false); getFile(OpenFile=true) the file is
-// opened for the second call.
-TEST_F(FileManagerTest, getFileDefersOpen) {
- llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> FS(
- new llvm::vfs::InMemoryFileSystem());
- FS->addFile("/tmp/test", 0, llvm::MemoryBuffer::getMemBufferCopy("test"));
- FS->addFile("/tmp/testv", 0, llvm::MemoryBuffer::getMemBufferCopy("testv"));
- FileManager manager(options, FS);
-
- const FileEntry *file = manager.getFile("/tmp/test", /*OpenFile=*/false);
- ASSERT_TRUE(file != nullptr);
- ASSERT_TRUE(file->isValid());
- // "real path name" reveals whether the file was actually opened.
- EXPECT_FALSE(file->isOpenForTests());
-
- file = manager.getFile("/tmp/test", /*OpenFile=*/true);
- ASSERT_TRUE(file != nullptr);
- ASSERT_TRUE(file->isValid());
- EXPECT_TRUE(file->isOpenForTests());
-
- // However we should never try to open a file previously opened as virtual.
- ASSERT_TRUE(manager.getVirtualFile("/tmp/testv", 5, 0));
- ASSERT_TRUE(manager.getFile("/tmp/testv", /*OpenFile=*/false));
- file = manager.getFile("/tmp/testv", /*OpenFile=*/true);
- EXPECT_FALSE(file->isOpenForTests());
-}
-
// The following tests apply to Unix-like system only.
#ifndef _WIN32