summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-11-08 01:10:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-11-08 01:10:05 +0000
commit29fa40c962b0df9344592d50c08549befb888453 (patch)
treef802e1edcb71ec0b0cd7cf597cedbad1fafc89b6
parent0fa582d74a7402b21b232eaf63b5d1c698265360 (diff)
downloadllvm-29fa40c962b0df9344592d50c08549befb888453.tar.gz
Update unittest too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317651 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--unittests/Support/FileOutputBufferTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/unittests/Support/FileOutputBufferTest.cpp b/unittests/Support/FileOutputBufferTest.cpp
index 640af46844b1..8e66b26ccda2 100644
--- a/unittests/Support/FileOutputBufferTest.cpp
+++ b/unittests/Support/FileOutputBufferTest.cpp
@@ -42,9 +42,9 @@ TEST(FileOutputBuffer, Test) {
SmallString<128> File1(TestDirectory);
File1.append("/file1");
{
- ErrorOr<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
+ Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
FileOutputBuffer::create(File1, 8192);
- ASSERT_NO_ERROR(BufferOrErr.getError());
+ ASSERT_NO_ERROR(errorToErrorCode(BufferOrErr.takeError()));
std::unique_ptr<FileOutputBuffer> &Buffer = *BufferOrErr;
// Start buffer with special header.
memcpy(Buffer->getBufferStart(), "AABBCCDDEEFFGGHHIIJJ", 20);
@@ -64,9 +64,9 @@ TEST(FileOutputBuffer, Test) {
SmallString<128> File2(TestDirectory);
File2.append("/file2");
{
- ErrorOr<std::unique_ptr<FileOutputBuffer>> Buffer2OrErr =
+ Expected<std::unique_ptr<FileOutputBuffer>> Buffer2OrErr =
FileOutputBuffer::create(File2, 8192);
- ASSERT_NO_ERROR(Buffer2OrErr.getError());
+ ASSERT_NO_ERROR(errorToErrorCode(Buffer2OrErr.takeError()));
std::unique_ptr<FileOutputBuffer> &Buffer2 = *Buffer2OrErr;
// Fill buffer with special header.
memcpy(Buffer2->getBufferStart(), "AABBCCDDEEFFGGHHIIJJ", 20);
@@ -81,9 +81,9 @@ TEST(FileOutputBuffer, Test) {
SmallString<128> File3(TestDirectory);
File3.append("/file3");
{
- ErrorOr<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
+ Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
FileOutputBuffer::create(File3, 8192000);
- ASSERT_NO_ERROR(BufferOrErr.getError());
+ ASSERT_NO_ERROR(errorToErrorCode(BufferOrErr.takeError()));
std::unique_ptr<FileOutputBuffer> &Buffer = *BufferOrErr;
// Start buffer with special header.
memcpy(Buffer->getBufferStart(), "AABBCCDDEEFFGGHHIIJJ", 20);
@@ -102,9 +102,9 @@ TEST(FileOutputBuffer, Test) {
SmallString<128> File4(TestDirectory);
File4.append("/file4");
{
- ErrorOr<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
+ Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
FileOutputBuffer::create(File4, 8192, FileOutputBuffer::F_executable);
- ASSERT_NO_ERROR(BufferOrErr.getError());
+ ASSERT_NO_ERROR(errorToErrorCode(BufferOrErr.takeError()));
std::unique_ptr<FileOutputBuffer> &Buffer = *BufferOrErr;
// Start buffer with special header.
memcpy(Buffer->getBufferStart(), "AABBCCDDEEFFGGHHIIJJ", 20);