summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2013-02-28 22:55:25 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2013-02-28 22:55:25 +0000
commitc2f7c754e62a0de338a470d6987a4873827d4045 (patch)
tree7ecc2e79c1112c0d2ef57824608cde99cfdc4be0 /include
parentde78d45a5b1dd97575be25b4051d40ffd9446bd8 (diff)
downloadgtest-c2f7c754e62a0de338a470d6987a4873827d4045.tar.gz
gtest-c2f7c754e62a0de338a470d6987a4873827d4045.tar.bz2
gtest-c2f7c754e62a0de338a470d6987a4873827d4045.tar.xz
Removes an unused variable; also refactors to support an up-coming
googlemock change. git-svn-id: http://googletest.googlecode.com/svn/trunk@640 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'include')
-rw-r--r--include/gtest/internal/gtest-internal.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-internal.h b/include/gtest/internal/gtest-internal.h
index ca4e1fd..892ddec 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: