LLVM: include/llvm/Testing/Support/Error.h File Reference (original) (raw)
#include "[llvm/Support/Error.h](llvm%5F2Support%5F2Error%5F8h%5Fsource.html)"#include "[llvm/Testing/Support/SupportHelpers.h](SupportHelpers%5F8h%5Fsource.html)"#include "gmock/gmock.h"#include <ostream>
Go to the source code of this file.
| Namespaces | |
|---|---|
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
| namespace | llvm::detail |
| A self-contained host- and target-independent arbitrary-precision floating-point software implementation. |
| Macros | |
|---|---|
| #define | EXPECT_THAT_ERROR(Err, Matcher) |
| #define | ASSERT_THAT_ERROR(Err, Matcher) |
| #define | EXPECT_THAT_EXPECTED(Err, Matcher) |
| Helper macro for checking the result of an 'Expected'. | |
| #define | ASSERT_THAT_EXPECTED(Err, Matcher) |
| Functions | |
|---|---|
| ErrorHolder | llvm::detail::TakeError (Error Err) |
| template<typename T> | |
| ExpectedHolder< T > | llvm::detail::TakeExpected (Expected< T > &Exp) |
| template<typename T> | |
| ExpectedHolder< T > | llvm::detail::TakeExpected (Expected< T > &&Exp) |
| llvm::MATCHER (Succeeded, "") | |
| llvm::MATCHER (Failed, "") | |
| template | |
| testing::Matcher< const detail::ErrorHolder & > | llvm::Failed () |
| template<typename InfoT, typename M> | |
| testing::Matcher< const detail::ErrorHolder & > | llvm::Failed (M Matcher) |
| template<typename... M> | |
| testing::Matcher< const detail::ErrorHolder & > | llvm::FailedWithMessage (M... Matcher) |
| template | |
| testing::Matcher< const detail::ErrorHolder & > | llvm::FailedWithMessageArray (M Matcher) |
| template | |
| detail::ValueMatchesPoly< M > | llvm::HasValue (M Matcher) |
◆ ASSERT_THAT_ERROR
| #define ASSERT_THAT_ERROR | ( | Err, |
|---|---|---|
| Matcher ) |
Value:
ErrorHolder TakeError(Error Err)
Definition at line 165 of file Error.h.
◆ ASSERT_THAT_EXPECTED
| #define ASSERT_THAT_EXPECTED | ( | Err, |
|---|---|---|
| Matcher ) |
Value:
ExpectedHolder< T > TakeExpected(Expected< T > &Exp)
Definition at line 191 of file Error.h.
◆ EXPECT_THAT_ERROR
| #define EXPECT_THAT_ERROR | ( | Err, |
|---|---|---|
| Matcher ) |
◆ EXPECT_THAT_EXPECTED
| #define EXPECT_THAT_EXPECTED | ( | Err, |
|---|---|---|
| Matcher ) |
Value:
Helper macro for checking the result of an 'Expected'.
Expected myDivide(int A, int B);
TEST(myDivideTests, GoodAndBad) {
EXPECT_THAT_EXPECTED(myDivide(10, 5), Succeeded());
EXPECT_THAT_EXPECTED(myDivide(10, 5), HasValue(2));
EXPECT_THAT_EXPECTED(myDivide(10, 0), Failed());
EXPECT_THAT_EXPECTED(myDivide(10, 0),
FailedWithMessage("B must not be zero!"));
}
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define EXPECT_THAT_EXPECTED(Err, Matcher)
Helper macro for checking the result of an 'Expected'.