diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-12 13:30:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-12 13:30:38 +0000 |
commit | 4ad1c43edd7108f7d8578f994e76be045987bae2 (patch) | |
tree | 15743dfa2db8b50712544e4d3851e499ec050039 /clang/unittests/Basic/VirtualFileSystemTest.cpp | |
parent | 939724cd020b6172435a207e0e4d59dcab90048b (diff) | |
download | bcm5719-llvm-4ad1c43edd7108f7d8578f994e76be045987bae2.tar.gz bcm5719-llvm-4ad1c43edd7108f7d8578f994e76be045987bae2.zip |
[VFS] Don't try to be heroic with '.' in paths.
Actually the only special path we have to handle is ./foo, the rest is
tricky to get right so do the same thing as the existing YAML vfs here.
llvm-svn: 250036
Diffstat (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp')
-rw-r--r-- | clang/unittests/Basic/VirtualFileSystemTest.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp index 6ed811f22f3..16c2096c991 100644 --- a/clang/unittests/Basic/VirtualFileSystemTest.cpp +++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp @@ -551,8 +551,6 @@ TEST_F(InMemoryFileSystemTest, OverlayFile) { FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a")); auto Stat = FS.status("/"); ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString(); - Stat = FS.status("/."); - ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString(); Stat = FS.status("/a"); ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString(); ASSERT_EQ("/a", Stat->getName()); @@ -568,18 +566,18 @@ TEST_F(InMemoryFileSystemTest, OverlayFileNoOwn) { TEST_F(InMemoryFileSystemTest, OpenFileForRead) { FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a")); - FS.addFile("././c", 0, MemoryBuffer::getMemBuffer("c")); + FS.addFile("./c", 0, MemoryBuffer::getMemBuffer("c")); auto File = FS.openFileForRead("/a"); ASSERT_EQ("a", (*(*File)->getBuffer("ignored"))->getBuffer()); File = FS.openFileForRead("/a"); // Open again. ASSERT_EQ("a", (*(*File)->getBuffer("ignored"))->getBuffer()); - File = FS.openFileForRead("/././a"); // Open again. + File = FS.openFileForRead("./a"); // Open again. ASSERT_EQ("a", (*(*File)->getBuffer("ignored"))->getBuffer()); File = FS.openFileForRead("/"); ASSERT_EQ(File.getError(), errc::invalid_argument) << FS.toString(); File = FS.openFileForRead("/b"); ASSERT_EQ(File.getError(), errc::no_such_file_or_directory) << FS.toString(); - File = FS.openFileForRead("./c"); + File = FS.openFileForRead("c"); ASSERT_EQ("c", (*(*File)->getBuffer("ignored"))->getBuffer()); } |