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

Side by Side Diff: chrome/browser/sync/util/character_set_converters_unittest.cc

Issue 429003: Final part of PathString cleanup. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/util/character_set_converters.h"
6
7 #include <string>
8
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 using std::string;
12
13 class CharacterSetConverterTest : public testing::Test {
14 };
15
16 TEST(NameTruncation, WindowsNameTruncation) {
17 using browser_sync::TrimPathStringToValidCharacter;
18 char array[] = {'1', '2', '\xc0', '\xe0', '3', '4', '\0'};
19 std::string message(array);
20 ASSERT_EQ(message.length(), arraysize(array) - 1);
21 string::size_type old_length = message.length();
22 while (old_length != 0) {
23 TrimPathStringToValidCharacter(&message);
24 if (old_length == 4)
25 EXPECT_EQ(3u, message.length());
26 else
27 EXPECT_EQ(old_length, message.length());
28 message.resize(message.length() - 1);
29 old_length = message.length();
30 }
31 TrimPathStringToValidCharacter(&message);
32 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/util/character_set_converters.cc ('k') | chrome/browser/sync/util/query_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698