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

Side by Side Diff: base/strings/utf_string_conversions_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "base/strings/string_piece.h" 7 #include "base/strings/string_piece.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/googletest/include/gtest/gtest.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 namespace { 14 namespace {
15 15
16 const wchar_t* const kConvertRoundtripCases[] = { 16 const wchar_t* const kConvertRoundtripCases[] = {
17 L"Google Video", 17 L"Google Video",
18 // "网页 图片 资讯更多 »" 18 // "网页 图片 资讯更多 »"
19 L"\x7f51\x9875\x0020\x56fe\x7247\x0020\x8d44\x8baf\x66f4\x591a\x0020\x00bb", 19 L"\x7f51\x9875\x0020\x56fe\x7247\x0020\x8d44\x8baf\x66f4\x591a\x0020\x00bb",
20 // "Παγκόσμιος Ιστός" 20 // "Παγκόσμιος Ιστός"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 EXPECT_EQ(arraysize(multi16) - 1, multistring16.length()); 203 EXPECT_EQ(arraysize(multi16) - 1, multistring16.length());
204 std::string expected; 204 std::string expected;
205 memcpy(WriteInto(&expected, arraysize(multi)), multi, sizeof(multi)); 205 memcpy(WriteInto(&expected, arraysize(multi)), multi, sizeof(multi));
206 EXPECT_EQ(arraysize(multi) - 1, expected.length()); 206 EXPECT_EQ(arraysize(multi) - 1, expected.length());
207 const std::string& converted = UTF16ToUTF8(multistring16); 207 const std::string& converted = UTF16ToUTF8(multistring16);
208 EXPECT_EQ(arraysize(multi) - 1, converted.length()); 208 EXPECT_EQ(arraysize(multi) - 1, converted.length());
209 EXPECT_EQ(expected, converted); 209 EXPECT_EQ(expected, converted);
210 } 210 }
211 211
212 } // namespace base 212 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/utf_offset_string_conversions_unittest.cc ('k') | base/supports_user_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698