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

Side by Side Diff: base/i18n/char_iterator_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « base/files/file_path.cc ('k') | base/json/json_value_serializer_unittest.cc » ('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) 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 "base/i18n/char_iterator.h" 5 #include "base/i18n/char_iterator.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace base { 10 namespace base {
11 namespace i18n { 11 namespace i18n {
12 12
13 TEST(CharIteratorsTest, TestUTF8) { 13 TEST(CharIteratorsTest, TestUTF8) {
14 std::string empty(""); 14 std::string empty;
15 UTF8CharIterator empty_iter(&empty); 15 UTF8CharIterator empty_iter(&empty);
16 ASSERT_TRUE(empty_iter.end()); 16 ASSERT_TRUE(empty_iter.end());
17 ASSERT_EQ(0, empty_iter.array_pos()); 17 ASSERT_EQ(0, empty_iter.array_pos());
18 ASSERT_EQ(0, empty_iter.char_pos()); 18 ASSERT_EQ(0, empty_iter.char_pos());
19 ASSERT_FALSE(empty_iter.Advance()); 19 ASSERT_FALSE(empty_iter.Advance());
20 20
21 std::string str("s\303\273r"); // [u with circumflex] 21 std::string str("s\303\273r"); // [u with circumflex]
22 UTF8CharIterator iter(&str); 22 UTF8CharIterator iter(&str);
23 ASSERT_FALSE(iter.end()); 23 ASSERT_FALSE(iter.end());
24 ASSERT_EQ(0, iter.array_pos()); 24 ASSERT_EQ(0, iter.array_pos());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ASSERT_EQ(4, iter.char_pos()); 92 ASSERT_EQ(4, iter.char_pos());
93 93
94 // Don't care what it returns, but this shouldn't crash 94 // Don't care what it returns, but this shouldn't crash
95 iter.get(); 95 iter.get();
96 96
97 ASSERT_FALSE(iter.Advance()); 97 ASSERT_FALSE(iter.Advance());
98 } 98 }
99 99
100 } // namespace i18n 100 } // namespace i18n
101 } // namespace base 101 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path.cc ('k') | base/json/json_value_serializer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698