OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/i18n/icu_string_conversions.h" | 10 #include "base/i18n/icu_string_conversions.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 L"he", | 144 L"he", |
145 L"she", | 145 L"she", |
146 L"it", | 146 L"it", |
147 L"we", | 147 L"we", |
148 L"you", | 148 L"you", |
149 L"they", | 149 L"they", |
150 }; | 150 }; |
151 | 151 |
152 std::map<string16, bool> word_list; | 152 std::map<string16, bool> word_list; |
153 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) | 153 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) |
154 word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), | 154 word_list.insert(std::make_pair<string16, bool>( |
155 true)); | 155 base::WideToUTF16(kWords[i]), true)); |
156 | 156 |
157 RunDictionaryTest(kCodepage, word_list); | 157 RunDictionaryTest(kCodepage, word_list); |
158 } | 158 } |
159 | 159 |
160 // Tests whether or not our DicReader can read all the input Russian words. | 160 // Tests whether or not our DicReader can read all the input Russian words. |
161 TEST(ConvertDictTest, Russian) { | 161 TEST(ConvertDictTest, Russian) { |
162 const char kCodepage[] = "KOI8-R"; | 162 const char kCodepage[] = "KOI8-R"; |
163 const wchar_t* kWords[] = { | 163 const wchar_t* kWords[] = { |
164 L"\x044f", | 164 L"\x044f", |
165 L"\x0442\x044b", | 165 L"\x0442\x044b", |
166 L"\x043e\x043d", | 166 L"\x043e\x043d", |
167 L"\x043e\x043d\x0430", | 167 L"\x043e\x043d\x0430", |
168 L"\x043e\x043d\x043e", | 168 L"\x043e\x043d\x043e", |
169 L"\x043c\x044b", | 169 L"\x043c\x044b", |
170 L"\x0432\x044b", | 170 L"\x0432\x044b", |
171 L"\x043e\x043d\x0438", | 171 L"\x043e\x043d\x0438", |
172 }; | 172 }; |
173 | 173 |
174 std::map<string16, bool> word_list; | 174 std::map<string16, bool> word_list; |
175 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) | 175 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) |
176 word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), | 176 word_list.insert(std::make_pair<string16, bool>( |
177 true)); | 177 base::WideToUTF16(kWords[i]), true)); |
178 | 178 |
179 RunDictionaryTest(kCodepage, word_list); | 179 RunDictionaryTest(kCodepage, word_list); |
180 } | 180 } |
181 | 181 |
182 // Tests whether or not our DicReader can read all the input Hungarian words. | 182 // Tests whether or not our DicReader can read all the input Hungarian words. |
183 TEST(ConvertDictTest, Hungarian) { | 183 TEST(ConvertDictTest, Hungarian) { |
184 const char kCodepage[] = "ISO8859-2"; | 184 const char kCodepage[] = "ISO8859-2"; |
185 const wchar_t* kWords[] = { | 185 const wchar_t* kWords[] = { |
186 L"\x00e9\x006e", | 186 L"\x00e9\x006e", |
187 L"\x0074\x0065", | 187 L"\x0074\x0065", |
188 L"\x0151", | 188 L"\x0151", |
189 L"\x00f6\x006e", | 189 L"\x00f6\x006e", |
190 L"\x006d\x0061\x0067\x0061", | 190 L"\x006d\x0061\x0067\x0061", |
191 L"\x006d\x0069", | 191 L"\x006d\x0069", |
192 L"\x0074\x0069", | 192 L"\x0074\x0069", |
193 L"\x0151\x006b", | 193 L"\x0151\x006b", |
194 L"\x00f6\x006e\x00f6\x006b", | 194 L"\x00f6\x006e\x00f6\x006b", |
195 L"\x006d\x0061\x0067\x0075\x006b", | 195 L"\x006d\x0061\x0067\x0075\x006b", |
196 }; | 196 }; |
197 | 197 |
198 std::map<string16, bool> word_list; | 198 std::map<string16, bool> word_list; |
199 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) | 199 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kWords); ++i) |
200 word_list.insert(std::make_pair<string16, bool>(WideToUTF16(kWords[i]), | 200 word_list.insert(std::make_pair<string16, bool>( |
201 true)); | 201 base::WideToUTF16(kWords[i]), true)); |
202 | 202 |
203 RunDictionaryTest(kCodepage, word_list); | 203 RunDictionaryTest(kCodepage, word_list); |
204 } | 204 } |
OLD | NEW |