Fix: NPE in unit test.

Change-Id: I769b43f2afa1151d5c0d9c408018c3932be377dc
main
Keisuke Kuroyanagi 2014-10-03 19:53:23 +09:00
parent 80861cde9d
commit 2522a4a477
1 changed files with 10 additions and 8 deletions

View File

@ -1237,6 +1237,7 @@ public class BinaryDictionaryTests extends AndroidTestCase {
wordSet.remove(word0);
final HashSet<String> bigramWord1s = bigrams.get(word0);
// TODO: Support ngram.
if (wordProperty.mHasNgrams) {
for (final WeightedString bigramTarget : wordProperty.getBigrams()) {
final String word1 = bigramTarget.mWord;
assertTrue(bigramWord1s.contains(word1));
@ -1247,6 +1248,7 @@ public class BinaryDictionaryTests extends AndroidTestCase {
}
bigramSet.remove(bigram);
}
}
token = result.mNextToken;
} while (token != 0);
assertTrue(wordSet.isEmpty());