Index: chrome/tools/convert_dict/convert_dict_unittest.cc |
=================================================================== |
--- chrome/tools/convert_dict/convert_dict_unittest.cc (revision 73855) |
+++ chrome/tools/convert_dict/convert_dict_unittest.cc (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2010 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. |
@@ -62,18 +62,18 @@ |
// * Creates bdict data. |
// * Verify the bdict data. |
void RunDictionaryTest(const char* codepage, |
- const std::map<std::wstring, bool>& word_list) { |
+ const std::map<string16, bool>& word_list) { |
// Create an affix data and a dictionary data. |
std::string aff_data(StringPrintf("SET %s\n", codepage)); |
std::string dic_data(StringPrintf("%" PRIuS "\n", word_list.size())); |
- for (std::map<std::wstring, bool>::const_iterator it = word_list.begin(); |
+ for (std::map<string16, bool>::const_iterator it = word_list.begin(); |
it != word_list.end(); ++it) { |
std::string encoded_word; |
- EXPECT_TRUE(WideToCodepage(it->first, |
- codepage, |
- base::OnStringConversionError::FAIL, |
- &encoded_word)); |
+ EXPECT_TRUE(UTF16ToCodepage(it->first, |
+ codepage, |
+ base::OnStringConversionError::FAIL, |
+ &encoded_word)); |
dic_data += encoded_word; |
dic_data += "\n"; |
} |
@@ -101,7 +101,7 @@ |
for (size_t i = 0; i < dic_reader.words().size(); ++i) { |
SCOPED_TRACE(StringPrintf("dic_reader.words()[%" PRIuS "]: %s", |
i, dic_reader.words()[i].first.c_str())); |
- std::wstring word(UTF8ToWide(dic_reader.words()[i].first)); |
+ string16 word(UTF8ToUTF16(dic_reader.words()[i].first)); |
EXPECT_TRUE(word_list.find(word) != word_list.end()); |
} |
@@ -149,9 +149,10 @@ |
L"they", |
}; |
- std::map<std::wstring, bool> word_list; |
+ std::map<string16, bool> word_list; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) |
- word_list.insert(std::make_pair<std::wstring, bool>(kWords[i], true)); |
+ word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), |
+ true)); |
RunDictionaryTest(kCodepage, word_list); |
} |
@@ -170,9 +171,10 @@ |
L"\x043e\x043d\x0438", |
}; |
- std::map<std::wstring, bool> word_list; |
+ std::map<string16, bool> word_list; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) |
- word_list.insert(std::make_pair<std::wstring, bool>(kWords[i], true)); |
+ word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), |
+ true)); |
RunDictionaryTest(kCodepage, word_list); |
} |
@@ -193,9 +195,10 @@ |
L"\x006d\x0061\x0067\x0075\x006b", |
}; |
- std::map<std::wstring, bool> word_list; |
+ std::map<string16, bool> word_list; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) |
- word_list.insert(std::make_pair<std::wstring, bool>(kWords[i], true)); |
+ word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), |
+ true)); |
RunDictionaryTest(kCodepage, word_list); |
} |