diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 01:43:15 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 01:43:15 +0000 |
commit | 2500a0f7c4ac54a55d621069dc044ddc6702a518 (patch) | |
tree | 960a571bb2b49c9005fd152138e4398df9072854 /base/utf_string_conversions_unittest.cc | |
parent | 0d435eae98fbe4f8055215a7aa6c483b07b7fa03 (diff) | |
download | chromium_src-2500a0f7c4ac54a55d621069dc044ddc6702a518.zip chromium_src-2500a0f7c4ac54a55d621069dc044ddc6702a518.tar.gz chromium_src-2500a0f7c4ac54a55d621069dc044ddc6702a518.tar.bz2 |
Clean up recent string conversion function changes, part 1: Remove unnecessary code. Thanks to a change in escape.cc I can basically revert the ICU conversions back to what they used to be; I can also get rid of half the conversions immediately since they aren't used.
This does not split out the "adjust" versions of the UTF conversions into their own header/implementation; that's coming in the next patch.
BUG=4010
TEST=none
Review URL: http://codereview.chromium.org/380007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/utf_string_conversions_unittest.cc')
-rw-r--r-- | base/utf_string_conversions_unittest.cc | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/base/utf_string_conversions_unittest.cc b/base/utf_string_conversions_unittest.cc index 67af7c3..ca79ec5 100644 --- a/base/utf_string_conversions_unittest.cc +++ b/base/utf_string_conversions_unittest.cc @@ -227,32 +227,12 @@ TEST(UTFStringConversionsTest, ConvertMultiString) { } TEST(UTFStringConversionsTest, AdjustOffset) { - // Under the hood, all the functions call the same converter function, so we - // don't need to exhaustively check every case. - struct WideToUTF8Case { - const wchar_t* wide; - size_t input_offset; - size_t output_offset; - } wide_to_utf8_cases[] = { - {L"", 0, std::string::npos}, - {L"\x4f60\x597d", 0, 0}, - {L"\x4f60\x597d", 1, 3}, - {L"\x4f60\x597d", 2, std::string::npos}, - {L"\x4f60\x597d", std::wstring::npos, std::string::npos}, - {L"\xd800\x597dz", 1, 0}, - {L"\xd800\x597dz", 2, 3}, - }; - for (size_t i = 0; i < ARRAYSIZE_UNSAFE(wide_to_utf8_cases); ++i) { - size_t offset = wide_to_utf8_cases[i].input_offset; - WideToUTF8AndAdjustOffset(wide_to_utf8_cases[i].wide, &offset); - EXPECT_EQ(wide_to_utf8_cases[i].output_offset, offset); - } - 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}, @@ -271,20 +251,6 @@ TEST(UTFStringConversionsTest, AdjustOffset) { } #if defined(WCHAR_T_IS_UTF32) - struct WideToUTF16Case { - const wchar_t* wide; - size_t input_offset; - size_t output_offset; - } wide_to_utf16_cases[] = { - {L"\x4F60\x597D", 1, 1}, - {L"\x20000\x4E00", 1, 2}, - }; - for (size_t i = 0; i < ARRAYSIZE_UNSAFE(wide_to_utf16_cases); ++i) { - size_t offset = wide_to_utf16_cases[i].input_offset; - WideToUTF16AndAdjustOffset(wide_to_utf16_cases[i].wide, &offset); - EXPECT_EQ(wide_to_utf16_cases[i].output_offset, offset); - } - struct UTF16ToWideCase { const wchar_t* wide; size_t input_offset; |