Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: chrome/tools/convert_dict/convert_dict_unittest.cc

Issue 4477002: Add sanity checks of the BDIC files to ConvertDictTest.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/spellcheck_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/convert_dict/convert_dict_unittest.cc
===================================================================
--- chrome/tools/convert_dict/convert_dict_unittest.cc (revision 65173)
+++ chrome/tools/convert_dict/convert_dict_unittest.cc (working copy)
@@ -114,7 +114,17 @@
writer.SetOtherCommands(aff_reader.other_commands());
writer.SetWords(dic_reader.words());
- VerifyWords(dic_reader.words(), writer.GetBDict());
+ std::string bdict_data = writer.GetBDict();
+ VerifyWords(dic_reader.words(), bdict_data);
+ EXPECT_TRUE(hunspell::BDict::Verify(bdict_data.data(), bdict_data.size()));
+
+ // Trim the end of this BDICT and verify our verifier tells these trimmed
+ // BDICTs are corrupted.
+ for (size_t i = 1; i < bdict_data.size(); ++i) {
+ SCOPED_TRACE(StringPrintf("i = %" PRIuS, i));
+ EXPECT_FALSE(hunspell::BDict::Verify(bdict_data.data(),
+ bdict_data.size() - i));
+ }
}
// Deletes the temporary files.
« no previous file with comments | « chrome/browser/spellcheck_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698