From ac69459e0fe3df04788f5adcb94b1bec8b8cf8ad Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 24 Feb 2014 18:20:12 +0000 Subject: 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 --- unittests/Support/Path.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'unittests') 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'; } -- cgit v1.2.3