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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 for (size_t i = 1; i < bdict_data.size(); ++i) { | 123 for (size_t i = 1; i < bdict_data.size(); ++i) { |
124 SCOPED_TRACE(base::StringPrintf("i = %" PRIuS, i)); | 124 SCOPED_TRACE(base::StringPrintf("i = %" PRIuS, i)); |
125 EXPECT_FALSE(hunspell::BDict::Verify(bdict_data.data(), | 125 EXPECT_FALSE(hunspell::BDict::Verify(bdict_data.data(), |
126 bdict_data.size() - i)); | 126 bdict_data.size() - i)); |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 // Deletes the temporary files. | 130 // Deletes the temporary files. |
131 // We need to delete them after the above AffReader and DicReader are deleted | 131 // We need to delete them after the above AffReader and DicReader are deleted |
132 // since they close the input files in their destructors. | 132 // since they close the input files in their destructors. |
133 file_util::Delete(aff_file, false); | 133 base::Delete(aff_file, false); |
134 file_util::Delete(dic_file, false); | 134 base::Delete(dic_file, false); |
135 } | 135 } |
136 | 136 |
137 } // namespace | 137 } // namespace |
138 | 138 |
139 // Tests whether or not our DicReader can read all the input English words | 139 // Tests whether or not our DicReader can read all the input English words |
140 TEST(ConvertDictTest, English) { | 140 TEST(ConvertDictTest, English) { |
141 const char kCodepage[] = "UTF-8"; | 141 const char kCodepage[] = "UTF-8"; |
142 const wchar_t* kWords[] = { | 142 const wchar_t* kWords[] = { |
143 L"I", | 143 L"I", |
144 L"he", | 144 L"he", |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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>(WideToUTF16(kWords[i]), |
201 true)); | 201 true)); |
202 | 202 |
203 RunDictionaryTest(kCodepage, word_list); | 203 RunDictionaryTest(kCodepage, word_list); |
204 } | 204 } |
OLD | NEW |