diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
commit | 044eb2f6afba375a914ac9d8024f8f5142bb912e (patch) | |
tree | 1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /include/llvm/Testing/Support/SupportHelpers.h | |
parent | eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff) |
Notes
Diffstat (limited to 'include/llvm/Testing/Support/SupportHelpers.h')
-rw-r--r-- | include/llvm/Testing/Support/SupportHelpers.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Testing/Support/SupportHelpers.h b/include/llvm/Testing/Support/SupportHelpers.h index c4dd414b80dbc..d7f0c7142b2ca 100644 --- a/include/llvm/Testing/Support/SupportHelpers.h +++ b/include/llvm/Testing/Support/SupportHelpers.h @@ -22,7 +22,10 @@ struct ErrorHolder { }; template <typename T> struct ExpectedHolder : public ErrorHolder { - Optional<T *> Value; + ExpectedHolder(ErrorHolder Err, Expected<T> &Exp) + : ErrorHolder(std::move(Err)), Exp(Exp) {} + + Expected<T> &Exp; }; inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) { @@ -35,8 +38,7 @@ inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) { template <typename T> void PrintTo(const ExpectedHolder<T> &Item, std::ostream *Out) { if (Item.Success) { - *Out << "succeeded with value \"" << ::testing::PrintToString(**Item.Value) - << "\""; + *Out << "succeeded with value " << ::testing::PrintToString(*Item.Exp); } else { PrintTo(static_cast<const ErrorHolder &>(Item), Out); } |