summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/FileOutputBufferTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-09-11 20:30:02 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-09-11 20:30:02 +0000
commit281f23adc1b76136efd11a410532d0600f6936e8 (patch)
treeae883405160167f575c58b2c8972734daeda139b /llvm/unittests/Support/FileOutputBufferTest.cpp
parent40a069adcdcb64a3974315ca2231ce6d62e96776 (diff)
downloadbcm5719-llvm-281f23adc1b76136efd11a410532d0600f6936e8.tar.gz
bcm5719-llvm-281f23adc1b76136efd11a410532d0600f6936e8.zip
Misc cleanups to the FileSytem api.
The main difference is the removal of std::error_code exists(const Twine &path, bool &result); It was an horribly redundant interface since a file not existing is also a valid error_code. Now we have an access function that returns just an error_code. This is the only function that has to be implemented for Unix and Windows. The functions can_write, exists and can_execute an now just wrappers. One still has to be very careful using these function to avoid introducing race conditions (Time of check to time of use). llvm-svn: 217625
Diffstat (limited to 'llvm/unittests/Support/FileOutputBufferTest.cpp')
-rw-r--r--llvm/unittests/Support/FileOutputBufferTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/Support/FileOutputBufferTest.cpp b/llvm/unittests/Support/FileOutputBufferTest.cpp
index b086f1e118d..911d51613b1 100644
--- a/llvm/unittests/Support/FileOutputBufferTest.cpp
+++ b/llvm/unittests/Support/FileOutputBufferTest.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Support/Errc.h"
#include "llvm/Support/FileOutputBuffer.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
@@ -65,9 +66,8 @@ TEST(FileOutputBuffer, Test) {
// Do *not* commit buffer.
}
// Verify file does not exist (because buffer not committed).
- bool Exists = false;
- ASSERT_NO_ERROR(fs::exists(Twine(File2), Exists));
- EXPECT_FALSE(Exists);
+ ASSERT_EQ(fs::access(Twine(File2), fs::AccessMode::Exist),
+ errc::no_such_file_or_directory);
ASSERT_NO_ERROR(fs::remove(File2.str()));
// TEST 3: Verify sizing down case.
OpenPOWER on IntegriCloud