Skip to content

Commit 8a011b8

Browse files
Abseil Teamcopybara-github
authored andcommitted
Add clarifying comments about when to use EXPECT_NONFATAL_FAILURE vs. EXPECT_FATAL_FAILURE.
PiperOrigin-RevId: 448237839 Change-Id: Id6242f278912f8c47cf19e3ea8c061f8b18ba832
1 parent cbca6bc commit 8a011b8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

googletest/include/gtest/gtest-spi.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ class GTEST_API_ SingleFailureChecker {
121121
GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
122122

123123
// A set of macros for testing Google Test assertions or code that's expected
124-
// to generate Google Test fatal failures. It verifies that the given
124+
// to generate Google Test fatal failures (e.g. a failure from an ASSERT_EQ, but
125+
// not a non-fatal failure, as from EXPECT_EQ). It verifies that the given
125126
// statement will cause exactly one fatal Google Test failure with 'substr'
126127
// being part of the failure message.
127128
//
@@ -179,9 +180,10 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
179180
} while (::testing::internal::AlwaysFalse())
180181

181182
// A macro for testing Google Test assertions or code that's expected to
182-
// generate Google Test non-fatal failures. It asserts that the given
183-
// statement will cause exactly one non-fatal Google Test failure with 'substr'
184-
// being part of the failure message.
183+
// generate Google Test non-fatal failures (e.g. a failure from an EXPECT_EQ,
184+
// but not from an ASSERT_EQ). It asserts that the given statement will cause
185+
// exactly one non-fatal Google Test failure with 'substr' being part of the
186+
// failure message.
185187
//
186188
// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
187189
// affects and considers failures generated in the current thread and

0 commit comments

Comments
 (0)