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

Side by Side Diff: base/sys_string_conversions_unittest.cc

Issue 552004: Style cleanup in preparation for auto-linting base/. (Closed)
Patch Set: Created 10 years, 11 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
« no previous file with comments | « base/sync_socket_posix.cc ('k') | base/test/perf_test_suite.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <locale.h> 5 #include <locale.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 expected_null.push_back('b'); 71 expected_null.push_back('b');
72 72
73 EXPECT_EQ(expected_null, SysUTF8ToWide(utf8_null)); 73 EXPECT_EQ(expected_null, SysUTF8ToWide(utf8_null));
74 } 74 }
75 75
76 #if defined(OS_LINUX) // Tests depend on setting a specific Linux locale. 76 #if defined(OS_LINUX) // Tests depend on setting a specific Linux locale.
77 namespace { 77 namespace {
78 78
79 class ScopedSetLocale { 79 class ScopedSetLocale {
80 public: 80 public:
81 ScopedSetLocale(const char* locale) { 81 explicit ScopedSetLocale(const char* locale) {
82 old_locale_ = setlocale(LC_ALL, NULL); 82 old_locale_ = setlocale(LC_ALL, NULL);
83 setlocale(LC_ALL, locale); 83 setlocale(LC_ALL, locale);
84 } 84 }
85 ~ScopedSetLocale() { 85 ~ScopedSetLocale() {
86 setlocale(LC_ALL, old_locale_.c_str()); 86 setlocale(LC_ALL, old_locale_.c_str());
87 } 87 }
88 88
89 private: 89 private:
90 std::string old_locale_; 90 std::string old_locale_;
91 }; 91 };
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 for (size_t i = 0; i < arraysize(kConvertRoundtripCases); ++i) { 198 for (size_t i = 0; i < arraysize(kConvertRoundtripCases); ++i) {
199 std::wstring wide = kConvertRoundtripCases[i]; 199 std::wstring wide = kConvertRoundtripCases[i];
200 std::wstring trip = UTF8ToWide(base::SysWideToNativeMB(wide)); 200 std::wstring trip = UTF8ToWide(base::SysWideToNativeMB(wide));
201 EXPECT_EQ(wide.size(), trip.size()); 201 EXPECT_EQ(wide.size(), trip.size());
202 EXPECT_EQ(wide, trip); 202 EXPECT_EQ(wide, trip);
203 } 203 }
204 } 204 }
205 #endif // OS_LINUX 205 #endif // OS_LINUX
OLDNEW
« no previous file with comments | « base/sync_socket_posix.cc ('k') | base/test/perf_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698