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

Side by Side Diff: components/proximity_auth/logging/logging_unittest.cc

Issue 2110663002: components: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+one fix Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/proximity_auth/logging/logging.h" 5 #include "components/proximity_auth/logging/logging.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 private: 52 private:
53 logging::LogMessageHandlerFunction previous_handler_; 53 logging::LogMessageHandlerFunction previous_handler_;
54 }; 54 };
55 55
56 TEST_F(ProximityAuthLoggingTest, LogsSavedToBuffer) { 56 TEST_F(ProximityAuthLoggingTest, LogsSavedToBuffer) {
57 int base_line_number = __LINE__; 57 int base_line_number = __LINE__;
58 PA_LOG(INFO) << kLog1; 58 PA_LOG(INFO) << kLog1;
59 PA_LOG(WARNING) << kLog2; 59 PA_LOG(WARNING) << kLog2;
60 PA_LOG(ERROR) << kLog3; 60 PA_LOG(ERROR) << kLog3;
61 61
62 auto logs = LogBuffer::GetInstance()->logs(); 62 auto* logs = LogBuffer::GetInstance()->logs();
63 ASSERT_EQ(3u, logs->size()); 63 ASSERT_EQ(3u, logs->size());
64 64
65 auto iterator = logs->begin(); 65 auto iterator = logs->begin();
66 const LogBuffer::LogMessage& log_message1 = *iterator; 66 const LogBuffer::LogMessage& log_message1 = *iterator;
67 EXPECT_EQ(kLog1, log_message1.text); 67 EXPECT_EQ(kLog1, log_message1.text);
68 EXPECT_EQ(__FILE__, log_message1.file); 68 EXPECT_EQ(__FILE__, log_message1.file);
69 EXPECT_EQ(base_line_number + 1, log_message1.line); 69 EXPECT_EQ(base_line_number + 1, log_message1.line);
70 EXPECT_EQ(logging::LOG_INFO, log_message1.severity); 70 EXPECT_EQ(logging::LOG_INFO, log_message1.severity);
71 71
72 ++iterator; 72 ++iterator;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 PA_LOG(WARNING) << kLog2; 110 PA_LOG(WARNING) << kLog2;
111 PA_LOG(ERROR) << kLog3; 111 PA_LOG(ERROR) << kLog3;
112 112
113 ASSERT_EQ(3u, g_standard_logs.Get().size()); 113 ASSERT_EQ(3u, g_standard_logs.Get().size());
114 EXPECT_NE(std::string::npos, g_standard_logs.Get()[0].find(kLog1)); 114 EXPECT_NE(std::string::npos, g_standard_logs.Get()[0].find(kLog1));
115 EXPECT_NE(std::string::npos, g_standard_logs.Get()[1].find(kLog2)); 115 EXPECT_NE(std::string::npos, g_standard_logs.Get()[1].find(kLog2));
116 EXPECT_NE(std::string::npos, g_standard_logs.Get()[2].find(kLog3)); 116 EXPECT_NE(std::string::npos, g_standard_logs.Get()[2].find(kLog3));
117 } 117 }
118 118
119 } // namespace proximity_auth 119 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698