From a66bcb534d90072cf91ab80470db224c95532621 Mon Sep 17 00:00:00 2001 From: Abhi10111 Date: Wed, 7 Jan 2026 20:14:55 +0000 Subject: [PATCH] fix "ASSERT_FALSE and ASSERT_TRUE const propagation inconsistencies lead to differing failure results" Signed-off-by: Abhi10111 --- googletest/include/gtest/gtest.h | 2 +- googletest/include/gtest/internal/gtest-internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index b63685380..68f2fe1dc 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -1812,7 +1812,7 @@ class [[nodiscard]] TestWithParam : public Test, GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ GTEST_NONFATAL_FAILURE_) #define GTEST_EXPECT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ + GTEST_TEST_BOOLEAN_(condition, #condition, true, false, \ GTEST_NONFATAL_FAILURE_) #define GTEST_ASSERT_TRUE(condition) \ GTEST_TEST_BOOLEAN_(condition, #condition, false, true, GTEST_FATAL_FAILURE_) diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index 4379137d7..e50e2491c 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -1448,7 +1448,7 @@ class [[nodiscard]] NeverThrown { #define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ if (const ::testing::AssertionResult gtest_ar_ = \ - ::testing::AssertionResult(expression)) \ + ::testing::AssertionResult(expression); gtest_ar_==expected) \ ; \ else \ fail(::testing::internal::GetBoolAssertionFailureMessage( \