From 5c7c538f163c5013bc36c87a6befef58aae22a19 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 28 Feb 2014 13:15:27 +0900 Subject: [PATCH] Add unit test message for KeyboardLayoutSetTests Change-Id: Ia92e4b410ca966d2dc1c5f29a340d366aa066838 --- .../keyboard/KeyboardLayoutSetTestsBase.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 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 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,