summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 23:38:31 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 23:38:31 +0000
commitbe93d11de2aa7d0f411d86fcdc417ac68651bbeb (patch)
treee943f62565f12b686be151eb7d0aade874b993d0
parent32b4972d09d101d279f47a5d610b8ee65fe4451c (diff)
downloadchromium_src-be93d11de2aa7d0f411d86fcdc417ac68651bbeb.zip
chromium_src-be93d11de2aa7d0f411d86fcdc417ac68651bbeb.tar.gz
chromium_src-be93d11de2aa7d0f411d86fcdc417ac68651bbeb.tar.bz2
Clean up spellchecker unittest. In particular, this:
* Fixes some errors -- the test is apparently not being run currently, for reasons I'm fixing separately * Uses narrow strings instead of wide where there isn't any reason to use wide * Prints out the word in question when a failure happens * Tries to otherwise clean up the code BUG=none TEST=none Review URL: http://codereview.chromium.org/2811046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51796 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/spellchecker_platform_engine_unittest.cc573
1 files changed, 272 insertions, 301 deletions
diff --git a/chrome/browser/spellchecker_platform_engine_unittest.cc b/chrome/browser/spellchecker_platform_engine_unittest.cc
index aba1a2d..a63bf67 100644
--- a/chrome/browser/spellchecker_platform_engine_unittest.cc
+++ b/chrome/browser/spellchecker_platform_engine_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/utf_string_conversions.h"
+#include "base/string_util.h"
#include "chrome/browser/spellchecker_platform_engine.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -11,60 +11,40 @@
// supply a non-zero doc_tag, in order to test that ignored words are matched to
// the correct document.
TEST(PlatformSpellCheckTest, IgnoreWords_EN_US) {
- static const struct {
- // A misspelled word.
- const char* input;
- bool input_result;
- } kTestCases[] = {
- {"teh"},
- {"morblier"},
- {"watre"},
- {"noooen"},
+ const char* kTestCases[] = {
+ "teh",
+ "morblier",
+ "watre",
+ "noooen",
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- string16 word(UTF8ToUTF16(kTestCases[i].input));
- std::vector<string16> suggestions;
- size_t input_length = 0;
- if (kTestCases[i].input != NULL) {
- input_length = word.length();
- }
-
- int doc_tag = SpellCheckerPlatform::GetDocumentTag();
- bool result = SpellCheckerPlatform::CheckSpelling(word, doc_tag);
+ const string16 word(ASCIIToUTF16(kTestCases[i]));
+ const int doc_tag = SpellCheckerPlatform::GetDocumentTag();
// The word should show up as misspelled.
- EXPECT_EQ(kTestCases[i].input_result, result);
+ EXPECT_FALSE(SpellCheckerPlatform::CheckSpelling(word, doc_tag)) << word;
// Ignore the word.
SpellCheckerPlatform::IgnoreWord(word);
- // Spellcheck again.
- result = SpellCheckerPlatform::CheckSpelling(word, doc_tag);
-
// The word should now show up as correctly spelled.
- EXPECT_EQ(!(kTestCases[i].input_result), result);
+ EXPECT_TRUE(SpellCheckerPlatform::CheckSpelling(word, doc_tag)) << word;
// Close the docuemnt. Any words that we had previously ignored should no
// longer be ignored and thus should show up as misspelled.
SpellCheckerPlatform::CloseDocumentWithTag(doc_tag);
- // Spellcheck one more time.
- result = SpellCheckerPlatform::CheckSpelling(word, doc_tag);
-
// The word should now show be spelled wrong again
- EXPECT_EQ(kTestCases[i].input_result, result);
+ EXPECT_FALSE(SpellCheckerPlatform::CheckSpelling(word, doc_tag)) << word;
}
} // Test IgnoreWords_EN_US
TEST(PlatformSpellCheckTest, SpellCheckSuggestions_EN_US) {
static const struct {
- // A string to be tested.
- const wchar_t* input;
-
- // A suggested word that should occur.
- const wchar_t* suggested_word;
- } kTestCases[] = { // A valid English word with a preceding whitespace
+ const char* input; // A string to be tested.
+ const char* suggested_word; // A suggested word that should occur.
+ } kTestCases[] = {
// We need to have separate test cases here, since hunspell and the OS X
// spellchecking service occasionally differ on what they consider a valid
// suggestion for a given word, although these lists could likely be
@@ -77,286 +57,277 @@ TEST(PlatformSpellCheckTest, SpellCheckSuggestions_EN_US) {
// dictionaries by default. As a result, we have removed from the list any
// word that is marked as correct because it is correct in another
// language.
- {L"absense", L"absence"},
- {L"acceptible", L"acceptable"},
- {L"accidentaly", L"accidentally"},
- {L"acheive", L"achieve"},
- {L"acknowlege", L"acknowledge"},
- {L"acquaintence", L"acquaintance"},
- {L"aquire", L"acquire"},
- {L"aquit", L"acquit"},
- {L"acrage", L"acreage"},
- {L"adultary", L"adultery"},
- {L"advertize", L"advertise"},
- {L"adviseable", L"advisable"},
- {L"alchohol", L"alcohol"},
- {L"alege", L"allege"},
- {L"allegaince", L"allegiance"},
- {L"allmost", L"almost"},
+ {"absense", "absence"},
+ {"acceptible", "acceptable"},
+ {"accidentaly", "accidentally"},
+ {"acheive", "achieve"},
+ {"acknowlege", "acknowledge"},
+ {"acquaintence", "acquaintance"},
+ {"aquire", "acquire"},
+ {"aquit", "acquit"},
+ {"acrage", "acreage"},
+ {"adultary", "adultery"},
+ {"advertize", "advertise"},
+ {"adviseable", "advisable"},
+ {"alchohol", "alcohol"},
+ {"alege", "allege"},
+ {"allegaince", "allegiance"},
+ {"allmost", "almost"},
// Ideally, this test should pass. It works in firefox, but not in hunspell
// or OS X.
- // {L"alot", L"a lot"},
- {L"amatuer", L"amateur"},
- {L"ammend", L"amend"},
- {L"amung", L"among"},
- {L"anually", L"annually"},
- {L"apparant", L"apparent"},
- {L"artic", L"arctic"},
- {L"arguement", L"argument"},
- {L"athiest", L"atheist"},
- {L"athelete", L"athlete"},
- {L"avrage", L"average"},
- {L"awfull", L"awful"},
- {L"ballance", L"balance"},
- {L"basicly", L"basically"},
- {L"becuase", L"because"},
- {L"becomeing", L"becoming"},
- {L"befor", L"before"},
- {L"begining", L"beginning"},
- {L"beleive", L"believe"},
- {L"bellweather", L"bellwether"},
- {L"benifit", L"benefit"},
- {L"bouy", L"buoy"},
- {L"briliant", L"brilliant"},
- {L"burgler", L"burglar"},
- {L"camoflage", L"camouflage"},
- {L"carefull", L"careful"},
- {L"Carribean", L"Caribbean"},
- {L"catagory", L"category"},
- {L"cauhgt", L"caught"},
- {L"cieling", L"ceiling"},
- {L"cemetary", L"cemetery"},
- {L"certin", L"certain"},
- {L"changable", L"changeable"},
- {L"cheif", L"chief"},
- {L"citezen", L"citizen"},
- {L"collaegue", L"colleague"},
- {L"colum", L"column"},
- {L"comming", L"coming"},
- {L"commited", L"committed"},
- {L"compitition", L"competition"},
- {L"conceed", L"concede"},
- {L"congradulate", L"congratulate"},
- {L"consciencious", L"conscientious"},
- {L"concious", L"conscious"},
- {L"concensus", L"consensus"},
- {L"contraversy", L"controversy"},
- {L"conveniance", L"convenience"},
- {L"critecize", L"criticize"},
- {L"dacquiri", L"daiquiri"},
- {L"decieve", L"deceive"},
- {L"dicide", L"decide"},
- {L"definate", L"definite"},
- {L"definitly", L"definitely"},
- {L"desparate", L"desperate"},
- {L"develope", L"develop"},
- {L"diffrence", L"difference"},
- {L"disapear", L"disappear"},
- {L"disapoint", L"disappoint"},
- {L"disasterous", L"disastrous"},
- {L"disipline", L"discipline"},
- {L"drunkeness", L"drunkenness"},
- {L"dumbell", L"dumbbell"},
- {L"easely", L"easily"},
- {L"eigth", L"eight"},
- {L"embarass", L"embarrass"},
- {L"enviroment", L"environment"},
- {L"equiped", L"equipped"},
- {L"equiptment", L"equipment"},
- {L"exagerate", L"exaggerate"},
- {L"exellent", L"excellent"},
- {L"exsept", L"except"},
- {L"exercize", L"exercise"},
- {L"exilerate", L"exhilarate"},
- {L"existance", L"existence"},
- {L"experiance", L"experience"},
- {L"experament", L"experiment"},
- {L"explaination", L"explanation"},
- {L"facinating", L"fascinating"},
- {L"firey", L"fiery"},
- {L"finaly", L"finally"},
- {L"flourescent", L"fluorescent"},
- {L"foriegn", L"foreign"},
- {L"fourty", L"forty"},
- {L"foreward", L"forward"},
- {L"freind", L"friend"},
- {L"fundemental", L"fundamental"},
- {L"guage", L"gauge"},
- {L"generaly", L"generally"},
- {L"goverment", L"government"},
- {L"gratefull", L"grateful"},
- {L"garantee", L"guarantee"},
- {L"guidence", L"guidance"},
- {L"happyness", L"happiness"},
- {L"harrass", L"harass"},
- {L"heighth", L"height"},
- {L"heirarchy", L"hierarchy"},
- {L"humerous", L"humorous"},
- {L"hygene", L"hygiene"},
- {L"hipocrit", L"hypocrite"},
- {L"idenity", L"identity"},
- {L"ignorence", L"ignorance"},
- {L"imaginery", L"imaginary"},
- {L"immitate", L"imitate"},
- {L"immitation", L"imitation"},
- {L"imediately", L"immediately"},
- {L"incidently", L"incidentally"},
- {L"independant", L"independent"},
- {L"indispensible", L"indispensable"},
- {L"innoculate", L"inoculate"},
- {L"inteligence", L"intelligence"},
- {L"intresting", L"interesting"},
- {L"interuption", L"interruption"},
- {L"irrelevent", L"irrelevant"},
- {L"irritible", L"irritable"},
- {L"jellous", L"jealous"},
- {L"knowlege", L"knowledge"},
- {L"labratory", L"laboratory"},
- {L"lenght", L"length"},
- {L"liason", L"liaison"},
- {L"libary", L"library"},
- {L"lisence", L"license"},
- {L"lonelyness", L"loneliness"},
- {L"lieing", L"lying"},
- {L"maintenence", L"maintenance"},
- {L"manuever", L"maneuver"},
- {L"marrige", L"marriage"},
- {L"mathmatics", L"mathematics"},
- {L"medcine", L"medicine"},
- {L"miniture", L"miniature"},
- {L"minite", L"minute"},
- {L"mischevous", L"mischievous"},
- {L"mispell", L"misspell"},
+ // {"alot", "a lot"},
+ {"amatuer", "amateur"},
+ {"ammend", "amend"},
+ {"amung", "among"},
+ {"anually", "annually"},
+ {"apparant", "apparent"},
+ {"artic", "arctic"},
+ {"arguement", "argument"},
+ {"athiest", "atheist"},
+ {"athelete", "athlete"},
+ {"avrage", "average"},
+ {"awfull", "awful"},
+ {"ballance", "balance"},
+ {"basicly", "basically"},
+ {"becuase", "because"},
+ {"becomeing", "becoming"},
+ {"befor", "before"},
+ {"begining", "beginning"},
+ {"beleive", "believe"},
+ {"bellweather", "bellwether"},
+ {"benifit", "benefit"},
+ {"bouy", "buoy"},
+ {"briliant", "brilliant"},
+ {"burgler", "burglar"},
+ {"camoflage", "camouflage"},
+ {"carefull", "careful"},
+ {"Carribean", "Caribbean"},
+ {"catagory", "category"},
+ {"cauhgt", "caught"},
+ {"cieling", "ceiling"},
+ {"cemetary", "cemetery"},
+ {"certin", "certain"},
+ {"changable", "changeable"},
+ {"cheif", "chief"},
+ {"citezen", "citizen"},
+ {"collaegue", "colleague"},
+ {"colum", "column"},
+ {"comming", "coming"},
+ {"commited", "committed"},
+ {"compitition", "competition"},
+ {"conceed", "concede"},
+ {"congradulate", "congratulate"},
+ {"consciencious", "conscientious"},
+ {"concious", "conscious"},
+ {"concensus", "consensus"},
+ {"contraversy", "controversy"},
+ {"conveniance", "convenience"},
+ {"critecize", "criticize"},
+ {"dacquiri", "daiquiri"},
+ {"decieve", "deceive"},
+ {"dicide", "decide"},
+ {"definate", "definite"},
+ {"definitly", "definitely"},
+ {"desparate", "desperate"},
+ {"develope", "develop"},
+ {"diffrence", "difference"},
+ {"disapear", "disappear"},
+ {"disapoint", "disappoint"},
+ {"disasterous", "disastrous"},
+ {"disipline", "discipline"},
+ {"drunkeness", "drunkenness"},
+ {"dumbell", "dumbbell"},
+ {"easely", "easily"},
+ {"eigth", "eight"},
+ {"embarass", "embarrass"},
+ {"enviroment", "environment"},
+ {"equiped", "equipped"},
+ {"equiptment", "equipment"},
+ {"exagerate", "exaggerate"},
+ {"exellent", "excellent"},
+ {"exsept", "except"},
+ {"exercize", "exercise"},
+ {"exilerate", "exhilarate"},
+ {"existance", "existence"},
+ {"experiance", "experience"},
+ {"experament", "experiment"},
+ {"explaination", "explanation"},
+ {"facinating", "fascinating"},
+ {"firey", "fiery"},
+ {"finaly", "finally"},
+ {"flourescent", "fluorescent"},
+ {"foriegn", "foreign"},
+ {"fourty", "forty"},
+ {"foreward", "forward"},
+ {"freind", "friend"},
+ {"fundemental", "fundamental"},
+ {"guage", "gauge"},
+ {"generaly", "generally"},
+ {"goverment", "government"},
+ {"gratefull", "grateful"},
+ {"garantee", "guarantee"},
+ {"guidence", "guidance"},
+ {"happyness", "happiness"},
+ {"harrass", "harass"},
+ {"heighth", "height"},
+ {"heirarchy", "hierarchy"},
+ {"humerous", "humorous"},
+ {"hygene", "hygiene"},
+ {"hipocrit", "hypocrite"},
+ {"idenity", "identity"},
+ {"ignorence", "ignorance"},
+ {"imaginery", "imaginary"},
+ {"immitate", "imitate"},
+ {"immitation", "imitation"},
+ {"imediately", "immediately"},
+ {"incidently", "incidentally"},
+ {"independant", "independent"},
+ {"indispensible", "indispensable"},
+ {"innoculate", "inoculate"},
+ {"inteligence", "intelligence"},
+ {"intresting", "interesting"},
+ {"interuption", "interruption"},
+ {"irrelevent", "irrelevant"},
+ {"irritible", "irritable"},
+ {"jellous", "jealous"},
+ {"knowlege", "knowledge"},
+ {"labratory", "laboratory"},
+ {"lenght", "length"},
+ {"liason", "liaison"},
+ {"libary", "library"},
+ {"lisence", "license"},
+ {"lonelyness", "loneliness"},
+ {"lieing", "lying"},
+ {"maintenence", "maintenance"},
+ {"manuever", "maneuver"},
+ {"marrige", "marriage"},
+ {"mathmatics", "mathematics"},
+ {"medcine", "medicine"},
+ {"miniture", "miniature"},
+ {"minite", "minute"},
+ {"mischevous", "mischievous"},
+ {"mispell", "misspell"},
// Maybe this one should pass, as it works in hunspell, but not in firefox.
- // {L"misterius", L"mysterious"},
- {L"naturaly", L"naturally"},
- {L"neccessary", L"necessary"},
- {L"neice", L"niece"},
- {L"nieghbor", L"neighbor"},
- {L"nieghbour", L"neighbor"},
- {L"niether", L"neither"},
- {L"noticable", L"noticeable"},
- {L"occassion", L"occasion"},
- {L"occasionaly", L"occasionally"},
- {L"occurrance", L"occurrence"},
- {L"occured", L"occurred"},
- {L"ommision", L"omission"},
- {L"oppurtunity", L"opportunity"},
- {L"outragous", L"outrageous"},
- {L"parrallel", L"parallel"},
- {L"parliment", L"parliament"},
- {L"particurly", L"particularly"},
- {L"passtime", L"pastime"},
- {L"peculier", L"peculiar"},
- {L"percieve", L"perceive"},
- {L"pernament", L"permanent"},
- {L"perseverence", L"perseverance"},
- {L"personaly", L"personally"},
- {L"persaude", L"persuade"},
- {L"pichure", L"picture"},
- {L"peice", L"piece"},
- {L"plagerize", L"plagiarize"},
- {L"playright", L"playwright"},
- {L"plesant", L"pleasant"},
- {L"pollitical", L"political"},
- {L"posession", L"possession"},
- {L"potatos", L"potatoes"},
- {L"practicle", L"practical"},
- {L"preceed", L"precede"},
- {L"predjudice", L"prejudice"},
- {L"presance", L"presence"},
- {L"privelege", L"privilege"},
+ // {"misterius", "mysterious"},
+ {"naturaly", "naturally"},
+ {"neccessary", "necessary"},
+ {"neice", "niece"},
+ {"nieghbor", "neighbor"},
+ {"nieghbour", "neighbor"},
+ {"niether", "neither"},
+ {"noticable", "noticeable"},
+ {"occassion", "occasion"},
+ {"occasionaly", "occasionally"},
+ {"occurrance", "occurrence"},
+ {"occured", "occurred"},
+ {"ommision", "omission"},
+ {"oppurtunity", "opportunity"},
+ {"outragous", "outrageous"},
+ {"parrallel", "parallel"},
+ {"parliment", "parliament"},
+ {"particurly", "particularly"},
+ {"passtime", "pastime"},
+ {"peculier", "peculiar"},
+ {"percieve", "perceive"},
+ {"pernament", "permanent"},
+ {"perseverence", "perseverance"},
+ {"personaly", "personally"},
+ {"persaude", "persuade"},
+ {"pichure", "picture"},
+ {"peice", "piece"},
+ {"plagerize", "plagiarize"},
+ {"playright", "playwright"},
+ {"plesant", "pleasant"},
+ {"pollitical", "political"},
+ {"posession", "possession"},
+ {"potatos", "potatoes"},
+ {"practicle", "practical"},
+ {"preceed", "precede"},
+ {"predjudice", "prejudice"},
+ {"presance", "presence"},
+ {"privelege", "privilege"},
// This one should probably work. It does in FF and Hunspell.
- // {L"probly", L"probably"},
- {L"proffesional", L"professional"},
- {L"promiss", L"promise"},
- {L"pronounciation", L"pronunciation"},
- {L"prufe", L"proof"},
- {L"psycology", L"psychology"},
- {L"publically", L"publicly"},
- {L"quanity", L"quantity"},
- {L"quarentine", L"quarantine"},
- {L"questionaire", L"questionnaire"},
- {L"readible", L"readable"},
- {L"realy", L"really"},
- {L"recieve", L"receive"},
- {L"reciept", L"receipt"},
- {L"reconize", L"recognize"},
- {L"recomend", L"recommend"},
- {L"refered", L"referred"},
- {L"referance", L"reference"},
- {L"relevent", L"relevant"},
- {L"religous", L"religious"},
- {L"repitition", L"repetition"},
- {L"restarant", L"restaurant"},
- {L"rythm", L"rhythm"},
- {L"rediculous", L"ridiculous"},
- {L"sacrefice", L"sacrifice"},
- {L"saftey", L"safety"},
- {L"sissors", L"scissors"},
- {L"secratary", L"secretary"},
- {L"seperate", L"separate"},
- {L"sargent", L"sergeant"},
- {L"shineing", L"shining"},
- {L"similer", L"similar"},
- {L"sinceerly", L"sincerely"},
- {L"speach", L"speech"},
- {L"stoping", L"stopping"},
- {L"strenght", L"strength"},
- {L"succesful", L"successful"},
- {L"supercede", L"supersede"},
- {L"surelly", L"surely"},
- {L"suprise", L"surprise"},
- {L"temperture", L"temperature"},
- {L"temprary", L"temporary"},
- {L"tommorrow", L"tomorrow"},
- {L"tounge", L"tongue"},
- {L"truely", L"truly"},
- {L"twelth", L"twelfth"},
- {L"tyrany", L"tyranny"},
- {L"underate", L"underrate"},
- {L"untill", L"until"},
- {L"unuseual", L"unusual"},
- {L"upholstry", L"upholstery"},
- {L"usible", L"usable"},
- {L"useing", L"using"},
- {L"usualy", L"usually"},
- {L"vaccuum", L"vacuum"},
- {L"vegatarian", L"vegetarian"},
- {L"vehical", L"vehicle"},
- {L"visious", L"vicious"},
- {L"villege", L"village"},
- {L"wierd", L"weird"},
- {L"wellcome", L"welcome"},
- {L"wellfare", L"welfare"},
- {L"wilfull", L"willful"},
- {L"withold", L"withhold"},
- {L"writting", L"writing"},
+ // {"probly", "probably"},
+ {"proffesional", "professional"},
+ {"promiss", "promise"},
+ {"pronounciation", "pronunciation"},
+ {"prufe", "proof"},
+ {"psycology", "psychology"},
+ {"publically", "publicly"},
+ {"quanity", "quantity"},
+ {"quarentine", "quarantine"},
+ {"questionaire", "questionnaire"},
+ {"readible", "readable"},
+ {"realy", "really"},
+ {"recieve", "receive"},
+ {"reciept", "receipt"},
+ {"reconize", "recognize"},
+ {"recomend", "recommend"},
+ {"refered", "referred"},
+ {"referance", "reference"},
+ {"relevent", "relevant"},
+ {"religous", "religious"},
+ {"repitition", "repetition"},
+ {"restarant", "restaurant"},
+ {"rythm", "rhythm"},
+ {"rediculous", "ridiculous"},
+ {"sacrefice", "sacrifice"},
+ {"saftey", "safety"},
+ {"sissors", "scissors"},
+ {"secratary", "secretary"},
+ {"seperate", "separate"},
+ {"sargent", "sergeant"},
+ {"shineing", "shining"},
+ {"similer", "similar"},
+ {"sinceerly", "sincerely"},
+ {"speach", "speech"},
+ {"strenght", "strength"},
+ {"succesful", "successful"},
+ {"supercede", "supersede"},
+ {"surelly", "surely"},
+ {"suprise", "surprise"},
+ {"temperture", "temperature"},
+ {"temprary", "temporary"},
+ {"tommorrow", "tomorrow"},
+ {"tounge", "tongue"},
+ {"truely", "truly"},
+ {"twelth", "twelfth"},
+ {"tyrany", "tyranny"},
+ {"underate", "underrate"},
+ {"untill", "until"},
+ {"unuseual", "unusual"},
+ {"upholstry", "upholstery"},
+ {"usible", "usable"},
+ {"useing", "using"},
+ {"usualy", "usually"},
+ {"vaccuum", "vacuum"},
+ {"vegatarian", "vegetarian"},
+ {"vehical", "vehicle"},
+ {"visious", "vicious"},
+ {"villege", "village"},
+ {"wierd", "weird"},
+ {"wellcome", "welcome"},
+ {"wellfare", "welfare"},
+ {"wilfull", "willful"},
+ {"withold", "withhold"},
+ {"writting", "writing"},
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
- std::vector<string16> suggestions;
- size_t input_length = 0;
- if (kTestCases[i].input != NULL) {
- input_length = wcslen(kTestCases[i].input);
- }
- bool result = SpellCheckerPlatform::CheckSpelling(
- WideToUTF16(kTestCases[i].input), 0);
- EXPECT_FALSE(result);
-
- SpellCheckerPlatform::FillSuggestionList(WideToUTF16(kTestCases[i].input),
- &suggestions);
+ const string16 word(ASCIIToUTF16(kTestCases[i].input));
+ EXPECT_FALSE(SpellCheckerPlatform::CheckSpelling(word, 0)) << word;
// Check if the suggested words occur.
+ std::vector<string16> suggestions;
+ SpellCheckerPlatform::FillSuggestionList(word, &suggestions);
bool suggested_word_is_present = false;
- for (int j = 0; j < static_cast<int>(suggestions.size()); j++) {
- if (suggestions.at(j).compare(WideToUTF16(kTestCases[i].suggested_word))
- == 0) {
+ const string16 suggested_word(ASCIIToUTF16(kTestCases[i].suggested_word));
+ for (size_t j = 0; j < suggestions.size(); j++) {
+ if (suggestions[j].compare(suggested_word) == 0) {
suggested_word_is_present = true;
break;
}
}
-
- EXPECT_TRUE(suggested_word_is_present);
+ EXPECT_TRUE(suggested_word_is_present) << suggested_word;
}
}