[llvm] r216422 - Fix Path unittests on Windows after raw_fd_ostream changes
Reid Kleckner
reid at kleckner.net
Mon Aug 25 17:24:24 PDT 2014
Author: rnk
Date: Mon Aug 25 19:24:23 2014
New Revision: 216422
URL: http://llvm.org/viewvc/llvm-project?rev=216422&view=rev
Log:
Fix Path unittests on Windows after raw_fd_ostream changes
Modified:
llvm/trunk/unittests/Support/Path.cpp
Modified: llvm/trunk/unittests/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=216422&r1=216421&r2=216422&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Mon Aug 25 19:24:23 2014
@@ -549,27 +549,27 @@ TEST_F(FileSystemTest, Magic) {
#ifdef LLVM_ON_WIN32
TEST_F(FileSystemTest, CarriageReturn) {
SmallString<128> FilePathname(TestDirectory);
- std::string ErrMsg;
+ std::error_code EC;
path::append(FilePathname, "test");
{
- raw_fd_ostream File(FilePathname, ErrMsg, sys::fs::F_Text);
- EXPECT_EQ(ErrMsg, "");
+ raw_fd_ostream File(FilePathname, EC, sys::fs::F_Text);
+ ASSERT_NO_ERROR(EC);
File << '\n';
}
{
- auto Buf = MemoryBuffer::getFile(FilePathname);
+ auto Buf = MemoryBuffer::getFile(FilePathname.str());
EXPECT_TRUE((bool)Buf);
EXPECT_EQ(Buf.get()->getBuffer(), "\r\n");
}
{
- raw_fd_ostream File(FilePathname, ErrMsg, sys::fs::F_None);
- EXPECT_EQ(ErrMsg, "");
+ raw_fd_ostream File(FilePathname, EC, sys::fs::F_None);
+ ASSERT_NO_ERROR(EC);
File << '\n';
}
{
- auto Buf = MemoryBuffer::getFile(FilePathname);
+ auto Buf = MemoryBuffer::getFile(FilePathname.str());
EXPECT_TRUE((bool)Buf);
EXPECT_EQ(Buf.get()->getBuffer(), "\n");
}
More information about the llvm-commits
mailing list