summaryrefslogtreecommitdiffstats
path: root/base/string_util_unittest.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 20:27:57 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 20:27:57 +0000
commite6da5e1fb081aeb82ea9a95e400e320df19e0255 (patch)
tree424914e838ec1cf59bd1c7814dc93937a71374cf /base/string_util_unittest.cc
parent09ad1e629a88f99d2e93797304f4a6060915e228 (diff)
downloadchromium_src-e6da5e1fb081aeb82ea9a95e400e320df19e0255.zip
chromium_src-e6da5e1fb081aeb82ea9a95e400e320df19e0255.tar.gz
chromium_src-e6da5e1fb081aeb82ea9a95e400e320df19e0255.tar.bz2
Add UTF-16 <-> Wide conversions for Mac.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util_unittest.cc')
-rw-r--r--base/string_util_unittest.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc
index 1112676..837e000 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -183,11 +183,6 @@ TEST(StringUtilTest, ConvertUTF8AndWideEmptyString) {
EXPECT_EQ(wempty, UTF8ToWide(empty));
}
-// This tests the current behavior of our UTF-8/UTF-16 conversion. On Windows,
-// we just use the platform functions which strip invalid characters. This isn't
-// necessarily the best behavior, we may want to write our own converter using
-// ICU to get more customized results (for example, substituting the
-// "replacement character" U+FFFD for invalid sequences.
TEST(StringUtilTest, ConvertUTF8ToWide) {
struct UTF8ToWideCase {
const char* utf8;
@@ -206,7 +201,7 @@ TEST(StringUtilTest, ConvertUTF8ToWide) {
{"\xf0\x84\xbd\xa0\xe5\xa5\xbd", L"\x597d", false},
// This UTF-8 character decodes to a UTF-16 surrogate, which is illegal.
{"\xed\xb0\x80", L"", false},
- // Non-BMP character. The result will either be in UTF-16 or UCS-4.
+ // Non-BMP character. The result will either be in UTF-16 or UTF-32.
#if defined(WCHAR_T_IS_UTF16)
{"A\xF0\x90\x8C\x80z", L"A\xd800\xdf00z", true},
#elif defined(WCHAR_T_IS_UTF32)
@@ -270,8 +265,8 @@ TEST(StringUtilTest, ConvertUTF16ToUTF8) {
}
#elif defined(WCHAR_T_IS_UTF32)
-// This test is only valid when wchar_t == UCS-4.
-TEST(StringUtilTest, ConvertUCS4ToUTF8) {
+// This test is only valid when wchar_t == UTF-32.
+TEST(StringUtilTest, ConvertUTF32ToUTF8) {
struct UTF8ToWideCase {
const wchar_t* ucs4;
const char* utf8;