diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 12:19:30 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 12:19:30 +0000 |
commit | 1156a8e6ba080e8890e2a9695bd75c34800d0808 (patch) | |
tree | 618aff216d0be834f0934635534c579a7682aab5 /chrome/tools/convert_dict | |
parent | 866969dc0a2c4386ed166cb39e366aa3bbaac305 (diff) | |
download | chromium_src-1156a8e6ba080e8890e2a9695bd75c34800d0808.zip chromium_src-1156a8e6ba080e8890e2a9695bd75c34800d0808.tar.gz chromium_src-1156a8e6ba080e8890e2a9695bd75c34800d0808.tar.bz2 |
Add some logging in convert_dict.
Currently, there is no way to tell what is failing, it is returning silently. This will output some information regarding what error occurred.
BUG=20754 (http://crbug.com/20754)
TEST=Compile and run convert_dict with korean dictionary (1 error will spit out which will help the converter whats wrong)
Review URL: http://codereview.chromium.org/177051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/convert_dict')
-rw-r--r-- | chrome/tools/convert_dict/convert_dict.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/chrome/tools/convert_dict/convert_dict.cc b/chrome/tools/convert_dict/convert_dict.cc index 0a99799..4f8a862 100644 --- a/chrome/tools/convert_dict/convert_dict.cc +++ b/chrome/tools/convert_dict/convert_dict.cc @@ -44,19 +44,28 @@ bool VerifyWords(const convert_dict::DicReader::WordList& org_words, char buf[buf_size]; for (size_t i = 0; i < org_words.size(); i++) { int affix_matches = iter.Advance(buf, buf_size, affix_ids); - if (affix_matches == 0) - return false; // Found the end before we expectd. - if (org_words[i].first != buf) - return false; // Word doesn't match. + if (affix_matches == 0) { + printf("Found the end before we expected\n"); + return false; + } + + if (org_words[i].first != buf) { + printf("Word doesn't match, word #%s\n", buf); + return false; + } - if (affix_matches != static_cast<int>(org_words[i].second.size())) - return false; // Different number of affix indices. + if (affix_matches != static_cast<int>(org_words[i].second.size())) { + printf("Different number of affix indices, word #%s\n", buf); + return false; + } // Check the individual affix indices. for (size_t affix_index = 0; affix_index < org_words[i].second.size(); affix_index++) { - if (affix_ids[affix_index] != org_words[i].second[affix_index]) - return false; // Index doesn't match. + if (affix_ids[affix_index] != org_words[i].second[affix_index]) { + printf("Index doesn't match, word #%s\n", buf); + return false; + } } } |