Merge pull request #4313 from kimvaleen:main

PiperOrigin-RevId: 549039222
Change-Id: I96bea310beede5ba0ed6160155251ffd9d7a2103
This commit is contained in:
Copybara-Service 2023-07-18 10:18:14 -07:00
commit d66ce58510
2 changed files with 16 additions and 15 deletions

View File

@ -2101,8 +2101,8 @@ class GTEST_API_ ScopedTrace {
// Assuming that each thread maintains its own stack of traces. // Assuming that each thread maintains its own stack of traces.
// Therefore, a SCOPED_TRACE() would (correctly) only affect the // Therefore, a SCOPED_TRACE() would (correctly) only affect the
// assertions in its own thread. // assertions in its own thread.
#define SCOPED_TRACE(message) \ #define SCOPED_TRACE(message) \
::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)( \ const ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)( \
__FILE__, __LINE__, (message)) __FILE__, __LINE__, (message))
// Compile-time assertion for type equality. // Compile-time assertion for type equality.

View File

@ -1497,19 +1497,20 @@ class NeverThrown {
gtest_ar_, text, #actual, #expected) \ gtest_ar_, text, #actual, #expected) \
.c_str()) .c_str())
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ #define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (::testing::internal::AlwaysTrue()) { \ if (::testing::internal::AlwaysTrue()) { \
::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ const ::testing::internal::HasNewFatalFailureHelper \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ gtest_fatal_failure_checker; \
if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
} \ goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
} else \ } \
GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__) \ } else /* NOLINT */ \
: fail("Expected: " #statement \ GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__) \
" doesn't generate new fatal " \ : fail("Expected: " #statement \
"failures in the current thread.\n" \ " doesn't generate new fatal " \
"failures in the current thread.\n" \
" Actual: it does.") " Actual: it does.")
// Expands to the name of the class that implements the given test. // Expands to the name of the class that implements the given test.