diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-03 20:26:11 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-03 20:26:11 +0000 |
commit | 148779df305667b6942fee7e758fdf81a6498f38 (patch) | |
tree | 976d85fb9cb4bc8ed54348b045f742be90e10c57 /unittests/DebugInfo/PDB/ErrorChecking.h | |
parent | a303c417bbdb53703c2c17398b08486bde78f1f6 (diff) |
Diffstat (limited to 'unittests/DebugInfo/PDB/ErrorChecking.h')
-rw-r--r-- | unittests/DebugInfo/PDB/ErrorChecking.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/unittests/DebugInfo/PDB/ErrorChecking.h b/unittests/DebugInfo/PDB/ErrorChecking.h index 6d4a7de7834a..f284bfd8bb7a 100644 --- a/unittests/DebugInfo/PDB/ErrorChecking.h +++ b/unittests/DebugInfo/PDB/ErrorChecking.h @@ -36,6 +36,18 @@ } \ } +#define EXPECT_EXPECTED_EQ(Val, Exp) \ + { \ + auto Result = Exp; \ + auto E = Result.takeError(); \ + EXPECT_FALSE(static_cast<bool>(E)); \ + if (E) { \ + consumeError(std::move(E)); \ + return; \ + } \ + EXPECT_EQ(Val, *Result); \ + } + #define EXPECT_UNEXPECTED(Exp) \ { \ auto E = Exp.takeError(); \ |