From 1b89db97058ced81a116d6a03714fec9bd8fc721 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Thu, 28 Feb 2013 22:55:25 +0000 Subject: Removes an unused variable; also refactors to support an up-coming googlemock change. --- include/gtest/internal/gtest-internal.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h index ca4e1fdb..892ddecd 100644 --- a/include/gtest/internal/gtest-internal.h +++ b/include/gtest/internal/gtest-internal.h @@ -46,6 +46,10 @@ # include #endif // GTEST_OS_LINUX +#if GTEST_HAS_EXCEPTIONS +# include +#endif + #include #include #include @@ -166,6 +170,21 @@ char (&IsNullLiteralHelper(...))[2]; // NOLINT GTEST_API_ std::string AppendUserMessage( const std::string& gtest_msg, const Message& user_msg); +#if GTEST_HAS_EXCEPTIONS + +// This exception is thrown by (and only by) a failed Google Test +// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions +// are enabled). We derive it from std::runtime_error, which is for +// errors presumably detectable only at run time. Since +// std::runtime_error inherits from std::exception, many testing +// frameworks know how to extract and print the message inside it. +class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { + public: + explicit GoogleTestFailureException(const TestPartResult& failure); +}; + +#endif // GTEST_HAS_EXCEPTIONS + // A helper class for creating scoped traces in user programs. class GTEST_API_ ScopedTrace { public: -- cgit v1.2.3