aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest_output_test_.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-08-09 18:19:15 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-08-09 18:19:15 +0000
commit5c4b472bbf8c81fc3d52fc69a92f174821a96280 (patch)
treecb61bdc699ce42b01ae571b3021d7c3a66188311 /test/gtest_output_test_.cc
parent7c598c4f1a44fdda5f97587484c85bef9e93fa98 (diff)
downloadgoogletest-5c4b472bbf8c81fc3d52fc69a92f174821a96280.tar.gz
googletest-5c4b472bbf8c81fc3d52fc69a92f174821a96280.tar.bz2
googletest-5c4b472bbf8c81fc3d52fc69a92f174821a96280.zip
Makes gtest print enums as integers instead of hex dumps (by Zhanyong Wan); improves the hex dump format (by Zhanyong Wan); gets rid of class TestInfoImpl (by Zhanyong Wan); adds exception handling (by Vlad Losev).
Diffstat (limited to 'test/gtest_output_test_.cc')
-rw-r--r--test/gtest_output_test_.cc131
1 files changed, 0 insertions, 131 deletions
diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc
index 454e1bad..fc80fac3 100644
--- a/test/gtest_output_test_.cc
+++ b/test/gtest_output_test_.cc
@@ -445,137 +445,6 @@ TEST(AddFailureAtTest, MessageContainsSpecifiedFileAndLineNumber) {
ADD_FAILURE_AT("foo.cc", 42) << "Expected failure in foo.cc";
}
-#if GTEST_OS_WINDOWS
-
-// This group of tests verifies that Google Test handles SEH and C++
-// exceptions correctly.
-
-// A function that throws an SEH exception.
-static void ThrowSEH() {
- int* p = NULL;
- *p = 0; // Raises an access violation.
-}
-
-// Tests exceptions thrown in the test fixture constructor.
-class ExceptionInFixtureCtorTest : public testing::Test {
- protected:
- ExceptionInFixtureCtorTest() {
- printf("(expecting a failure on thrown exception "
- "in the test fixture's constructor)\n");
-
- ThrowSEH();
- }
-
- virtual ~ExceptionInFixtureCtorTest() {
- Deinit();
- }
-
- virtual void SetUp() {
- FAIL() << "UNEXPECTED failure in SetUp(). "
- << "We should never get here, as the test fixture c'tor threw.";
- }
-
- virtual void TearDown() {
- FAIL() << "UNEXPECTED failure in TearDown(). "
- << "We should never get here, as the test fixture c'tor threw.";
- }
- private:
- void Deinit() {
- FAIL() << "UNEXPECTED failure in the d'tor. "
- << "We should never get here, as the test fixture c'tor threw.";
- }
-};
-
-TEST_F(ExceptionInFixtureCtorTest, ExceptionInFixtureCtor) {
- FAIL() << "UNEXPECTED failure in the test function. "
- << "We should never get here, as the test fixture c'tor threw.";
-}
-
-// Tests exceptions thrown in SetUp().
-class ExceptionInSetUpTest : public testing::Test {
- protected:
- virtual ~ExceptionInSetUpTest() {
- Deinit();
- }
-
- virtual void SetUp() {
- printf("(expecting 3 failures)\n");
-
- ThrowSEH();
- }
-
- virtual void TearDown() {
- FAIL() << "Expected failure #2, in TearDown().";
- }
- private:
- void Deinit() {
- FAIL() << "Expected failure #3, in the test fixture d'tor.";
- }
-};
-
-TEST_F(ExceptionInSetUpTest, ExceptionInSetUp) {
- FAIL() << "UNEXPECTED failure in the test function. "
- << "We should never get here, as SetUp() threw.";
-}
-
-// Tests that TearDown() and the test fixture d'tor are always called,
-// even when the test function throws an exception.
-class ExceptionInTestFunctionTest : public testing::Test {
- protected:
- virtual ~ExceptionInTestFunctionTest() {
- Deinit();
- }
-
- virtual void TearDown() {
- FAIL() << "Expected failure #2, in TearDown().";
- }
- private:
- void Deinit() {
- FAIL() << "Expected failure #3, in the test fixture d'tor.";
- }
-};
-
-// Tests that the test fixture d'tor is always called, even when the
-// test function throws an SEH exception.
-TEST_F(ExceptionInTestFunctionTest, SEH) {
- printf("(expecting 3 failures)\n");
-
- ThrowSEH();
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests that the test fixture d'tor is always called, even when the
-// test function throws a C++ exception. We do this only when
-// GTEST_HAS_EXCEPTIONS is non-zero, i.e. C++ exceptions are enabled.
-TEST_F(ExceptionInTestFunctionTest, CppException) {
- throw 1;
-}
-
-// Tests exceptions thrown in TearDown().
-class ExceptionInTearDownTest : public testing::Test {
- protected:
- virtual ~ExceptionInTearDownTest() {
- Deinit();
- }
-
- virtual void TearDown() {
- throw 1;
- }
- private:
- void Deinit() {
- FAIL() << "Expected failure #2, in the test fixture d'tor.";
- }
-};
-
-TEST_F(ExceptionInTearDownTest, ExceptionInTearDown) {
- printf("(expecting 2 failures)\n");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-#endif // GTEST_OS_WINDOWS
-
#if GTEST_IS_THREADSAFE
// A unary function that may die.