summaryrefslogtreecommitdiff
path: root/unittests/DebugInfo/CodeView/ErrorChecking.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:25:25 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:25:25 +0000
commitab44ce3d598882e51a25eb82eb7ae6308de85ae6 (patch)
tree568d786a59d49bef961dcb9bd09d422701b9da5b /unittests/DebugInfo/CodeView/ErrorChecking.h
parentb5630dbadf9a2a06754194387d6b0fd9962a67f1 (diff)
Diffstat (limited to 'unittests/DebugInfo/CodeView/ErrorChecking.h')
-rw-r--r--unittests/DebugInfo/CodeView/ErrorChecking.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/DebugInfo/CodeView/ErrorChecking.h b/unittests/DebugInfo/CodeView/ErrorChecking.h
index 09310883bf58..4ca74c487b3e 100644
--- a/unittests/DebugInfo/CodeView/ErrorChecking.h
+++ b/unittests/DebugInfo/CodeView/ErrorChecking.h
@@ -26,6 +26,15 @@
consumeError(std::move(E)); \
}
+#define ASSERT_EXPECTED(Exp) \
+ { \
+ auto E = Exp.takeError(); \
+ bool Success = static_cast<bool>(E); \
+ if (!Success) \
+ consumeError(std::move(E)); \
+ ASSERT_FALSE(Success); \
+ }
+
#define EXPECT_EXPECTED(Exp) \
{ \
auto E = Exp.takeError(); \