Repository: mesos Updated Branches: refs/heads/master 89db66e3d -> c020a130a
Supported custom error types for `Try` in `AssertSome`. Review: https://reviews.apache.org/r/67164/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c020a130 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c020a130 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c020a130 Branch: refs/heads/master Commit: c020a130afd55dd3f5702a23b13f8234e0ace391 Parents: 89db66e Author: Chun-Hung Hsiao <[email protected]> Authored: Thu May 17 21:06:07 2018 +0200 Committer: Benjamin Bannier <[email protected]> Committed: Fri May 18 09:40:46 2018 +0200 ---------------------------------------------------------------------- 3rdparty/stout/include/stout/errorbase.hpp | 7 +++++++ 3rdparty/stout/include/stout/gtest.hpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c020a130/3rdparty/stout/include/stout/errorbase.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/errorbase.hpp b/3rdparty/stout/include/stout/errorbase.hpp index 173852f..791565f 100644 --- a/3rdparty/stout/include/stout/errorbase.hpp +++ b/3rdparty/stout/include/stout/errorbase.hpp @@ -15,6 +15,7 @@ #include <errno.h> +#include <ostream> #include <string> #include <stout/os/strerror.hpp> @@ -62,4 +63,10 @@ public: const int code; }; + +inline std::ostream& operator<<(std::ostream& stream, const Error& error) +{ + return stream << error.message; +} + #endif // __STOUT_ERROR_BASE_HPP__ http://git-wip-us.apache.org/repos/asf/mesos/blob/c020a130/3rdparty/stout/include/stout/gtest.hpp ---------------------------------------------------------------------- diff --git a/3rdparty/stout/include/stout/gtest.hpp b/3rdparty/stout/include/stout/gtest.hpp index a40e810..f015718 100644 --- a/3rdparty/stout/include/stout/gtest.hpp +++ b/3rdparty/stout/include/stout/gtest.hpp @@ -44,10 +44,10 @@ template <typename T> } -template <typename T> +template <typename T, typename E> ::testing::AssertionResult AssertSome( const char* expr, - const Try<T>& actual) + const Try<T, E>& actual) { if (actual.isError()) { return ::testing::AssertionFailure()
