| 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/files/file_util.h" | 8 #include "base/files/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" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/tools/convert_dict/aff_reader.h" | 13 #include "chrome/tools/convert_dict/aff_reader.h" |
| 14 #include "chrome/tools/convert_dict/dic_reader.h" | 14 #include "chrome/tools/convert_dict/dic_reader.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/hunspell_new/google/bdict_reader.h" | 16 #include "third_party/hunspell/google/bdict_reader.h" |
| 17 #include "third_party/hunspell_new/google/bdict_writer.h" | 17 #include "third_party/hunspell/google/bdict_writer.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Compares the given word list with the serialized trie to make sure they | 21 // Compares the given word list with the serialized trie to make sure they |
| 22 // are the same. | 22 // are the same. |
| 23 // (This function is copied from "chrome/tools/convert_dict/convert_dict.cc"). | 23 // (This function is copied from "chrome/tools/convert_dict/convert_dict.cc"). |
| 24 bool VerifyWords(const convert_dict::DicReader::WordList& org_words, | 24 bool VerifyWords(const convert_dict::DicReader::WordList& org_words, |
| 25 const std::string& serialized) { | 25 const std::string& serialized) { |
| 26 hunspell::BDictReader reader; | 26 hunspell::BDictReader reader; |
| 27 EXPECT_TRUE( | 27 EXPECT_TRUE( |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 std::map<base::string16, bool> word_list; | 200 std::map<base::string16, bool> word_list; |
| 201 for (size_t i = 0; i < arraysize(kWords); ++i) | 201 for (size_t i = 0; i < arraysize(kWords); ++i) |
| 202 word_list.insert( | 202 word_list.insert( |
| 203 std::make_pair<base::string16, bool>(base::WideToUTF16(kWords[i]), | 203 std::make_pair<base::string16, bool>(base::WideToUTF16(kWords[i]), |
| 204 true)); | 204 true)); |
| 205 | 205 |
| 206 RunDictionaryTest(kCodepage, word_list); | 206 RunDictionaryTest(kCodepage, word_list); |
| 207 } | 207 } |
| OLD | NEW |