diff options
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 6d4a7de7834a1..f284bfd8bb7a0 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(); \ |