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
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 @@
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 @@
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 @@
}
{
- 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';
}