am b12c2af3: Tighten unit test condition of MoreKeysKeyboardBuilder

* commit 'b12c2af32e09624e1298e0109441b0f4d74b74dd':
  Tighten unit test condition of MoreKeysKeyboardBuilder
main
Tadashi G. Takaoka 2013-04-14 18:17:25 -07:00 committed by Android Git Automerger
commit be1232b36f
2 changed files with 8 additions and 8 deletions

View File

@ -43,10 +43,10 @@ public class MoreKeysKeyboardBuilderFixedOrderTests extends AndroidTestCase {
super.setUp(); super.setUp();
} }
private static MoreKeysKeyboardParams createParams(int numKeys, int columnNum, private static MoreKeysKeyboardParams createParams(final int numKeys, final int columnNum,
int coordXInParnet) { final int coordXInParent) {
final MoreKeysKeyboardParams params = new MoreKeysKeyboardParams(); final MoreKeysKeyboardParams params = new MoreKeysKeyboardParams();
params.setParameters(numKeys, columnNum, WIDTH, HEIGHT, coordXInParnet, KEYBOARD_WIDTH, params.setParameters(numKeys, columnNum, WIDTH, HEIGHT, coordXInParent, KEYBOARD_WIDTH,
/* isFixedOrderColumn */true, /* dividerWidth */0); /* isFixedOrderColumn */true, /* dividerWidth */0);
return params; return params;
} }
@ -55,7 +55,7 @@ public class MoreKeysKeyboardBuilderFixedOrderTests extends AndroidTestCase {
MoreKeysKeyboardParams params = null; MoreKeysKeyboardParams params = null;
try { try {
final int fixColumns = KEYBOARD_WIDTH / WIDTH; final int fixColumns = KEYBOARD_WIDTH / WIDTH;
params = createParams(10, fixColumns + 1, HEIGHT); params = createParams(fixColumns + 1, fixColumns + 1, HEIGHT);
fail("Should throw IllegalArgumentException"); fail("Should throw IllegalArgumentException");
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// Too small keyboard to hold more keys keyboard. // Too small keyboard to hold more keys keyboard.

View File

@ -43,10 +43,10 @@ public class MoreKeysKeyboardBuilderTests extends AndroidTestCase {
super.setUp(); super.setUp();
} }
private static MoreKeysKeyboardParams createParams(int numKeys, int maxColumns, private static MoreKeysKeyboardParams createParams(final int numKeys, final int maxColumns,
int coordXInParnet) { final int coordXInParent) {
final MoreKeysKeyboardParams params = new MoreKeysKeyboardParams(); final MoreKeysKeyboardParams params = new MoreKeysKeyboardParams();
params.setParameters(numKeys, maxColumns, WIDTH, HEIGHT, coordXInParnet, KEYBOARD_WIDTH, params.setParameters(numKeys, maxColumns, WIDTH, HEIGHT, coordXInParent, KEYBOARD_WIDTH,
/* isFixedOrderColumn */false, /* dividerWidth */0); /* isFixedOrderColumn */false, /* dividerWidth */0);
return params; return params;
} }
@ -55,7 +55,7 @@ public class MoreKeysKeyboardBuilderTests extends AndroidTestCase {
MoreKeysKeyboardParams params = null; MoreKeysKeyboardParams params = null;
try { try {
final int maxColumns = KEYBOARD_WIDTH / WIDTH; final int maxColumns = KEYBOARD_WIDTH / WIDTH;
params = createParams(10, maxColumns + 1, HEIGHT); params = createParams(maxColumns + 1, maxColumns + 1, HEIGHT);
fail("Should throw IllegalArgumentException"); fail("Should throw IllegalArgumentException");
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
// Too small keyboard to hold more keys keyboard. // Too small keyboard to hold more keys keyboard.