diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-24 18:20:12 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-24 18:20:12 +0000 |
commit | ac69459e0fe3df04788f5adcb94b1bec8b8cf8ad (patch) | |
tree | 6260ace05d8d32042f39b42aead973d7c3ebaf9a /unittests | |
parent | 137342f198093f68e112cd979782fae27bbb22ab (diff) | |
download | llvm-ac69459e0fe3df04788f5adcb94b1bec8b8cf8ad.tar.gz llvm-ac69459e0fe3df04788f5adcb94b1bec8b8cf8ad.tar.bz2 llvm-ac69459e0fe3df04788f5adcb94b1bec8b8cf8ad.tar.xz |
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 :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/Path.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp index d834ec04e0..f10faf9908 100644 --- a/unittests/Support/Path.cpp +++ b/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'; } |