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

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

Issue 100303003: Move more uses of string16 to specify base:: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « base/strings/string16.cc ('k') | base/strings/string_util.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <sstream> 5 #include <sstream>
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 8
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/include/gtest/gtest.h"
11 11
12 namespace base {
13
12 #if defined(WCHAR_T_IS_UTF32) 14 #if defined(WCHAR_T_IS_UTF32)
13 15
14 // We define a custom operator<< for string16 so we can use it with logging. 16 // We define a custom operator<< for string16 so we can use it with logging.
15 // This tests that conversion. 17 // This tests that conversion.
16 TEST(String16Test, OutputStream) { 18 TEST(String16Test, OutputStream) {
17 // Basic stream test. 19 // Basic stream test.
18 { 20 {
19 std::ostringstream stream; 21 std::ostringstream stream;
20 stream << "Empty '" << string16() << "' standard '" 22 stream << "Empty '" << string16() << "' standard '"
21 << string16(ASCIIToUTF16("Hello, world")) << "'"; 23 << string16(ASCIIToUTF16("Hello, world")) << "'";
(...skipping 23 matching lines...) Expand all
45 std::ostringstream stream; 47 std::ostringstream stream;
46 stream << initial_surrogate << "," << final_surrogate << "," 48 stream << initial_surrogate << "," << final_surrogate << ","
47 << surrogate_pair << "," << unterminated_surrogate; 49 << surrogate_pair << "," << unterminated_surrogate;
48 50
49 EXPECT_STREQ("\xef\xbf\xbd,\xef\xbf\xbd,\xf0\x90\x8c\x80z,\xef\xbf\xbds", 51 EXPECT_STREQ("\xef\xbf\xbd,\xef\xbf\xbd,\xf0\x90\x8c\x80z,\xef\xbf\xbds",
50 stream.str().c_str()); 52 stream.str().c_str());
51 } 53 }
52 } 54 }
53 55
54 #endif 56 #endif
57
58 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/string16.cc ('k') | base/strings/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698