mirror of
https://github.com/google/googletest.git
synced 2026-10-28 18:07:18 +08:00
Add missing const in GTEST_TEST_BOOLEAN_.
Dropping this causes tools like [misc-const-correctness](http://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html) to flag GTEST macro invocations as non-const-correct. PiperOrigin-RevId: 958710143 Change-Id: I0f28c4bfc581e5dc9faa9158c4a0792ff546533e
This commit is contained in:
parent
51725d1111
commit
5f9ad7d401
@ -1451,13 +1451,13 @@ class [[nodiscard]] NeverThrown {
|
|||||||
// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
|
// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
|
||||||
// either a boolean expression or an AssertionResult. text is a textual
|
// either a boolean expression or an AssertionResult. text is a textual
|
||||||
// representation of expression as it was passed into the EXPECT_TRUE.
|
// representation of expression as it was passed into the EXPECT_TRUE.
|
||||||
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
|
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
|
||||||
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
|
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
|
||||||
if (::testing::internal::AssertionResultExpectation gtest_are_ = { \
|
if (const ::testing::internal::AssertionResultExpectation gtest_are_ = { \
|
||||||
::testing::AssertionResult(expression), expected}) \
|
::testing::AssertionResult(expression), expected}) \
|
||||||
; \
|
; \
|
||||||
else \
|
else /* NOLINT */ \
|
||||||
fail(::testing::internal::GetBoolAssertionFailureMessage( \
|
fail(::testing::internal::GetBoolAssertionFailureMessage( \
|
||||||
gtest_are_.assertion_result, text, #actual, #expected))
|
gtest_are_.assertion_result, text, #actual, #expected))
|
||||||
|
|
||||||
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
|
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user