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

Unified Diff: base/utf_string_conversions_unittest.cc

Issue 387012: Split *AndAdjustOffset() functions into their own header, to restore utf_stri... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/utf_string_conversions.cc ('k') | net/base/escape.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/utf_string_conversions_unittest.cc
===================================================================
--- base/utf_string_conversions_unittest.cc (revision 31533)
+++ base/utf_string_conversions_unittest.cc (working copy)
@@ -226,47 +226,4 @@
EXPECT_EQ(expected, converted);
}
-TEST(UTFStringConversionsTest, AdjustOffset) {
- struct UTF8ToWideCase {
- const char* utf8;
- size_t input_offset;
- size_t output_offset;
- } utf8_to_wide_cases[] = {
- {"", 0, std::wstring::npos},
- {"\xe4\xbd\xa0\xe5\xa5\xbd", 1, std::wstring::npos},
- {"\xe4\xbd\xa0\xe5\xa5\xbd", 3, 1},
- {"\xed\xb0\x80z", 3, 0},
- {"A\xF0\x90\x8C\x80z", 1, 1},
- {"A\xF0\x90\x8C\x80z", 2, std::wstring::npos},
-#if defined(WCHAR_T_IS_UTF16)
- {"A\xF0\x90\x8C\x80z", 5, 3},
-#elif defined(WCHAR_T_IS_UTF32)
- {"A\xF0\x90\x8C\x80z", 5, 2},
-#endif
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(utf8_to_wide_cases); ++i) {
- size_t offset = utf8_to_wide_cases[i].input_offset;
- UTF8ToWideAndAdjustOffset(utf8_to_wide_cases[i].utf8, &offset);
- EXPECT_EQ(utf8_to_wide_cases[i].output_offset, offset);
- }
-
-#if defined(WCHAR_T_IS_UTF32)
- struct UTF16ToWideCase {
- const wchar_t* wide;
- size_t input_offset;
- size_t output_offset;
- } utf16_to_wide_cases[] = {
- {L"\xD840\xDC00\x4E00", 0, 0},
- {L"\xD840\xDC00\x4E00", 1, std::wstring::npos},
- {L"\xD840\xDC00\x4E00", 2, 1},
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(utf16_to_wide_cases); ++i) {
- size_t offset = utf16_to_wide_cases[i].input_offset;
- UTF16ToWideAndAdjustOffset(BuildString16(utf16_to_wide_cases[i].wide),
- &offset);
- EXPECT_EQ(utf16_to_wide_cases[i].output_offset, offset);
- }
-#endif
-}
-
} // namaspace base
« no previous file with comments | « base/utf_string_conversions.cc ('k') | net/base/escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698