summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-18 18:16:20 (GMT)
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-18 18:16:20 (GMT)
commite5373af0cb9cae249e7bc618cae3483397332895 (patch)
tree875de13e45bdf6aff33769448b6934dc11d54bb8 /test
parent9f894c2b36e83e9414b3369f9a4974644d843d8d (diff)
downloadgoogletest-e5373af0cb9cae249e7bc618cae3483397332895.zip
googletest-e5373af0cb9cae249e7bc618cae3483397332895.tar.gz
googletest-e5373af0cb9cae249e7bc618cae3483397332895.tar.bz2
Renames the TestPartResult type enums and adjusts the order of methods in the event listener interface (by Vlad Losev).
Diffstat (limited to 'test')
-rw-r--r--test/gtest-test-part_test.cc20
-rw-r--r--test/gtest_unittest.cc38
2 files changed, 29 insertions, 29 deletions
diff --git a/test/gtest-test-part_test.cc b/test/gtest-test-part_test.cc
index fc94f92..403c184 100644
--- a/test/gtest-test-part_test.cc
+++ b/test/gtest-test-part_test.cc
@@ -38,10 +38,6 @@ using testing::Test;
using testing::TestPartResult;
using testing::TestPartResultArray;
-using testing::TPRT_FATAL_FAILURE;
-using testing::TPRT_NONFATAL_FAILURE;
-using testing::TPRT_SUCCESS;
-
namespace {
// Tests the TestPartResult class.
@@ -50,18 +46,18 @@ namespace {
class TestPartResultTest : public Test {
protected:
TestPartResultTest()
- : r1_(TPRT_SUCCESS, "foo/bar.cc", 10, "Success!"),
- r2_(TPRT_NONFATAL_FAILURE, "foo/bar.cc", -1, "Failure!"),
- r3_(TPRT_FATAL_FAILURE, NULL, -1, "Failure!") {}
+ : r1_(TestPartResult::kSuccess, "foo/bar.cc", 10, "Success!"),
+ r2_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure!"),
+ r3_(TestPartResult::kFatalFailure, NULL, -1, "Failure!") {}
TestPartResult r1_, r2_, r3_;
};
// Tests TestPartResult::type().
TEST_F(TestPartResultTest, type) {
- EXPECT_EQ(TPRT_SUCCESS, r1_.type());
- EXPECT_EQ(TPRT_NONFATAL_FAILURE, r2_.type());
- EXPECT_EQ(TPRT_FATAL_FAILURE, r3_.type());
+ EXPECT_EQ(TestPartResult::kSuccess, r1_.type());
+ EXPECT_EQ(TestPartResult::kNonFatalFailure, r2_.type());
+ EXPECT_EQ(TestPartResult::kFatalFailure, r3_.type());
}
// Tests TestPartResult::file_name().
@@ -114,8 +110,8 @@ TEST_F(TestPartResultTest, NonfatallyFailed) {
class TestPartResultArrayTest : public Test {
protected:
TestPartResultArrayTest()
- : r1_(TPRT_NONFATAL_FAILURE, "foo/bar.cc", -1, "Failure 1"),
- r2_(TPRT_FATAL_FAILURE, "foo/bar.cc", -1, "Failure 2") {}
+ : r1_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure 1"),
+ r2_(TestPartResult::kFatalFailure, "foo/bar.cc", -1, "Failure 2") {}
const TestPartResult r1_, r2_;
};
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
index 8a2ba54..3b1457d 100644
--- a/test/gtest_unittest.cc
+++ b/test/gtest_unittest.cc
@@ -152,9 +152,6 @@ using testing::IsSubstring;
using testing::Message;
using testing::ScopedFakeTestPartResultReporter;
using testing::StaticAssertTypeEq;
-using testing::TPRT_FATAL_FAILURE;
-using testing::TPRT_NONFATAL_FAILURE;
-using testing::TPRT_SUCCESS;
using testing::Test;
using testing::TestPartResult;
using testing::TestPartResultArray;
@@ -1404,12 +1401,12 @@ TEST(TestPartResultTest, ConstructorWorks) {
message << static_cast<const char*>(testing::internal::kStackTraceMarker);
message << "some unimportant stack trace";
- const TestPartResult result(TPRT_NONFATAL_FAILURE,
+ const TestPartResult result(TestPartResult::kNonFatalFailure,
"some_file.cc",
42,
message.GetString().c_str());
- EXPECT_EQ(TPRT_NONFATAL_FAILURE, result.type());
+ EXPECT_EQ(TestPartResult::kNonFatalFailure, result.type());
EXPECT_STREQ("some_file.cc", result.file_name());
EXPECT_EQ(42, result.line_number());
EXPECT_STREQ(message.GetString().c_str(), result.message());
@@ -1417,13 +1414,16 @@ TEST(TestPartResultTest, ConstructorWorks) {
}
TEST(TestPartResultTest, ResultAccessorsWork) {
- const TestPartResult success(TPRT_SUCCESS, "file.cc", 42, "message");
+ const TestPartResult success(TestPartResult::kSuccess,
+ "file.cc",
+ 42,
+ "message");
EXPECT_TRUE(success.passed());
EXPECT_FALSE(success.failed());
EXPECT_FALSE(success.nonfatally_failed());
EXPECT_FALSE(success.fatally_failed());
- const TestPartResult nonfatal_failure(TPRT_NONFATAL_FAILURE,
+ const TestPartResult nonfatal_failure(TestPartResult::kNonFatalFailure,
"file.cc",
42,
"message");
@@ -1432,7 +1432,7 @@ TEST(TestPartResultTest, ResultAccessorsWork) {
EXPECT_TRUE(nonfatal_failure.nonfatally_failed());
EXPECT_FALSE(nonfatal_failure.fatally_failed());
- const TestPartResult fatal_failure(TPRT_FATAL_FAILURE,
+ const TestPartResult fatal_failure(TestPartResult::kFatalFailure,
"file.cc",
42,
"message");
@@ -1457,10 +1457,14 @@ class TestResultTest : public Test {
virtual void SetUp() {
// pr1 is for success.
- pr1 = new TestPartResult(TPRT_SUCCESS, "foo/bar.cc", 10, "Success!");
+ pr1 = new TestPartResult(TestPartResult::kSuccess,
+ "foo/bar.cc",
+ 10,
+ "Success!");
// pr2 is for fatal failure.
- pr2 = new TestPartResult(TPRT_FATAL_FAILURE, "foo/bar.cc",
+ pr2 = new TestPartResult(TestPartResult::kFatalFailure,
+ "foo/bar.cc",
-1, // This line number means "unknown"
"Failure!");
@@ -3334,9 +3338,9 @@ TEST_F(NoFatalFailureTest, AssertNoFatalFailureOnFatalFailure) {
DoAssertNoFatalFailureOnFails();
}
ASSERT_EQ(2, gtest_failures.size());
- EXPECT_EQ(testing::TPRT_FATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kFatalFailure,
gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(testing::TPRT_FATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kFatalFailure,
gtest_failures.GetTestPartResult(1).type());
EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
gtest_failures.GetTestPartResult(0).message());
@@ -3351,11 +3355,11 @@ TEST_F(NoFatalFailureTest, ExpectNoFatalFailureOnFatalFailure) {
DoExpectNoFatalFailureOnFails();
}
ASSERT_EQ(3, gtest_failures.size());
- EXPECT_EQ(testing::TPRT_FATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kFatalFailure,
gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(testing::TPRT_NONFATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kNonFatalFailure,
gtest_failures.GetTestPartResult(1).type());
- EXPECT_EQ(testing::TPRT_NONFATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kNonFatalFailure,
gtest_failures.GetTestPartResult(2).type());
EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
gtest_failures.GetTestPartResult(0).message());
@@ -3372,9 +3376,9 @@ TEST_F(NoFatalFailureTest, MessageIsStreamable) {
EXPECT_NO_FATAL_FAILURE(FAIL() << "foo") << "my message";
}
ASSERT_EQ(2, gtest_failures.size());
- EXPECT_EQ(testing::TPRT_NONFATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kNonFatalFailure,
gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(testing::TPRT_NONFATAL_FAILURE,
+ EXPECT_EQ(TestPartResult::kNonFatalFailure,
gtest_failures.GetTestPartResult(1).type());
EXPECT_PRED_FORMAT2(testing::IsSubstring, "foo",
gtest_failures.GetTestPartResult(0).message());