summaryrefslogtreecommitdiffstats
path: root/unittests/Basic
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-11 07:31:29 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-11 07:31:29 +0000
commitb042fd3636808bb9d8122c434eb2cced7a5c3721 (patch)
treef14fca8ec9052f6ffe0db36df3cd46664cf1949f /unittests/Basic
parentd0a5e3228511efe7846e4d270f114e24ec6d03c8 (diff)
Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Basic')
-rw-r--r--unittests/Basic/FileManagerTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/unittests/Basic/FileManagerTest.cpp b/unittests/Basic/FileManagerTest.cpp
index 2c606715c2..4cf21cd845 100644
--- a/unittests/Basic/FileManagerTest.cpp
+++ b/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