diff options
| author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-02-28 22:55:25 +0000 | 
|---|---|---|
| committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-02-28 22:55:25 +0000 | 
| commit | 1b89db97058ced81a116d6a03714fec9bd8fc721 (patch) | |
| tree | 7ecc2e79c1112c0d2ef57824608cde99cfdc4be0 /include/gtest | |
| parent | 88fe90793c95265844b033b11a08568ff4b0fa98 (diff) | |
| download | googletest-1b89db97058ced81a116d6a03714fec9bd8fc721.tar.gz googletest-1b89db97058ced81a116d6a03714fec9bd8fc721.tar.bz2 googletest-1b89db97058ced81a116d6a03714fec9bd8fc721.zip  | |
Removes an unused variable; also refactors to support an up-coming
googlemock change.
Diffstat (limited to 'include/gtest')
| -rw-r--r-- | include/gtest/internal/gtest-internal.h | 19 | 
1 files changed, 19 insertions, 0 deletions
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 <unistd.h>  #endif  // GTEST_OS_LINUX +#if GTEST_HAS_EXCEPTIONS +# include <stdexcept> +#endif +  #include <ctype.h>  #include <string.h>  #include <iomanip> @@ -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:  | 
