From 998e6d91635700a930df814eacd4bcb9322ccb9f Mon Sep 17 00:00:00 2001 From: "jeffbailey@chromium.org" Date: Sat, 2 Apr 2011 21:13:21 +0000 Subject: As of g++-4.5, the first argument to EXPECT_EQ cannot be a constant expression. Credit: Jeffrey Yasskin, Google. Review URL: http://codereview.chromium.org/6691021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80270 0039d316-1c4b-4281-b951-d872f2087c98 --- base/logging_unittest.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/logging_unittest.cc b/base/logging_unittest.cc index bb6e3d1..5a2cb53 100644 --- a/base/logging_unittest.cc +++ b/base/logging_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -62,7 +62,10 @@ TEST_F(LoggingTest, BasicLogging) { SetMinLogLevel(LOG_INFO); EXPECT_TRUE(LOG_IS_ON(INFO)); - EXPECT_EQ(DEBUG_MODE != 0, DLOG_IS_ON(INFO)); + // 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(VLOG_IS_ON(0)); LOG(INFO) << mock_log_source.Log(); -- cgit v1.1