Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: base/logging_unittest.cc

Issue 6691021: As of g++-4.5, the first argument to EXPECT_EQ cannot be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace logging { 11 namespace logging {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const int kExpectedDebugOrReleaseCalls = 6; 55 const int kExpectedDebugOrReleaseCalls = 6;
56 const int kExpectedDebugCalls = 6; 56 const int kExpectedDebugCalls = 6;
57 const int kExpectedCalls = 57 const int kExpectedCalls =
58 kExpectedDebugOrReleaseCalls + (DEBUG_MODE ? kExpectedDebugCalls : 0); 58 kExpectedDebugOrReleaseCalls + (DEBUG_MODE ? kExpectedDebugCalls : 0);
59 EXPECT_CALL(mock_log_source, Log()).Times(kExpectedCalls). 59 EXPECT_CALL(mock_log_source, Log()).Times(kExpectedCalls).
60 WillRepeatedly(Return("log message")); 60 WillRepeatedly(Return("log message"));
61 61
62 SetMinLogLevel(LOG_INFO); 62 SetMinLogLevel(LOG_INFO);
63 63
64 EXPECT_TRUE(LOG_IS_ON(INFO)); 64 EXPECT_TRUE(LOG_IS_ON(INFO));
65 EXPECT_EQ(DEBUG_MODE != 0, DLOG_IS_ON(INFO)); 65 // As of g++-4.5, the first argument to EXPECT_EQ cannot be a
66 // constant expression.
67 const bool kIsDebugMode = (DEBUG_MODE != 0);
68 EXPECT_EQ(kIsDebugMode, DLOG_IS_ON(INFO));
66 EXPECT_TRUE(VLOG_IS_ON(0)); 69 EXPECT_TRUE(VLOG_IS_ON(0));
67 70
68 LOG(INFO) << mock_log_source.Log(); 71 LOG(INFO) << mock_log_source.Log();
69 LOG_IF(INFO, true) << mock_log_source.Log(); 72 LOG_IF(INFO, true) << mock_log_source.Log();
70 PLOG(INFO) << mock_log_source.Log(); 73 PLOG(INFO) << mock_log_source.Log();
71 PLOG_IF(INFO, true) << mock_log_source.Log(); 74 PLOG_IF(INFO, true) << mock_log_source.Log();
72 VLOG(0) << mock_log_source.Log(); 75 VLOG(0) << mock_log_source.Log();
73 VLOG_IF(0, true) << mock_log_source.Log(); 76 VLOG_IF(0, true) << mock_log_source.Log();
74 77
75 DLOG(INFO) << mock_log_source.Log(); 78 DLOG(INFO) << mock_log_source.Log();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // These should still reference |some_variable| so we don't get 241 // These should still reference |some_variable| so we don't get
239 // unused variable warnings. 242 // unused variable warnings.
240 DCHECK(some_variable) << "test"; 243 DCHECK(some_variable) << "test";
241 DPCHECK(some_variable) << "test"; 244 DPCHECK(some_variable) << "test";
242 DCHECK_EQ(some_variable, 1) << "test"; 245 DCHECK_EQ(some_variable, 1) << "test";
243 } 246 }
244 247
245 } // namespace 248 } // namespace
246 249
247 } // namespace logging 250 } // namespace logging
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698