Skip to content

Commit d66ce58

Browse files
Merge pull request #4313 from kimvaleen:main
PiperOrigin-RevId: 549039222 Change-Id: I96bea310beede5ba0ed6160155251ffd9d7a2103
2 parents c541e7c + c88e0b4 commit d66ce58

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

googletest/include/gtest/gtest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,8 +2101,8 @@ class GTEST_API_ ScopedTrace {
21012101
// Assuming that each thread maintains its own stack of traces.
21022102
// Therefore, a SCOPED_TRACE() would (correctly) only affect the
21032103
// assertions in its own thread.
2104-
#define SCOPED_TRACE(message) \
2105-
::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)( \
2104+
#define SCOPED_TRACE(message) \
2105+
const ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)( \
21062106
__FILE__, __LINE__, (message))
21072107

21082108
// Compile-time assertion for type equality.

googletest/include/gtest/internal/gtest-internal.h

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,19 +1497,20 @@ class NeverThrown {
14971497
gtest_ar_, text, #actual, #expected) \
14981498
.c_str())
14991499

1500-
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
1501-
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1502-
if (::testing::internal::AlwaysTrue()) { \
1503-
::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
1504-
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
1505-
if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
1506-
goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
1507-
} \
1508-
} else \
1509-
GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__) \
1510-
: fail("Expected: " #statement \
1511-
" doesn't generate new fatal " \
1512-
"failures in the current thread.\n" \
1500+
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
1501+
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
1502+
if (::testing::internal::AlwaysTrue()) { \
1503+
const ::testing::internal::HasNewFatalFailureHelper \
1504+
gtest_fatal_failure_checker; \
1505+
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
1506+
if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
1507+
goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
1508+
} \
1509+
} else /* NOLINT */ \
1510+
GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__) \
1511+
: fail("Expected: " #statement \
1512+
" doesn't generate new fatal " \
1513+
"failures in the current thread.\n" \
15131514
" Actual: it does.")
15141515

15151516
// Expands to the name of the class that implements the given test.

0 commit comments

Comments
 (0)