summaryrefslogtreecommitdiffstats
path: root/base/i18n/rtl_unittest.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-25 21:12:06 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-25 21:12:06 +0000
commitbd59d07bba31ad0db0e7b3be96a3462381a2f50a (patch)
tree934f028bdb9768b30f1eafd6d9d81e04a53b25f7 /base/i18n/rtl_unittest.cc
parent938d6a34f7b50e7c9beb588a2a4b34adb03dcf15 (diff)
downloadchromium_src-bd59d07bba31ad0db0e7b3be96a3462381a2f50a.zip
chromium_src-bd59d07bba31ad0db0e7b3be96a3462381a2f50a.tar.gz
chromium_src-bd59d07bba31ad0db0e7b3be96a3462381a2f50a.tar.bz2
wstring: remove wstring functions from base/i18n/rtl.h
And update callers. BUG=23581 Review URL: http://codereview.chromium.org/6883140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/i18n/rtl_unittest.cc')
-rw-r--r--base/i18n/rtl_unittest.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/base/i18n/rtl_unittest.cc b/base/i18n/rtl_unittest.cc
index 3ee8254..e3d0f5d 100644
--- a/base/i18n/rtl_unittest.cc
+++ b/base/i18n/rtl_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -24,73 +24,73 @@ class RTLTest : public PlatformTest {
TEST_F(RTLTest, GetFirstStrongCharacterDirection) {
// Test pure LTR string.
- std::wstring string(L"foo bar");
+ string16 string(ASCIIToUTF16("foo bar"));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type L.
- string.assign(L"foo \x05d0 bar");
+ string.assign(WideToUTF16(L"foo \x05d0 bar"));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type R.
- string.assign(L"\x05d0 foo bar");
+ string.assign(WideToUTF16(L"\x05d0 foo bar"));
EXPECT_EQ(base::i18n::RIGHT_TO_LEFT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string which starts with a character with weak directionality
// and in which the first character with strong directionality is a character
// with type L.
- string.assign(L"!foo \x05d0 bar");
+ string.assign(WideToUTF16(L"!foo \x05d0 bar"));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string which starts with a character with weak directionality
// and in which the first character with strong directionality is a character
// with type R.
- string.assign(L",\x05d0 foo bar");
+ string.assign(WideToUTF16(L",\x05d0 foo bar"));
EXPECT_EQ(base::i18n::RIGHT_TO_LEFT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type LRE.
- string.assign(L"\x202a \x05d0 foo bar");
+ string.assign(WideToUTF16(L"\x202a \x05d0 foo bar"));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type LRO.
- string.assign(L"\x202d \x05d0 foo bar");
+ string.assign(WideToUTF16(L"\x202d \x05d0 foo bar"));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type RLE.
- string.assign(L"\x202b foo \x05d0 bar");
+ string.assign(WideToUTF16(L"\x202b foo \x05d0 bar"));
EXPECT_EQ(base::i18n::RIGHT_TO_LEFT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type RLO.
- string.assign(L"\x202e foo \x05d0 bar");
+ string.assign(WideToUTF16(L"\x202e foo \x05d0 bar"));
EXPECT_EQ(base::i18n::RIGHT_TO_LEFT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test bidi string in which the first character with strong directionality
// is a character with type AL.
- string.assign(L"\x0622 foo \x05d0 bar");
+ string.assign(WideToUTF16(L"\x0622 foo \x05d0 bar"));
EXPECT_EQ(base::i18n::RIGHT_TO_LEFT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test a string without strong directionality characters.
- string.assign(L",!.{}");
+ string.assign(ASCIIToUTF16(",!.{}"));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
// Test empty string.
- string.assign(L"");
+ string.assign(ASCIIToUTF16(""));
EXPECT_EQ(base::i18n::LEFT_TO_RIGHT,
base::i18n::GetFirstStrongCharacterDirection(string));
@@ -98,9 +98,9 @@ TEST_F(RTLTest, GetFirstStrongCharacterDirection) {
// http://demo.icu-project.org/icu-bin/ubrowse?scr=151&b=10910 for more
// information).
#if defined(WCHAR_T_IS_UTF32)
- string.assign(L" ! \x10910" L"abc 123");
+ string.assign(WideToUTF16(L" ! \x10910" L"abc 123"));
#elif defined(WCHAR_T_IS_UTF16)
- string.assign(L" ! \xd802\xdd10" L"abc 123");
+ string.assign(WideToUTF16(L" ! \xd802\xdd10" L"abc 123"));
#else
#error wchar_t should be either UTF-16 or UTF-32
#endif
@@ -108,9 +108,9 @@ TEST_F(RTLTest, GetFirstStrongCharacterDirection) {
base::i18n::GetFirstStrongCharacterDirection(string));
#if defined(WCHAR_T_IS_UTF32)
- string.assign(L" ! \x10401" L"abc 123");
+ string.assign(WideToUTF16(L" ! \x10401" L"abc 123"));
#elif defined(WCHAR_T_IS_UTF16)
- string.assign(L" ! \xd801\xdc01" L"abc 123");
+ string.assign(WideToUTF16(L" ! \xd801\xdc01" L"abc 123"));
#else
#error wchar_t should be either UTF-16 or UTF-32
#endif