| OLD | NEW |
| 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/test/scoped_locale.h" | 11 #include "base/test/scoped_locale.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/googletest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 #ifdef WCHAR_T_IS_UTF32 | 14 #ifdef WCHAR_T_IS_UTF32 |
| 15 static const std::wstring kSysWideOldItalicLetterA = L"\x10300"; | 15 static const std::wstring kSysWideOldItalicLetterA = L"\x10300"; |
| 16 #else | 16 #else |
| 17 static const std::wstring kSysWideOldItalicLetterA = L"\xd800\xdf00"; | 17 static const std::wstring kSysWideOldItalicLetterA = L"\xd800\xdf00"; |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 | 21 |
| 22 TEST(SysStrings, SysWideToUTF8) { | 22 TEST(SysStrings, SysWideToUTF8) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 for (size_t i = 0; i < arraysize(kConvertRoundtripCases); ++i) { | 184 for (size_t i = 0; i < arraysize(kConvertRoundtripCases); ++i) { |
| 185 std::wstring wide = kConvertRoundtripCases[i]; | 185 std::wstring wide = kConvertRoundtripCases[i]; |
| 186 std::wstring trip = UTF8ToWide(SysWideToNativeMB(wide)); | 186 std::wstring trip = UTF8ToWide(SysWideToNativeMB(wide)); |
| 187 EXPECT_EQ(wide.size(), trip.size()); | 187 EXPECT_EQ(wide.size(), trip.size()); |
| 188 EXPECT_EQ(wide, trip); | 188 EXPECT_EQ(wide, trip); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 #endif // OS_LINUX | 191 #endif // OS_LINUX |
| 192 | 192 |
| 193 } // namespace base | 193 } // namespace base |
| OLD | NEW |