aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest_unittest.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-04-13 04:40:32 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-04-13 04:40:32 +0000
commit1b71f0b272f4d3dfb45db44ab39a77727ddafb9b (patch)
tree72cb7c19f20a10a700f7720e122b8e42a7ed1fd9 /test/gtest_unittest.cc
parent509b5339e95a05bac90bca676251fb252adbb843 (diff)
downloadgoogletest-1b71f0b272f4d3dfb45db44ab39a77727ddafb9b.tar.gz
googletest-1b71f0b272f4d3dfb45db44ab39a77727ddafb9b.tar.bz2
googletest-1b71f0b272f4d3dfb45db44ab39a77727ddafb9b.zip
Adds alternative spellings for FAIL, SUCCEED, and TEST.
Diffstat (limited to 'test/gtest_unittest.cc')
-rw-r--r--test/gtest_unittest.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc
index 717bd4e1..a14f065a 100644
--- a/test/gtest_unittest.cc
+++ b/test/gtest_unittest.cc
@@ -6703,3 +6703,16 @@ TEST(EventListenerTest, RemovingDefaultXmlGeneratorWorks) {
EXPECT_FALSE(is_destroyed);
delete listener;
}
+
+// Sanity tests to ensure that the alternative, verbose spellings of
+// some of the macros work. We don't test them thoroughly as that
+// would be quite involved. Since their implementations are
+// straightforward, and they are rarely used, we'll just rely on the
+// users to tell us when they are broken.
+GTEST_TEST(AlternativeNameTest, Works) { // GTEST_TEST is the same as TEST.
+ GTEST_SUCCEED() << "OK"; // GTEST_SUCCEED is the same as SUCCEED.
+
+ // GTEST_FAIL is the same as FAIL.
+ EXPECT_FATAL_FAILURE(GTEST_FAIL() << "An expected failure",
+ "An expected failure");
+}