From: Reid Kleckner Date: Tue, 26 Aug 2014 00:24:23 +0000 (+0000) Subject: Fix Path unittests on Windows after raw_fd_ostream changes X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=64bb4a64e73c3cae0086840bd6f40a7e5b4c0b30 Fix Path unittests on Windows after raw_fd_ostream changes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216422 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp index 22bf35d9cbe..94ccab6c712 100644 --- a/unittests/Support/Path.cpp +++ b/unittests/Support/Path.cpp @@ -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"); }