OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "mojo/public/cpp/environment/environment.h" | 10 #include "mojo/public/cpp/environment/environment.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 int member; | 24 int member; |
25 }; | 25 }; |
26 | 26 |
27 bool DcheckTestHelper(bool* was_called) { | 27 bool DcheckTestHelper(bool* was_called) { |
28 *was_called = true; | 28 *was_called = true; |
29 return false; | 29 return false; |
30 } | 30 } |
31 | 31 |
32 class LoggingTest : public testing::Test { | 32 class LoggingTest : public testing::Test { |
33 public: | 33 public: |
34 LoggingTest() : environment_(NULL, &kMockLogger) { | 34 LoggingTest() : environment_(nullptr, &kMockLogger) { |
35 minimum_log_level_ = MOJO_LOG_LEVEL_INFO; | 35 minimum_log_level_ = MOJO_LOG_LEVEL_INFO; |
36 ResetMockLogger(); | 36 ResetMockLogger(); |
37 } | 37 } |
38 virtual ~LoggingTest() {} | 38 virtual ~LoggingTest() {} |
39 | 39 |
40 protected: | 40 protected: |
41 // Note: Does not reset |minimum_log_level_|. | 41 // Note: Does not reset |minimum_log_level_|. |
42 static void ResetMockLogger() { | 42 static void ResetMockLogger() { |
43 log_message_was_called_ = false; | 43 log_message_was_called_ = false; |
44 last_log_level_ = MOJO_LOG_LEVEL_INFO; | 44 last_log_level_ = MOJO_LOG_LEVEL_INFO; |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 ResetMockLogger(); | 465 ResetMockLogger(); |
466 | 466 |
467 // Also try to make sure that we parenthesize the condition properly. | 467 // Also try to make sure that we parenthesize the condition properly. |
468 bool x = true; | 468 bool x = true; |
469 MOJO_DCHECK(false || x) << "hello"; | 469 MOJO_DCHECK(false || x) << "hello"; |
470 EXPECT_FALSE(log_message_was_called()); | 470 EXPECT_FALSE(log_message_was_called()); |
471 } | 471 } |
472 | 472 |
473 } // namespace | 473 } // namespace |
474 } // namespace mojo | 474 } // namespace mojo |
OLD | NEW |