diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
commit | 2a826e40fa51fcae4adb564d789cafe95776e0bb (patch) | |
tree | fc0dea973c66e8777a6354c1e01199057d38b023 /llvm/unittests/Support/ErrorOrTest.cpp | |
parent | 372bc70c639a45e69a519a2e47f0b9a06e23914a (diff) | |
download | llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.zip llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.tar.gz llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.tar.bz2 |
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there
are few annoying differences with regards to the std::errc enumeration.
This patch adds a simple llvm enumeration, which will hopefully avoid build
breakages in other platforms and surprises as we get more uses of
std::error_code.
llvm-svn: 210920
Diffstat (limited to 'llvm/unittests/Support/ErrorOrTest.cpp')
-rw-r--r-- | llvm/unittests/Support/ErrorOrTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/Support/ErrorOrTest.cpp b/llvm/unittests/Support/ErrorOrTest.cpp index 976a953..d76e7d6 100644 --- a/llvm/unittests/Support/ErrorOrTest.cpp +++ b/llvm/unittests/Support/ErrorOrTest.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/ErrorOr.h" +#include "llvm/Support/Errc.h" #include "gtest/gtest.h" #include <memory> @@ -16,7 +17,7 @@ using namespace llvm; namespace { ErrorOr<int> t1() {return 1;} -ErrorOr<int> t2() { return std::errc::invalid_argument; } +ErrorOr<int> t2() { return errc::invalid_argument; } TEST(ErrorOr, SimpleValue) { ErrorOr<int> a = t1(); @@ -30,7 +31,7 @@ TEST(ErrorOr, SimpleValue) { a = t2(); EXPECT_FALSE(a); - EXPECT_EQ(std::errc::invalid_argument, a.getError()); + EXPECT_EQ(a.getError(), errc::invalid_argument); #ifdef EXPECT_DEBUG_DEATH EXPECT_DEBUG_DEATH(*a, "Cannot get value when an error exists"); #endif |