aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r--llvm/unittests/Support/ErrorTest.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp
index c4a9f3e..ec5c30b5 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -933,7 +933,7 @@ public:
class TestErrorCategory : public std::error_category {
public:
- const char *name() const noexcept override { return "error"; }
+ const char *name() const noexcept override { return "test_error"; }
std::string message(int Condition) const override {
switch (static_cast<test_error_code>(Condition)) {
case test_error_code::unspecified:
@@ -975,4 +975,11 @@ TEST(Error, SubtypeStringErrorTest) {
0);
}
+TEST(Error, error_codeErrorMessageTest) {
+ EXPECT_NONFATAL_FAILURE(
+ EXPECT_EQ(make_error_code(test_error_code::unspecified),
+ make_error_code(test_error_code::error_2)),
+ "Which is: An unknown error has occurred. (test_error:1)");
+}
+
} // namespace