]> granicus.if.org Git - clang/commitdiff
[FileSystemStatCache] Update test for new FileSystemStatCache API
authorHarlan Haskins <harlan@harlanhaskins.com>
Tue, 16 Apr 2019 18:00:43 +0000 (18:00 +0000)
committerHarlan Haskins <harlan@harlanhaskins.com>
Tue, 16 Apr 2019 18:00:43 +0000 (18:00 +0000)
Summary: Update this test to return std::error_code instead of LookupResult.

Reviewers: arphaman

Subscribers: dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60786

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358511 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Basic/FileManagerTest.cpp

index c9dfbd6b5c64741fd6dd1803b16e2c633b2630e9..19e2180d3ff6b624f48b16cd64f08c3cda3473c4 100644 (file)
@@ -57,9 +57,10 @@ public:
   }
 
   // Implement FileSystemStatCache::getStat().
-  LookupResult getStat(StringRef Path, llvm::vfs::Status &Status, bool isFile,
-                       std::unique_ptr<llvm::vfs::File> *F,
-                       llvm::vfs::FileSystem &FS) override {
+  std::error_code getStat(StringRef Path, llvm::vfs::Status &Status,
+                          bool isFile,
+                          std::unique_ptr<llvm::vfs::File> *F,
+                          llvm::vfs::FileSystem &FS) override {
 #ifndef _WIN32
     SmallString<128> NormalizedPath(Path);
     llvm::sys::path::native(NormalizedPath);
@@ -68,10 +69,10 @@ public:
 
     if (StatCalls.count(Path) != 0) {
       Status = StatCalls[Path];
-      return CacheExists;
+      return std::error_code();
     }
 
-    return CacheMissing;  // This means the file/directory doesn't exist.
+    return std::make_error_code(std::errc::no_such_file_or_directory);
   }
 };