diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java | 17 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java index 6dcf51370..9939a4335 100644 --- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java +++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java @@ -80,12 +80,25 @@ public class KeyboardLayoutSetTestsBase extends AndroidTestCase { || mScreenMetrics == Constants.SCREEN_METRICS_LARGE_PHONE; } + private static String toString(final ArrayList<InputMethodSubtype> subtypeList) { + final StringBuilder sb = new StringBuilder(); + for (int index = 0; index < subtypeList.size(); index++) { + final InputMethodSubtype subtype = subtypeList.get(index); + sb.append((index + 1) + ": "); + sb.append(SubtypeLocaleUtils.getSubtypeNameForLogging(subtype)); + sb.append("\n"); + } + return sb.toString(); + } + public final void testAllSubtypesCount() { - assertEquals(NUMBER_OF_SUBTYPES, mAllSubtypesList.size()); + assertEquals(toString(mAllSubtypesList), + NUMBER_OF_SUBTYPES, mAllSubtypesList.size()); } public final void testAsciiCapableSubtypesCount() { - assertEquals(NUMBER_OF_ASCII_CAPABLE_SUBTYPES, mAsciiCapableSubtypesList.size()); + assertEquals(toString(mAsciiCapableSubtypesList), + NUMBER_OF_ASCII_CAPABLE_SUBTYPES, mAsciiCapableSubtypesList.size()); } protected final InputMethodSubtype getSubtype(final Locale locale, diff --git a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java index b1239f0af..6ace2de4f 100644 --- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java +++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java @@ -267,13 +267,13 @@ public class UserHistoryDictionaryTests extends AndroidTestCase { assertTrue(dict.isInUnderlyingBinaryDictionaryForTests(word)); } forcePassingShortTime(); - dict.decayIfNeeded(); + dict.runGCIfRequired(); dict.waitAllTasksForTests(); for (final String word : words) { assertTrue(dict.isInUnderlyingBinaryDictionaryForTests(word)); } forcePassingLongTime(); - dict.decayIfNeeded(); + dict.runGCIfRequired(); dict.waitAllTasksForTests(); for (final String word : words) { assertFalse(dict.isInUnderlyingBinaryDictionaryForTests(word)); |