Loading java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +2 −1 Original line number Diff line number Diff line Loading @@ -193,8 +193,9 @@ public final class FormatSpec { // Dictionary version used for testing. public static final int VERSION4_ONLY_FOR_TESTING = 399; public static final int VERSION4 = 401; public static final int VERSION4_DEV = 402; static final int MINIMUM_SUPPORTED_VERSION = VERSION2; static final int MAXIMUM_SUPPORTED_VERSION = VERSION4; static final int MAXIMUM_SUPPORTED_VERSION = VERSION4_DEV; // TODO: Make this value adaptative to content data, store it in the header, and // use it in the reading code. Loading tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java +29 −14 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { private static final String TEST_DICT_FILE_EXTENSION = ".testDict"; private static final String TEST_LOCALE = "test"; private static final int DUMMY_PROBABILITY = 0; private static final int[] DICT_FORMAT_VERSIONS = new int[] { FormatSpec.VERSION4, FormatSpec.VERSION4_DEV }; private int mCurrentTime = 0; Loading Loading @@ -94,7 +96,8 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { private File createEmptyDictionaryAndGetFile(final String dictId, final int formatVersion) throws IOException { if (formatVersion == FormatSpec.VERSION4 || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING) { || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING || formatVersion == FormatSpec.VERSION4_DEV) { return createEmptyVer4DictionaryAndGetFile(dictId, formatVersion); } else { throw new IOException("Dictionary format version " + formatVersion Loading @@ -120,7 +123,7 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { return file; } else { throw new IOException("Empty dictionary " + file.getAbsolutePath() + " cannot be created."); + " cannot be created. Foramt version: " + formatVersion); } } Loading @@ -133,7 +136,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testReadDictInJavaSide() { testReadDictInJavaSide(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testReadDictInJavaSide(formatVersion); } } private void testReadDictInJavaSide(final int formatVersion) { Loading Loading @@ -178,10 +183,6 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testControlCurrentTime() { testControlCurrentTime(FormatSpec.VERSION4); } private void testControlCurrentTime(final int formatVersion) { final int TEST_COUNT = 1000; final long seed = System.currentTimeMillis(); final Random random = new Random(seed); Loading @@ -197,7 +198,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testAddValidAndInvalidWords() { testAddValidAndInvalidWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddValidAndInvalidWords(formatVersion); } } private void testAddValidAndInvalidWords(final int formatVersion) { Loading Loading @@ -240,7 +243,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testDecayingProbability() { testDecayingProbability(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testDecayingProbability(formatVersion); } } private void testDecayingProbability(final int formatVersion) { Loading Loading @@ -295,7 +300,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testAddManyUnigramsToDecayingDict() { testAddManyUnigramsToDecayingDict(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyUnigramsToDecayingDict(formatVersion); } } private void testAddManyUnigramsToDecayingDict(final int formatVersion) { Loading Loading @@ -354,7 +361,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testOverflowUnigrams() { testOverflowUnigrams(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testOverflowUnigrams(formatVersion); } } private void testOverflowUnigrams(final int formatVersion) { Loading Loading @@ -413,7 +422,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testAddManyBigramsToDecayingDict() { testAddManyBigramsToDecayingDict(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyBigramsToDecayingDict(formatVersion); } } private void testAddManyBigramsToDecayingDict(final int formatVersion) { Loading Loading @@ -487,7 +498,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testOverflowBigrams() { testOverflowBigrams(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testOverflowBigrams(formatVersion); } } private void testOverflowBigrams(final int formatVersion) { Loading Loading @@ -566,7 +579,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testDictMigration() { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion); } } private void testDictMigration(final int fromFormatVersion, final int toFormatVersion) { Loading tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java +68 −23 Original line number Diff line number Diff line Loading @@ -43,11 +43,14 @@ import java.util.Random; public class BinaryDictionaryTests extends AndroidTestCase { private static final String TEST_DICT_FILE_EXTENSION = ".testDict"; private static final String TEST_LOCALE = "test"; private static final int[] DICT_FORMAT_VERSIONS = new int[] { FormatSpec.VERSION4, FormatSpec.VERSION4_DEV }; private File createEmptyDictionaryAndGetFile(final String dictId, final int formatVersion) throws IOException { if (formatVersion == FormatSpec.VERSION4 || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING) { || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING || formatVersion == FormatSpec.VERSION4_DEV) { return createEmptyVer4DictionaryAndGetFile(dictId, formatVersion); } else { throw new IOException("Dictionary format version " + formatVersion Loading @@ -67,12 +70,14 @@ public class BinaryDictionaryTests extends AndroidTestCase { return file; } else { throw new IOException("Empty dictionary " + file.getAbsolutePath() + " cannot be created."); + " cannot be created. Format version: " + formatVersion); } } public void testIsValidDictionary() { testIsValidDictionary(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testIsValidDictionary(formatVersion); } } private void testIsValidDictionary(final int formatVersion) { Loading Loading @@ -100,7 +105,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testConstructingDictionaryOnMemory() { testConstructingDictionaryOnMemory(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testConstructingDictionaryOnMemory(formatVersion); } } private void testConstructingDictionaryOnMemory(final int formatVersion) { Loading Loading @@ -131,7 +138,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddTooLongWord() { testAddTooLongWord(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddTooLongWord(formatVersion); } } private void testAddTooLongWord(final int formatVersion) { Loading Loading @@ -190,7 +199,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddUnigramWord() { testAddUnigramWord(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddUnigramWord(formatVersion); } } private void testAddUnigramWord(final int formatVersion) { Loading Loading @@ -232,7 +243,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRandomlyAddUnigramWord() { testRandomlyAddUnigramWord(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRandomlyAddUnigramWord(formatVersion); } } private void testRandomlyAddUnigramWord(final int formatVersion) { Loading Loading @@ -268,7 +281,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddBigramWords() { testAddBigramWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddBigramWords(formatVersion); } } private void testAddBigramWords(final int formatVersion) { Loading Loading @@ -336,7 +351,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRandomlyAddBigramWords() { testRandomlyAddBigramWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRandomlyAddBigramWords(formatVersion); } } private void testRandomlyAddBigramWords(final int formatVersion) { Loading Loading @@ -397,7 +414,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRemoveBigramWords() { testRemoveBigramWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRemoveBigramWords(formatVersion); } } private void testRemoveBigramWords(final int formatVersion) { Loading Loading @@ -447,7 +466,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testFlushDictionary() { testFlushDictionary(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testFlushDictionary(formatVersion); } } private void testFlushDictionary(final int formatVersion) { Loading Loading @@ -499,7 +520,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testFlushWithGCDictionary() { testFlushWithGCDictionary(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testFlushWithGCDictionary(formatVersion); } } private void testFlushWithGCDictionary(final int formatVersion) { Loading Loading @@ -547,7 +570,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddBigramWordsAndFlashWithGC() { testAddBigramWordsAndFlashWithGC(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddBigramWordsAndFlashWithGC(formatVersion); } } // TODO: Evaluate performance of GC Loading Loading @@ -616,7 +641,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRandomOperationsAndFlashWithGC() { testRandomOperationsAndFlashWithGC(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRandomOperationsAndFlashWithGC(formatVersion); } } private void testRandomOperationsAndFlashWithGC(final int formatVersion) { Loading Loading @@ -727,7 +754,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddManyUnigramsAndFlushWithGC() { testAddManyUnigramsAndFlushWithGC(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyUnigramsAndFlushWithGC(formatVersion); } } private void testAddManyUnigramsAndFlushWithGC(final int formatVersion) { Loading Loading @@ -775,7 +804,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testUnigramAndBigramCount() { testUnigramAndBigramCount(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testUnigramAndBigramCount(formatVersion); } } private void testUnigramAndBigramCount(final int formatVersion) { Loading Loading @@ -834,7 +865,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddMultipleDictionaryEntries() { testAddMultipleDictionaryEntries(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddMultipleDictionaryEntries(formatVersion); } } private void testAddMultipleDictionaryEntries(final int formatVersion) { Loading Loading @@ -896,7 +929,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testGetWordProperties() { testGetWordProperties(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testGetWordProperties(formatVersion); } } private void testGetWordProperties(final int formatVersion) { Loading Loading @@ -995,7 +1030,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testIterateAllWords() { testIterateAllWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testIterateAllWords(formatVersion); } } private void testIterateAllWords(final int formatVersion) { Loading Loading @@ -1091,7 +1128,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddShortcuts() { testAddShortcuts(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddShortcuts(formatVersion); } } private void testAddShortcuts(final int formatVersion) { Loading Loading @@ -1151,7 +1190,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddManyShortcuts() { testAddManyShortcuts(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyShortcuts(formatVersion); } } private void testAddManyShortcuts(final int formatVersion) { Loading Loading @@ -1227,7 +1268,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testDictMigration() { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion); } } private void testDictMigration(final int fromFormatVersion, final int toFormatVersion) { Loading Loading @@ -1271,7 +1314,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testLargeDictMigration() { testLargeDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testLargeDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion); } } private void testLargeDictMigration(final int fromFormatVersion, final int toFormatVersion) { Loading Loading
java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +2 −1 Original line number Diff line number Diff line Loading @@ -193,8 +193,9 @@ public final class FormatSpec { // Dictionary version used for testing. public static final int VERSION4_ONLY_FOR_TESTING = 399; public static final int VERSION4 = 401; public static final int VERSION4_DEV = 402; static final int MINIMUM_SUPPORTED_VERSION = VERSION2; static final int MAXIMUM_SUPPORTED_VERSION = VERSION4; static final int MAXIMUM_SUPPORTED_VERSION = VERSION4_DEV; // TODO: Make this value adaptative to content data, store it in the header, and // use it in the reading code. Loading
tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java +29 −14 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { private static final String TEST_DICT_FILE_EXTENSION = ".testDict"; private static final String TEST_LOCALE = "test"; private static final int DUMMY_PROBABILITY = 0; private static final int[] DICT_FORMAT_VERSIONS = new int[] { FormatSpec.VERSION4, FormatSpec.VERSION4_DEV }; private int mCurrentTime = 0; Loading Loading @@ -94,7 +96,8 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { private File createEmptyDictionaryAndGetFile(final String dictId, final int formatVersion) throws IOException { if (formatVersion == FormatSpec.VERSION4 || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING) { || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING || formatVersion == FormatSpec.VERSION4_DEV) { return createEmptyVer4DictionaryAndGetFile(dictId, formatVersion); } else { throw new IOException("Dictionary format version " + formatVersion Loading @@ -120,7 +123,7 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { return file; } else { throw new IOException("Empty dictionary " + file.getAbsolutePath() + " cannot be created."); + " cannot be created. Foramt version: " + formatVersion); } } Loading @@ -133,7 +136,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testReadDictInJavaSide() { testReadDictInJavaSide(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testReadDictInJavaSide(formatVersion); } } private void testReadDictInJavaSide(final int formatVersion) { Loading Loading @@ -178,10 +183,6 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testControlCurrentTime() { testControlCurrentTime(FormatSpec.VERSION4); } private void testControlCurrentTime(final int formatVersion) { final int TEST_COUNT = 1000; final long seed = System.currentTimeMillis(); final Random random = new Random(seed); Loading @@ -197,7 +198,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testAddValidAndInvalidWords() { testAddValidAndInvalidWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddValidAndInvalidWords(formatVersion); } } private void testAddValidAndInvalidWords(final int formatVersion) { Loading Loading @@ -240,7 +243,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testDecayingProbability() { testDecayingProbability(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testDecayingProbability(formatVersion); } } private void testDecayingProbability(final int formatVersion) { Loading Loading @@ -295,7 +300,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testAddManyUnigramsToDecayingDict() { testAddManyUnigramsToDecayingDict(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyUnigramsToDecayingDict(formatVersion); } } private void testAddManyUnigramsToDecayingDict(final int formatVersion) { Loading Loading @@ -354,7 +361,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testOverflowUnigrams() { testOverflowUnigrams(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testOverflowUnigrams(formatVersion); } } private void testOverflowUnigrams(final int formatVersion) { Loading Loading @@ -413,7 +422,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testAddManyBigramsToDecayingDict() { testAddManyBigramsToDecayingDict(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyBigramsToDecayingDict(formatVersion); } } private void testAddManyBigramsToDecayingDict(final int formatVersion) { Loading Loading @@ -487,7 +498,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testOverflowBigrams() { testOverflowBigrams(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testOverflowBigrams(formatVersion); } } private void testOverflowBigrams(final int formatVersion) { Loading Loading @@ -566,7 +579,9 @@ public class BinaryDictionaryDecayingTests extends AndroidTestCase { } public void testDictMigration() { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion); } } private void testDictMigration(final int fromFormatVersion, final int toFormatVersion) { Loading
tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java +68 −23 Original line number Diff line number Diff line Loading @@ -43,11 +43,14 @@ import java.util.Random; public class BinaryDictionaryTests extends AndroidTestCase { private static final String TEST_DICT_FILE_EXTENSION = ".testDict"; private static final String TEST_LOCALE = "test"; private static final int[] DICT_FORMAT_VERSIONS = new int[] { FormatSpec.VERSION4, FormatSpec.VERSION4_DEV }; private File createEmptyDictionaryAndGetFile(final String dictId, final int formatVersion) throws IOException { if (formatVersion == FormatSpec.VERSION4 || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING) { || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING || formatVersion == FormatSpec.VERSION4_DEV) { return createEmptyVer4DictionaryAndGetFile(dictId, formatVersion); } else { throw new IOException("Dictionary format version " + formatVersion Loading @@ -67,12 +70,14 @@ public class BinaryDictionaryTests extends AndroidTestCase { return file; } else { throw new IOException("Empty dictionary " + file.getAbsolutePath() + " cannot be created."); + " cannot be created. Format version: " + formatVersion); } } public void testIsValidDictionary() { testIsValidDictionary(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testIsValidDictionary(formatVersion); } } private void testIsValidDictionary(final int formatVersion) { Loading Loading @@ -100,7 +105,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testConstructingDictionaryOnMemory() { testConstructingDictionaryOnMemory(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testConstructingDictionaryOnMemory(formatVersion); } } private void testConstructingDictionaryOnMemory(final int formatVersion) { Loading Loading @@ -131,7 +138,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddTooLongWord() { testAddTooLongWord(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddTooLongWord(formatVersion); } } private void testAddTooLongWord(final int formatVersion) { Loading Loading @@ -190,7 +199,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddUnigramWord() { testAddUnigramWord(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddUnigramWord(formatVersion); } } private void testAddUnigramWord(final int formatVersion) { Loading Loading @@ -232,7 +243,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRandomlyAddUnigramWord() { testRandomlyAddUnigramWord(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRandomlyAddUnigramWord(formatVersion); } } private void testRandomlyAddUnigramWord(final int formatVersion) { Loading Loading @@ -268,7 +281,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddBigramWords() { testAddBigramWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddBigramWords(formatVersion); } } private void testAddBigramWords(final int formatVersion) { Loading Loading @@ -336,7 +351,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRandomlyAddBigramWords() { testRandomlyAddBigramWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRandomlyAddBigramWords(formatVersion); } } private void testRandomlyAddBigramWords(final int formatVersion) { Loading Loading @@ -397,7 +414,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRemoveBigramWords() { testRemoveBigramWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRemoveBigramWords(formatVersion); } } private void testRemoveBigramWords(final int formatVersion) { Loading Loading @@ -447,7 +466,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testFlushDictionary() { testFlushDictionary(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testFlushDictionary(formatVersion); } } private void testFlushDictionary(final int formatVersion) { Loading Loading @@ -499,7 +520,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testFlushWithGCDictionary() { testFlushWithGCDictionary(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testFlushWithGCDictionary(formatVersion); } } private void testFlushWithGCDictionary(final int formatVersion) { Loading Loading @@ -547,7 +570,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddBigramWordsAndFlashWithGC() { testAddBigramWordsAndFlashWithGC(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddBigramWordsAndFlashWithGC(formatVersion); } } // TODO: Evaluate performance of GC Loading Loading @@ -616,7 +641,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testRandomOperationsAndFlashWithGC() { testRandomOperationsAndFlashWithGC(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testRandomOperationsAndFlashWithGC(formatVersion); } } private void testRandomOperationsAndFlashWithGC(final int formatVersion) { Loading Loading @@ -727,7 +754,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddManyUnigramsAndFlushWithGC() { testAddManyUnigramsAndFlushWithGC(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyUnigramsAndFlushWithGC(formatVersion); } } private void testAddManyUnigramsAndFlushWithGC(final int formatVersion) { Loading Loading @@ -775,7 +804,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testUnigramAndBigramCount() { testUnigramAndBigramCount(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testUnigramAndBigramCount(formatVersion); } } private void testUnigramAndBigramCount(final int formatVersion) { Loading Loading @@ -834,7 +865,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddMultipleDictionaryEntries() { testAddMultipleDictionaryEntries(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddMultipleDictionaryEntries(formatVersion); } } private void testAddMultipleDictionaryEntries(final int formatVersion) { Loading Loading @@ -896,7 +929,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testGetWordProperties() { testGetWordProperties(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testGetWordProperties(formatVersion); } } private void testGetWordProperties(final int formatVersion) { Loading Loading @@ -995,7 +1030,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testIterateAllWords() { testIterateAllWords(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testIterateAllWords(formatVersion); } } private void testIterateAllWords(final int formatVersion) { Loading Loading @@ -1091,7 +1128,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddShortcuts() { testAddShortcuts(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddShortcuts(formatVersion); } } private void testAddShortcuts(final int formatVersion) { Loading Loading @@ -1151,7 +1190,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testAddManyShortcuts() { testAddManyShortcuts(FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testAddManyShortcuts(formatVersion); } } private void testAddManyShortcuts(final int formatVersion) { Loading Loading @@ -1227,7 +1268,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testDictMigration() { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion); } } private void testDictMigration(final int fromFormatVersion, final int toFormatVersion) { Loading Loading @@ -1271,7 +1314,9 @@ public class BinaryDictionaryTests extends AndroidTestCase { } public void testLargeDictMigration() { testLargeDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, FormatSpec.VERSION4); for (final int formatVersion : DICT_FORMAT_VERSIONS) { testLargeDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion); } } private void testLargeDictMigration(final int fromFormatVersion, final int toFormatVersion) { Loading