From 4ad1c43edd7108f7d8578f994e76be045987bae2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 12 Oct 2015 13:30:38 +0000 Subject: [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 --- clang/unittests/Basic/VirtualFileSystemTest.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp') 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()); } -- cgit v1.2.3