diff options
author | mostynb@opera.com <mostynb@opera.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 07:31:15 +0000 |
---|---|---|
committer | mostynb@opera.com <mostynb@opera.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 07:31:15 +0000 |
commit | e5e4bfb4a6adb636c7a174099edc8e766086ca88 (patch) | |
tree | e6b66a6b5d8170187ee2975ca57e84629da8764c /base | |
parent | ab6ef0ffbffba237395ea6db27bbf3fa339b4dde (diff) | |
download | chromium_src-e5e4bfb4a6adb636c7a174099edc8e766086ca88.zip chromium_src-e5e4bfb4a6adb636c7a174099edc8e766086ca88.tar.gz chromium_src-e5e4bfb4a6adb636c7a174099edc8e766086ca88.tar.bz2 |
fix gcc 4.7 compilation errors in base_unittests
Compiling base_unittests with gcc 4.7 on linux gives these errors:
../../base/logging_unittest.cc: In member function 'virtual void logging::{anonymous}::LoggingTest_BasicLogging_Test::TestBody()':
../../base/logging_unittest.cc:68:172: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../../base/logging_unittest.cc: In member function 'virtual void logging::{anonymous}::LoggingTest_LogIsOn_Test::TestBody()':
../../base/logging_unittest.cc:123:174: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../../base/logging_unittest.cc:132:174: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../../base/logging_unittest.cc:141:174: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
Switching from EXPECT_EQ(false, something) to EXPECT_TRUE(false == something)
fixes the problem.
Review URL: https://chromiumcodereview.appspot.com/14019004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/logging_unittest.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/base/logging_unittest.cc b/base/logging_unittest.cc index 760cc24..10517a5 100644 --- a/base/logging_unittest.cc +++ b/base/logging_unittest.cc @@ -65,7 +65,7 @@ TEST_F(LoggingTest, BasicLogging) { // As of g++-4.5, the first argument to EXPECT_EQ cannot be a // constant expression. const bool kIsDebugMode = (DEBUG_MODE != 0); - EXPECT_EQ(kIsDebugMode, DLOG_IS_ON(INFO)); + EXPECT_TRUE(kIsDebugMode == DLOG_IS_ON(INFO)); EXPECT_TRUE(VLOG_IS_ON(0)); LOG(INFO) << mock_log_source.Log(); @@ -120,7 +120,7 @@ TEST_F(LoggingTest, LogIsOn) { EXPECT_FALSE(LOG_IS_ON(ERROR)); EXPECT_TRUE(LOG_IS_ON(ERROR_REPORT)); EXPECT_TRUE(LOG_IS_ON(FATAL)); - EXPECT_EQ(kDfatalIsFatal, LOG_IS_ON(DFATAL)); + EXPECT_TRUE(kDfatalIsFatal == LOG_IS_ON(DFATAL)); // LOG_IS_ON(ERROR_REPORT) should always be true. SetMinLogLevel(LOG_FATAL); @@ -129,7 +129,7 @@ TEST_F(LoggingTest, LogIsOn) { EXPECT_FALSE(LOG_IS_ON(ERROR)); EXPECT_TRUE(LOG_IS_ON(ERROR_REPORT)); EXPECT_TRUE(LOG_IS_ON(FATAL)); - EXPECT_EQ(kDfatalIsFatal, LOG_IS_ON(DFATAL)); + EXPECT_TRUE(kDfatalIsFatal == LOG_IS_ON(DFATAL)); // So should LOG_IS_ON(FATAL). SetMinLogLevel(LOG_FATAL + 1); @@ -138,7 +138,7 @@ TEST_F(LoggingTest, LogIsOn) { EXPECT_FALSE(LOG_IS_ON(ERROR)); EXPECT_TRUE(LOG_IS_ON(ERROR_REPORT)); EXPECT_TRUE(LOG_IS_ON(FATAL)); - EXPECT_EQ(kDfatalIsFatal, LOG_IS_ON(DFATAL)); + EXPECT_TRUE(kDfatalIsFatal == LOG_IS_ON(DFATAL)); } TEST_F(LoggingTest, LoggingIsLazy) { |