diff options
Diffstat (limited to 'test/gtest_unittest.cc')
-rw-r--r-- | test/gtest_unittest.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc index 89a4a0e7..1069ecf8 100644 --- a/test/gtest_unittest.cc +++ b/test/gtest_unittest.cc @@ -322,13 +322,11 @@ TEST(NullLiteralTest, IsTrueForNullLiterals) { EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(0)); EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(0U)); EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(0L)); - EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(false)); #ifndef __BORLANDC__ // Some compilers may fail to detect some null pointer literals; // as long as users of the framework don't use such literals, this // is harmless. EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(1 - 1)); - EXPECT_TRUE(GTEST_IS_NULL_LITERAL_(true && false)); #endif } @@ -3731,7 +3729,8 @@ TEST(AssertionTest, ASSERT_ANY_THROW) { // compile. TEST(AssertionTest, AssertPrecedence) { ASSERT_EQ(1 < 2, true); - ASSERT_EQ(true && false, false); + bool false_value = false; + ASSERT_EQ(true && false_value, false); } // A subroutine used by the following test. @@ -4220,7 +4219,7 @@ TEST(ExpectTest, EXPECT_EQ_Double) { TEST(ExpectTest, EXPECT_EQ_NULL) { // A success. const char* p = NULL; - // Some older GCC versions may issue a spurious waring in this or the next + // Some older GCC versions may issue a spurious warning in this or the next // assertion statement. This warning should not be suppressed with // static_cast since the test verifies the ability to use bare NULL as the // expected parameter to the macro. @@ -4490,8 +4489,10 @@ TEST(MacroTest, SUCCEED) { // Tests using bool values in {EXPECT|ASSERT}_EQ. TEST(EqAssertionTest, Bool) { EXPECT_EQ(true, true); - EXPECT_FATAL_FAILURE(ASSERT_EQ(false, true), - "Value of: true"); + EXPECT_FATAL_FAILURE({ + bool false_value = false; + ASSERT_EQ(false_value, true); + }, "Value of: true"); } // Tests using int values in {EXPECT|ASSERT}_EQ. @@ -6470,8 +6471,9 @@ TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) { // Verifies that StaticAssertTypeEq works in a namespace scope. -static bool dummy1 = StaticAssertTypeEq<bool, bool>(); -static bool dummy2 = StaticAssertTypeEq<const int, const int>(); +static bool dummy1 GTEST_ATTRIBUTE_UNUSED_ = StaticAssertTypeEq<bool, bool>(); +static bool dummy2 GTEST_ATTRIBUTE_UNUSED_ = + StaticAssertTypeEq<const int, const int>(); // Verifies that StaticAssertTypeEq works in a class. |