llvm.org GIT mirror llvm / 64bb4a6
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 Reid Kleckner 6 years ago
1 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
548548 #ifdef LLVM_ON_WIN32
549549 TEST_F(FileSystemTest, CarriageReturn) {
550550 SmallString<128> FilePathname(TestDirectory);
551 std::string ErrMsg;
551 std::error_code EC;
552552 path::append(FilePathname, "test");
553553
554554 {
555 raw_fd_ostream File(FilePathname, ErrMsg, sys::fs::F_Text);
556 EXPECT_EQ(ErrMsg, "");
555 raw_fd_ostream File(FilePathname, EC, sys::fs::F_Text);
556 ASSERT_NO_ERROR(EC);
557557 File << '\n';
558558 }
559559 {
560 auto Buf = MemoryBuffer::getFile(FilePathname);
560 auto Buf = MemoryBuffer::getFile(FilePathname.str());
561561 EXPECT_TRUE((bool)Buf);
562562 EXPECT_EQ(Buf.get()->getBuffer(), "\r\n");
563563 }
564564
565565 {
566 raw_fd_ostream File(FilePathname, ErrMsg, sys::fs::F_None);
567 EXPECT_EQ(ErrMsg, "");
566 raw_fd_ostream File(FilePathname, EC, sys::fs::F_None);
567 ASSERT_NO_ERROR(EC);
568568 File << '\n';
569569 }
570570 {
571 auto Buf = MemoryBuffer::getFile(FilePathname);
571 auto Buf = MemoryBuffer::getFile(FilePathname.str());
572572 EXPECT_TRUE((bool)Buf);
573573 EXPECT_EQ(Buf.get()->getBuffer(), "\n");
574574 }