aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-02-24 18:20:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-02-24 18:20:12 +0000
commit90c7f1cc161769853db72e30e76c34b0e4ddf3da (patch)
tree3d67820a8a7b4be67a275680897f77df8f188040 /llvm/unittests/Support/Path.cpp
parent6ccda923e594bff47aade5a2342f01e5d2dbc661 (diff)
downloadllvm-90c7f1cc161769853db72e30e76c34b0e4ddf3da.zip
llvm-90c7f1cc161769853db72e30e76c34b0e4ddf3da.tar.gz
llvm-90c7f1cc161769853db72e30e76c34b0e4ddf3da.tar.bz2
Replace the F_Binary flag with a F_Text one.
After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r--llvm/unittests/Support/Path.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index d834ec0..f10faf9 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -501,7 +501,7 @@ TEST_F(FileSystemTest, Magic) {
SmallString<128> file_pathname(TestDirectory);
path::append(file_pathname, i->filename);
std::string ErrMsg;
- raw_fd_ostream file(file_pathname.c_str(), ErrMsg, sys::fs::F_Binary);
+ raw_fd_ostream file(file_pathname.c_str(), ErrMsg, sys::fs::F_None);
ASSERT_FALSE(file.has_error());
StringRef magic(i->magic_str, i->magic_str_len);
file << magic;
@@ -521,7 +521,7 @@ TEST_F(FileSystemTest, CarriageReturn) {
path::append(FilePathname, "test");
{
- raw_fd_ostream File(FilePathname.c_str(), ErrMsg, sys::fs::F_None);
+ raw_fd_ostream File(FilePathname.c_str(), ErrMsg, sys::fs::F_Text);
EXPECT_EQ(ErrMsg, "");
File << '\n';
}
@@ -532,7 +532,7 @@ TEST_F(FileSystemTest, CarriageReturn) {
}
{
- raw_fd_ostream File(FilePathname.c_str(), ErrMsg, sys::fs::F_Binary);
+ raw_fd_ostream File(FilePathname.c_str(), ErrMsg, sys::fs::F_None);
EXPECT_EQ(ErrMsg, "");
File << '\n';
}