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

Side by Side Diff: base/string16_unittest.cc

Issue 4966001: Apparently we weren't running this unittest.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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/base.gyp ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/string16.h" 7 #include "base/string16.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 25 matching lines...) Expand all
36 surrogate_pair.push_back(0xdf00); 36 surrogate_pair.push_back(0xdf00);
37 surrogate_pair.push_back('z'); 37 surrogate_pair.push_back('z');
38 38
39 // Will get converted to the invalid char + 's': EF BF BD 's'. 39 // Will get converted to the invalid char + 's': EF BF BD 's'.
40 string16 unterminated_surrogate; 40 string16 unterminated_surrogate;
41 unterminated_surrogate.push_back(0xd800); 41 unterminated_surrogate.push_back(0xd800);
42 unterminated_surrogate.push_back('s'); 42 unterminated_surrogate.push_back('s');
43 43
44 std::ostringstream stream; 44 std::ostringstream stream;
45 stream << initial_surrogate << "," << final_surrogate << "," 45 stream << initial_surrogate << "," << final_surrogate << ","
46 << surrogate_pair << ",", unterminated_surrogate; 46 << surrogate_pair << "," << unterminated_surrogate;
47 47
48 EXPECT_STREQ("\xef\xbf\xbd,\xef\xbf\xbd,\xf0\x90\x8c\x80z,\xef\xbf\xbds", 48 EXPECT_STREQ("\xef\xbf\xbd,\xef\xbf\xbd,\xf0\x90\x8c\x80z,\xef\xbf\xbds",
49 stream.str().c_str()); 49 stream.str().c_str());
50 } 50 }
51 } 51 }
52 52
53 #endif 53 #endif
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698