diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-11 07:31:29 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-11 07:31:29 +0000 |
| commit | 0df59d8c029db83a6ca7de2186fcd556c7d7ab29 (patch) | |
| tree | e21b3bd819c916b40cffe64333c3662fc0d184a8 /clang/unittests/Basic/FileManagerTest.cpp | |
| parent | cbf2e67461cee2193317dee77f819b0dc891faba (diff) | |
| download | bcm5719-llvm-0df59d8c029db83a6ca7de2186fcd556c7d7ab29.tar.gz bcm5719-llvm-0df59d8c029db83a6ca7de2186fcd556c7d7ab29.zip | |
Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
llvm-svn: 283856
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
| -rw-r--r-- | clang/unittests/Basic/FileManagerTest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp index 2c606715c21..4cf21cd8459 100644 --- a/clang/unittests/Basic/FileManagerTest.cpp +++ b/clang/unittests/Basic/FileManagerTest.cpp @@ -52,7 +52,7 @@ public: } // Implement FileSystemStatCache::getStat(). - LookupResult getStat(const char *Path, FileData &Data, bool isFile, + LookupResult getStat(StringRef Path, FileData &Data, bool isFile, std::unique_ptr<vfs::File> *F, vfs::FileSystem &FS) override { if (StatCalls.count(Path) != 0) { @@ -82,14 +82,14 @@ TEST_F(FileManagerTest, getVirtualFileSetsTheDirFieldCorrectly) { const DirectoryEntry *dir = file->getDir(); ASSERT_TRUE(dir != nullptr); - EXPECT_STREQ(".", dir->getName()); + EXPECT_EQ(".", dir->getName()); file = manager.getVirtualFile("x/y/z.cpp", 42, 0); ASSERT_TRUE(file != nullptr); dir = file->getDir(); ASSERT_TRUE(dir != nullptr); - EXPECT_STREQ("x/y", dir->getName()); + EXPECT_EQ("x/y", dir->getName()); } // Before any virtual file is added, no virtual directory exists. @@ -115,11 +115,11 @@ TEST_F(FileManagerTest, getVirtualFileCreatesDirectoryEntriesForAncestors) { const DirectoryEntry *dir = manager.getDirectory("virtual/dir"); ASSERT_TRUE(dir != nullptr); - EXPECT_STREQ("virtual/dir", dir->getName()); + EXPECT_EQ("virtual/dir", dir->getName()); dir = manager.getDirectory("virtual"); ASSERT_TRUE(dir != nullptr); - EXPECT_STREQ("virtual", dir->getName()); + EXPECT_EQ("virtual", dir->getName()); } // getFile() returns non-NULL if a real file exists at the given path. @@ -144,7 +144,7 @@ TEST_F(FileManagerTest, getFileReturnsValidFileEntryForExistingRealFile) { const DirectoryEntry *dir = file->getDir(); ASSERT_TRUE(dir != nullptr); - EXPECT_STREQ("/tmp", dir->getName()); + EXPECT_EQ("/tmp", dir->getName()); #ifdef LLVM_ON_WIN32 file = manager.getFile(FileName); @@ -152,7 +152,7 @@ TEST_F(FileManagerTest, getFileReturnsValidFileEntryForExistingRealFile) { dir = file->getDir(); ASSERT_TRUE(dir != NULL); - EXPECT_STREQ(DirName, dir->getName()); + EXPECT_EQ(DirName, dir->getName()); #endif } @@ -168,7 +168,7 @@ TEST_F(FileManagerTest, getFileReturnsValidFileEntryForExistingVirtualFile) { const DirectoryEntry *dir = file->getDir(); ASSERT_TRUE(dir != nullptr); - EXPECT_STREQ("virtual/dir", dir->getName()); + EXPECT_EQ("virtual/dir", dir->getName()); } // getFile() returns different FileEntries for different paths when |

