1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.inputmethod.keyboard; 18 19 import static org.junit.Assert.assertEquals; 20 import static org.junit.Assert.assertNull; 21 import static org.junit.Assert.fail; 22 23 import androidx.test.filters.MediumTest; 24 import androidx.test.runner.AndroidJUnit4; 25 26 import com.android.inputmethod.keyboard.MoreKeysKeyboard.MoreKeysKeyboardParams; 27 28 import org.junit.Test; 29 import org.junit.runner.RunWith; 30 31 @MediumTest 32 @RunWith(AndroidJUnit4.class) 33 public class MoreKeysKeyboardBuilderAutoOrderTests { 34 private static final int WIDTH = 10; 35 private static final int HEIGHT = 10; 36 37 private static final int KEYBOARD_WIDTH = WIDTH * 10; 38 private static final int XPOS_L0 = WIDTH * 0 + WIDTH / 2; 39 private static final int XPOS_L1 = WIDTH * 1 + WIDTH / 2; 40 private static final int XPOS_L2 = WIDTH * 2 + WIDTH / 2; 41 private static final int XPOS_L3 = WIDTH * 3 + WIDTH / 2; 42 private static final int XPOS_M0 = WIDTH * 4 + WIDTH / 2; 43 private static final int XPOS_M1 = WIDTH * 5 + WIDTH / 2; 44 private static final int XPOS_R3 = WIDTH * 6 + WIDTH / 2; 45 private static final int XPOS_R2 = WIDTH * 7 + WIDTH / 2; 46 private static final int XPOS_R1 = WIDTH * 8 + WIDTH / 2; 47 private static final int XPOS_R0 = WIDTH * 9 + WIDTH / 2; 48 createParams(final int numKeys, final int columnNum, final int coordXInParent)49 private static MoreKeysKeyboardParams createParams(final int numKeys, final int columnNum, 50 final int coordXInParent) { 51 final MoreKeysKeyboardParams params = new MoreKeysKeyboardParams(); 52 params.setParameters(numKeys, columnNum, WIDTH, HEIGHT, coordXInParent, KEYBOARD_WIDTH, 53 true /* isMoreKeysFixedColumn */, false /* isMoreKeysFixedOrder */, 54 0 /* dividerWidth */); 55 return params; 56 } 57 58 @Test testLayoutError()59 public void testLayoutError() { 60 MoreKeysKeyboardParams params = null; 61 try { 62 final int maxColumns = KEYBOARD_WIDTH / WIDTH; 63 params = createParams(maxColumns + 1, maxColumns + 1, HEIGHT); 64 fail("Should throw IllegalArgumentException"); 65 } catch (IllegalArgumentException e) { 66 // Too small keyboard to hold more keys keyboard. 67 } 68 assertNull("Too small keyboard to hold more keys keyboard", params); 69 } 70 71 // More keys keyboard layout test. 72 // "[n]" represents n-th key position in more keys keyboard. 73 // "<1>" is the default key. 74 75 // <1> 76 @Test testLayout1KeyAuto5M0()77 public void testLayout1KeyAuto5M0() { 78 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_M0); 79 assertEquals("1 key auto 5 M0 columns", 1, params.mNumColumns); 80 assertEquals("1 key auto 5 M0 rows", 1, params.mNumRows); 81 assertEquals("1 key auto 5 M0 left", 0, params.mLeftKeys); 82 assertEquals("1 key auto 5 M0 right", 1, params.mRightKeys); 83 assertEquals("1 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 84 assertEquals("1 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 85 assertEquals("1 key auto 5 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 86 } 87 88 // |<1> 89 @Test testLayout1KeyAuto5L0()90 public void testLayout1KeyAuto5L0() { 91 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L0); 92 assertEquals("1 key auto 5 L0 columns", 1, params.mNumColumns); 93 assertEquals("1 key auto 5 L0 rows", 1, params.mNumRows); 94 assertEquals("1 key auto 5 L0 left", 0, params.mLeftKeys); 95 assertEquals("1 key auto 5 L0 right", 1, params.mRightKeys); 96 assertEquals("1 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 97 assertEquals("1 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 98 assertEquals("1 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 99 } 100 101 // |___ <1> 102 @Test testLayout1KeyAuto5L1()103 public void testLayout1KeyAuto5L1() { 104 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L1); 105 assertEquals("1 key auto 5 L1 columns", 1, params.mNumColumns); 106 assertEquals("1 key auto 5 L1 rows", 1, params.mNumRows); 107 assertEquals("1 key auto 5 L1 left", 0, params.mLeftKeys); 108 assertEquals("1 key auto 5 L1 right", 1, params.mRightKeys); 109 assertEquals("1 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 110 assertEquals("1 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 111 assertEquals("1 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 112 } 113 114 // |___ ___ <1> 115 @Test testLayout1KeyAuto5L2()116 public void testLayout1KeyAuto5L2() { 117 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L2); 118 assertEquals("1 key auto 5 L2 columns", 1, params.mNumColumns); 119 assertEquals("1 key auto 5 L2 rows", 1, params.mNumRows); 120 assertEquals("1 key auto 5 L2 left", 0, params.mLeftKeys); 121 assertEquals("1 key auto 5 L2 right", 1, params.mRightKeys); 122 assertEquals("1 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 123 assertEquals("1 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 124 assertEquals("1 key auto 5 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 125 } 126 127 // <1>| 128 @Test testLayout1KeyAuto5R0()129 public void testLayout1KeyAuto5R0() { 130 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R0); 131 assertEquals("1 key auto 5 R0 columns", 1, params.mNumColumns); 132 assertEquals("1 key auto 5 R0 rows", 1, params.mNumRows); 133 assertEquals("1 key auto 5 R0 left", 0, params.mLeftKeys); 134 assertEquals("1 key auto 5 R0 right", 1, params.mRightKeys); 135 assertEquals("1 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 136 assertEquals("1 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 137 assertEquals("1 key auto 5 R0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 138 } 139 140 // <1> ___| 141 @Test testLayout1KeyAuto5R1()142 public void testLayout1KeyAuto5R1() { 143 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R1); 144 assertEquals("1 key auto 5 R1 columns", 1, params.mNumColumns); 145 assertEquals("1 key auto 5 R1 rows", 1, params.mNumRows); 146 assertEquals("1 key auto 5 R1 left", 0, params.mLeftKeys); 147 assertEquals("1 key auto 5 R1 right", 1, params.mRightKeys); 148 assertEquals("1 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 149 assertEquals("1 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 150 assertEquals("1 key auto 5 R1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 151 } 152 153 // <1> ___ ___| 154 @Test testLayout1KeyAuto5R2()155 public void testLayout1KeyAuto5R2() { 156 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R2); 157 assertEquals("1 key auto 5 R2 columns", 1, params.mNumColumns); 158 assertEquals("1 key auto 5 R2 rows", 1, params.mNumRows); 159 assertEquals("1 key auto 5 R2 left", 0, params.mLeftKeys); 160 assertEquals("1 key auto 5 R2 right", 1, params.mRightKeys); 161 assertEquals("1 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 162 assertEquals("1 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 163 assertEquals("1 key auto 5 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 164 } 165 166 // <1> [2] 167 @Test testLayout2KeyAuto5M0()168 public void testLayout2KeyAuto5M0() { 169 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_M0); 170 assertEquals("2 key auto 5 M0 columns", 2, params.mNumColumns); 171 assertEquals("2 key auto 5 M0 rows", 1, params.mNumRows); 172 assertEquals("2 key auto 5 M0 left", 0, params.mLeftKeys); 173 assertEquals("2 key auto 5 M0 right", 2, params.mRightKeys); 174 assertEquals("2 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 175 assertEquals("2 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 176 assertEquals("2 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 177 assertEquals("2 key auto 5 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 178 } 179 180 // |<1> [2] 181 @Test testLayout2KeyAuto5L0()182 public void testLayout2KeyAuto5L0() { 183 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L0); 184 assertEquals("2 key auto 5 L0 columns", 2, params.mNumColumns); 185 assertEquals("2 key auto 5 L0 rows", 1, params.mNumRows); 186 assertEquals("2 key auto 5 L0 left", 0, params.mLeftKeys); 187 assertEquals("2 key auto 5 L0 right", 2, params.mRightKeys); 188 assertEquals("2 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 189 assertEquals("2 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 190 assertEquals("2 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 191 assertEquals("2 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 192 } 193 194 // |___ <1> [2] 195 @Test testLayout2KeyAuto5L1()196 public void testLayout2KeyAuto5L1() { 197 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L1); 198 assertEquals("2 key auto 5 L1 columns", 2, params.mNumColumns); 199 assertEquals("2 key auto 5 L1 rows", 1, params.mNumRows); 200 assertEquals("2 key auto 5 L1 left", 0, params.mLeftKeys); 201 assertEquals("2 key auto 5 L1 right", 2, params.mRightKeys); 202 assertEquals("2 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 203 assertEquals("2 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 204 assertEquals("2 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 205 assertEquals("2 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 206 } 207 208 // |___ ___ <1> [2] 209 @Test testLayout2KeyAuto5L2()210 public void testLayout2KeyAuto5L2() { 211 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L2); 212 assertEquals("2 key auto 5 L2 columns", 2, params.mNumColumns); 213 assertEquals("2 key auto 5 L2 rows", 1, params.mNumRows); 214 assertEquals("2 key auto 5 L2 left", 0, params.mLeftKeys); 215 assertEquals("2 key auto 5 L2 right", 2, params.mRightKeys); 216 assertEquals("2 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 217 assertEquals("2 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 218 assertEquals("2 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 219 assertEquals("2 key auto 5 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 220 } 221 222 // [2] <1>| 223 @Test testLayout2KeyAuto5R0()224 public void testLayout2KeyAuto5R0() { 225 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R0); 226 assertEquals("2 key auto 5 R0 columns", 2, params.mNumColumns); 227 assertEquals("2 key auto 5 R0 rows", 1, params.mNumRows); 228 assertEquals("2 key auto 5 R0 left", 1, params.mLeftKeys); 229 assertEquals("2 key auto 5 R0 right", 1, params.mRightKeys); 230 assertEquals("2 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 231 assertEquals("2 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 232 assertEquals("2 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 233 assertEquals("2 key auto 5 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 234 } 235 236 // [2] <1> ___| 237 @Test testLayout2KeyAuto5R1()238 public void testLayout2KeyAuto5R1() { 239 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R1); 240 assertEquals("2 key auto 5 R1 columns", 2, params.mNumColumns); 241 assertEquals("2 key auto 5 R1 rows", 1, params.mNumRows); 242 assertEquals("2 key auto 5 R1 left", 1, params.mLeftKeys); 243 assertEquals("2 key auto 5 R1 right", 1, params.mRightKeys); 244 assertEquals("2 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 245 assertEquals("2 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 246 assertEquals("2 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 247 assertEquals("2 key auto 5 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 248 } 249 250 // <1> [2] ___| 251 @Test testLayout2KeyAuto5R2()252 public void testLayout2KeyAuto5R2() { 253 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R2); 254 assertEquals("2 key auto 5 R2 columns", 2, params.mNumColumns); 255 assertEquals("2 key auto 5 R2 rows", 1, params.mNumRows); 256 assertEquals("2 key auto 5 R2 left", 0, params.mLeftKeys); 257 assertEquals("2 key auto 5 R2 right", 2, params.mRightKeys); 258 assertEquals("2 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 259 assertEquals("2 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 260 assertEquals("2 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 261 assertEquals("2 key auto 5 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 262 } 263 264 // [3] <1> [2] 265 @Test testLayout3KeyAuto5M0()266 public void testLayout3KeyAuto5M0() { 267 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_M0); 268 assertEquals("3 key auto 5 M0 columns", 3, params.mNumColumns); 269 assertEquals("3 key auto 5 M0 rows", 1, params.mNumRows); 270 assertEquals("3 key auto 5 M0 left", 1, params.mLeftKeys); 271 assertEquals("3 key auto 5 M0 right", 2, params.mRightKeys); 272 assertEquals("3 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 273 assertEquals("3 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 274 assertEquals("3 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 275 assertEquals("3 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 276 assertEquals("3 key auto 5 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 277 } 278 279 // |<1> [2] [3] 280 @Test testLayout3KeyAuto5L0()281 public void testLayout3KeyAuto5L0() { 282 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L0); 283 assertEquals("3 key auto 5 L0 columns", 3, params.mNumColumns); 284 assertEquals("3 key auto 5 L0 rows", 1, params.mNumRows); 285 assertEquals("3 key auto 5 L0 left", 0, params.mLeftKeys); 286 assertEquals("3 key auto 5 L0 right", 3, params.mRightKeys); 287 assertEquals("3 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 288 assertEquals("3 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 289 assertEquals("3 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 290 assertEquals("3 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 291 assertEquals("3 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 292 } 293 294 // |___ <1> [2] [3] 295 @Test testLayout3KeyAuto5L1()296 public void testLayout3KeyAuto5L1() { 297 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L1); 298 assertEquals("3 key auto 5 L1 columns", 3, params.mNumColumns); 299 assertEquals("3 key auto 5 L1 rows", 1, params.mNumRows); 300 assertEquals("3 key auto 5 L1 left", 0, params.mLeftKeys); 301 assertEquals("3 key auto 5 L1 right", 3, params.mRightKeys); 302 assertEquals("3 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 303 assertEquals("3 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 304 assertEquals("3 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 305 assertEquals("3 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 306 assertEquals("3 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 307 } 308 309 // |___ [3] <1> [2] 310 @Test testLayout3KeyAuto5L2()311 public void testLayout3KeyAuto5L2() { 312 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L2); 313 assertEquals("3 key auto 5 L2 columns", 3, params.mNumColumns); 314 assertEquals("3 key auto 5 L2 rows", 1, params.mNumRows); 315 assertEquals("3 key auto 5 L2 left", 1, params.mLeftKeys); 316 assertEquals("3 key auto 5 L2 right", 2, params.mRightKeys); 317 assertEquals("3 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 318 assertEquals("3 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 319 assertEquals("3 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 320 assertEquals("3 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 321 assertEquals("3 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 322 } 323 324 // [3] [2] <1>| 325 @Test testLayout3KeyAuto5R0()326 public void testLayout3KeyAuto5R0() { 327 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R0); 328 assertEquals("3 key auto 5 R0 columns", 3, params.mNumColumns); 329 assertEquals("3 key auto 5 R0 rows", 1, params.mNumRows); 330 assertEquals("3 key auto 5 R0 left", 2, params.mLeftKeys); 331 assertEquals("3 key auto 5 R0 right", 1, params.mRightKeys); 332 assertEquals("3 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 333 assertEquals("3 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 334 assertEquals("3 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 335 assertEquals("3 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 336 assertEquals("3 key auto 5 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 337 } 338 339 // [3] [2] <1> ___| 340 @Test testLayout3KeyAuto5R1()341 public void testLayout3KeyAuto5R1() { 342 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R1); 343 assertEquals("3 key auto 5 R1 columns", 3, params.mNumColumns); 344 assertEquals("3 key auto 5 R1 rows", 1, params.mNumRows); 345 assertEquals("3 key auto 5 R1 left", 2, params.mLeftKeys); 346 assertEquals("3 key auto 5 R1 right", 1, params.mRightKeys); 347 assertEquals("3 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 348 assertEquals("3 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 349 assertEquals("3 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 350 assertEquals("3 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 351 assertEquals("3 key auto 5 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 352 } 353 354 // [3] <1> [2] ___| 355 @Test testLayout3KeyAuto5R2()356 public void testLayout3KeyAuto5R2() { 357 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R2); 358 assertEquals("3 key auto 5 R2 columns", 3, params.mNumColumns); 359 assertEquals("3 key auto 5 R2 rows", 1, params.mNumRows); 360 assertEquals("3 key auto 5 R2 left", 1, params.mLeftKeys); 361 assertEquals("3 key auto 5 R2 right", 2, params.mRightKeys); 362 assertEquals("3 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 363 assertEquals("3 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 364 assertEquals("3 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 365 assertEquals("3 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 366 assertEquals("3 key auto 5 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 367 } 368 369 // [3] 370 // <1> [2] 371 @Test testLayout3KeyAuto2M0()372 public void testLayout3KeyAuto2M0() { 373 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_M0); 374 assertEquals("3 key auto 2 M0 columns", 2, params.mNumColumns); 375 assertEquals("3 key auto 2 M0 rows", 2, params.mNumRows); 376 assertEquals("3 key auto 2 M0 left", 0, params.mLeftKeys); 377 assertEquals("3 key auto 2 M0 right", 2, params.mRightKeys); 378 assertEquals("3 key auto 2 M0 <1>", 0, params.getColumnPos(0)); 379 assertEquals("3 key auto 2 M0 [2]", 1, params.getColumnPos(1)); 380 assertEquals("3 key auto 2 M0 [3]", 0, params.getColumnPos(2)); 381 assertEquals("3 key auto 2 M0 adjust", 0, params.mTopRowAdjustment); 382 assertEquals("3 key auto 2 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 383 } 384 385 // |[3] 386 // |<1> [2] 387 @Test testLayout3KeyAuto2L0()388 public void testLayout3KeyAuto2L0() { 389 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L0); 390 assertEquals("3 key auto 2 L0 columns", 2, params.mNumColumns); 391 assertEquals("3 key auto 2 L0 rows", 2, params.mNumRows); 392 assertEquals("3 key auto 2 L0 left", 0, params.mLeftKeys); 393 assertEquals("3 key auto 2 L0 right", 2, params.mRightKeys); 394 assertEquals("3 key auto 2 L0 <1>", 0, params.getColumnPos(0)); 395 assertEquals("3 key auto 2 L0 [2]", 1, params.getColumnPos(1)); 396 assertEquals("3 key auto 2 L0 [3]", 0, params.getColumnPos(2)); 397 assertEquals("3 key auto 2 L0 adjust", 0, params.mTopRowAdjustment); 398 assertEquals("3 key auto 2 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 399 } 400 401 // |___ [3] 402 // |___ <1> [2] 403 @Test testLayout3KeyAuto2L1()404 public void testLayout3KeyAuto2L1() { 405 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L1); 406 assertEquals("3 key auto 2 L1 columns", 2, params.mNumColumns); 407 assertEquals("3 key auto 2 L1 rows", 2, params.mNumRows); 408 assertEquals("3 key auto 2 L1 left", 0, params.mLeftKeys); 409 assertEquals("3 key auto 2 L1 right", 2, params.mRightKeys); 410 assertEquals("3 key auto 2 L1 <1>", 0, params.getColumnPos(0)); 411 assertEquals("3 key auto 2 L1 [2]", 1, params.getColumnPos(1)); 412 assertEquals("3 key auto 2 L1 [3]", 0, params.getColumnPos(2)); 413 assertEquals("3 key auto 2 L1 adjust", 0, params.mTopRowAdjustment); 414 assertEquals("3 key auto 2 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 415 } 416 417 // | [3] 418 // |___ ___ <1> [2] 419 @Test testLayout3KeyAuto2L2()420 public void testLayout3KeyAuto2L2() { 421 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L2); 422 assertEquals("3 key auto 2 L2 columns", 2, params.mNumColumns); 423 assertEquals("3 key auto 2 L2 rows", 2, params.mNumRows); 424 assertEquals("3 key auto 2 L2 left", 0, params.mLeftKeys); 425 assertEquals("3 key auto 2 L2 right", 2, params.mRightKeys); 426 assertEquals("3 key auto 2 L2 <1>", 0, params.getColumnPos(0)); 427 assertEquals("3 key auto 2 L2 [2]", 1, params.getColumnPos(1)); 428 assertEquals("3 key auto 2 L2 [3]", 0, params.getColumnPos(2)); 429 assertEquals("3 key auto 2 L2 adjust", 0, params.mTopRowAdjustment); 430 assertEquals("3 key auto 2 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 431 } 432 433 // [3]| 434 // [2] <1>| 435 @Test testLayout3KeyAuto2R0()436 public void testLayout3KeyAuto2R0() { 437 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R0); 438 assertEquals("3 key auto 2 R0 columns", 2, params.mNumColumns); 439 assertEquals("3 key auto 2 R0 rows", 2, params.mNumRows); 440 assertEquals("3 key auto 2 R0 left", 1, params.mLeftKeys); 441 assertEquals("3 key auto 2 R0 right", 1, params.mRightKeys); 442 assertEquals("3 key auto 2 R0 <1>", 0, params.getColumnPos(0)); 443 assertEquals("3 key auto 2 R0 [2]", -1, params.getColumnPos(1)); 444 assertEquals("3 key auto 2 R0 [3]", 0, params.getColumnPos(2)); 445 assertEquals("3 key auto 2 R0 adjust", 0, params.mTopRowAdjustment); 446 assertEquals("3 key auto 2 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 447 } 448 449 // [3] | 450 // [2] <1> ___| 451 @Test testLayout3KeyAuto2R1()452 public void testLayout3KeyAuto2R1() { 453 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R1); 454 assertEquals("3 key auto 2 R1 columns", 2, params.mNumColumns); 455 assertEquals("3 key auto 2 R1 rows", 2, params.mNumRows); 456 assertEquals("3 key auto 2 R1 left", 1, params.mLeftKeys); 457 assertEquals("3 key auto 2 R1 right", 1, params.mRightKeys); 458 assertEquals("3 key auto 2 R1 <1>", 0, params.getColumnPos(0)); 459 assertEquals("3 key auto 2 R1 [2]", -1, params.getColumnPos(1)); 460 assertEquals("3 key auto 2 R1 [3]", 0, params.getColumnPos(2)); 461 assertEquals("3 key auto 2 R1 adjust", 0, params.mTopRowAdjustment); 462 assertEquals("3 key auto 2 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 463 } 464 465 // [3] | 466 // <1> [2] ___| 467 @Test testLayout3KeyAuto2R2()468 public void testLayout3KeyAuto2R2() { 469 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R2); 470 assertEquals("3 key auto 2 R2 columns", 2, params.mNumColumns); 471 assertEquals("3 key auto 2 R2 rows", 2, params.mNumRows); 472 assertEquals("3 key auto 2 R2 left", 0, params.mLeftKeys); 473 assertEquals("3 key auto 2 R2 right", 2, params.mRightKeys); 474 assertEquals("3 key auto 2 R2 <1>", 0, params.getColumnPos(0)); 475 assertEquals("3 key auto 2 R2 [2]", 1, params.getColumnPos(1)); 476 assertEquals("3 key auto 2 R2 [3]", 0, params.getColumnPos(2)); 477 assertEquals("3 key auto 2 R2 adjust", 0, params.mTopRowAdjustment); 478 assertEquals("3 key auto 2 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 479 } 480 481 // [4] 482 // [3] <1> [2] 483 @Test testLayout4KeyAuto3M0()484 public void testLayout4KeyAuto3M0() { 485 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_M0); 486 assertEquals("4 key auto 3 M0 columns", 3, params.mNumColumns); 487 assertEquals("4 key auto 3 M0 rows", 2, params.mNumRows); 488 assertEquals("4 key auto 3 M0 left", 1, params.mLeftKeys); 489 assertEquals("4 key auto 3 M0 right", 2, params.mRightKeys); 490 assertEquals("4 key auto 3 M0 <1>", 0, params.getColumnPos(0)); 491 assertEquals("4 key auto 3 M0 [2]", 1, params.getColumnPos(1)); 492 assertEquals("4 key auto 3 M0 [3]", -1, params.getColumnPos(2)); 493 assertEquals("4 key auto 3 M0 [4]", 0, params.getColumnPos(3)); 494 assertEquals("4 key auto 3 M0 adjust", 0, params.mTopRowAdjustment); 495 assertEquals("4 key auto 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 496 } 497 498 // |[4] 499 // |<1> [2] [3] 500 @Test testLayout4KeyAuto3L0()501 public void testLayout4KeyAuto3L0() { 502 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L0); 503 assertEquals("4 key auto 3 L0 columns", 3, params.mNumColumns); 504 assertEquals("4 key auto 3 L0 rows", 2, params.mNumRows); 505 assertEquals("4 key auto 3 L0 left", 0, params.mLeftKeys); 506 assertEquals("4 key auto 3 L0 right", 3, params.mRightKeys); 507 assertEquals("4 key auto 3 L0 <1>", 0, params.getColumnPos(0)); 508 assertEquals("4 key auto 3 L0 [2]", 1, params.getColumnPos(1)); 509 assertEquals("4 key auto 3 L0 [3]", 2, params.getColumnPos(2)); 510 assertEquals("4 key auto 3 L0 [4]", 0, params.getColumnPos(3)); 511 assertEquals("4 key auto 3 L0 adjust", 0, params.mTopRowAdjustment); 512 assertEquals("4 key auto 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 513 } 514 515 // |___ [4] 516 // |___ <1> [2] [3] 517 @Test testLayout4KeyAuto3L1()518 public void testLayout4KeyAuto3L1() { 519 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L1); 520 assertEquals("4 key auto 3 L1 columns", 3, params.mNumColumns); 521 assertEquals("4 key auto 3 L1 rows", 2, params.mNumRows); 522 assertEquals("4 key auto 3 L1 left", 0, params.mLeftKeys); 523 assertEquals("4 key auto 3 L1 right", 3, params.mRightKeys); 524 assertEquals("4 key auto 3 L1 <1>", 0, params.getColumnPos(0)); 525 assertEquals("4 key auto 3 L1 [2]", 1, params.getColumnPos(1)); 526 assertEquals("4 key auto 3 L1 [3]", 2, params.getColumnPos(2)); 527 assertEquals("4 key auto 3 L1 [4]", 0, params.getColumnPos(3)); 528 assertEquals("4 key auto 3 L1 adjust", 0, params.mTopRowAdjustment); 529 assertEquals("4 key auto 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 530 } 531 532 // |___ ___ [4] 533 // |___ [3] <1> [2] 534 @Test testLayout4KeyAuto3L2()535 public void testLayout4KeyAuto3L2() { 536 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L2); 537 assertEquals("4 key auto 3 L2 columns", 3, params.mNumColumns); 538 assertEquals("4 key auto 3 L2 rows", 2, params.mNumRows); 539 assertEquals("4 key auto 3 L2 left", 1, params.mLeftKeys); 540 assertEquals("4 key auto 3 L2 right", 2, params.mRightKeys); 541 assertEquals("4 key auto 3 L2 <1>", 0, params.getColumnPos(0)); 542 assertEquals("4 key auto 3 L2 [2]", 1, params.getColumnPos(1)); 543 assertEquals("4 key auto 3 L2 [3]", -1, params.getColumnPos(2)); 544 assertEquals("4 key auto 3 L2 [4]", 0, params.getColumnPos(3)); 545 assertEquals("4 key auto 3 L2 adjust", 0, params.mTopRowAdjustment); 546 assertEquals("4 key auto 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 547 } 548 549 // [4]| 550 // [3] [2] <1>| 551 @Test testLayout4KeyAuto3R0()552 public void testLayout4KeyAuto3R0() { 553 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R0); 554 assertEquals("4 key auto 3 R0 columns", 3, params.mNumColumns); 555 assertEquals("4 key auto 3 R0 rows", 2, params.mNumRows); 556 assertEquals("4 key auto 3 R0 left", 2, params.mLeftKeys); 557 assertEquals("4 key auto 3 R0 right", 1, params.mRightKeys); 558 assertEquals("4 key auto 3 R0 <1>", 0, params.getColumnPos(0)); 559 assertEquals("4 key auto 3 R0 [2]", -1, params.getColumnPos(1)); 560 assertEquals("4 key auto 3 R0 [3]", -2, params.getColumnPos(2)); 561 assertEquals("4 key auto 3 R0 [4]", 0, params.getColumnPos(3)); 562 assertEquals("4 key auto 3 R0 adjust", 0, params.mTopRowAdjustment); 563 assertEquals("4 key auto 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 564 } 565 566 // [4] ___| 567 // [3] [2] <1> ___| 568 @Test testLayout4KeyAuto3R1()569 public void testLayout4KeyAuto3R1() { 570 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R1); 571 assertEquals("4 key auto 3 R1 columns", 3, params.mNumColumns); 572 assertEquals("4 key auto 3 R1 rows", 2, params.mNumRows); 573 assertEquals("4 key auto 3 R1 left", 2, params.mLeftKeys); 574 assertEquals("4 key auto 3 R1 right", 1, params.mRightKeys); 575 assertEquals("4 key auto 3 R1 <1>", 0, params.getColumnPos(0)); 576 assertEquals("4 key auto 3 R1 [2]", -1, params.getColumnPos(1)); 577 assertEquals("4 key auto 3 R1 [3]", -2, params.getColumnPos(2)); 578 assertEquals("4 key auto 3 R1 [4]", 0, params.getColumnPos(3)); 579 assertEquals("4 key auto 3 R1 adjust", 0, params.mTopRowAdjustment); 580 assertEquals("4 key auto 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 581 } 582 583 // [4] ___| 584 // [3] <1> [2] ___| 585 @Test testLayout4KeyAuto3R2()586 public void testLayout4KeyAuto3R2() { 587 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R2); 588 assertEquals("4 key auto 3 R2 columns", 3, params.mNumColumns); 589 assertEquals("4 key auto 3 R2 rows", 2, params.mNumRows); 590 assertEquals("4 key auto 3 R2 left", 1, params.mLeftKeys); 591 assertEquals("4 key auto 3 R2 right", 2, params.mRightKeys); 592 assertEquals("4 key auto 3 R2 <1>", 0, params.getColumnPos(0)); 593 assertEquals("4 key auto 3 R2 [2]", 1, params.getColumnPos(1)); 594 assertEquals("4 key auto 3 R2 [3]", -1, params.getColumnPos(2)); 595 assertEquals("4 key auto 3 R2 [4]", 0, params.getColumnPos(3)); 596 assertEquals("4 key auto 3 R2 adjust", 0, params.mTopRowAdjustment); 597 assertEquals("4 key auto 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 598 } 599 600 // [3] <1> [2] [4] 601 @Test testLayout4KeyAuto4M0()602 public void testLayout4KeyAuto4M0() { 603 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_M0); 604 assertEquals("4 key auto 4 M0 columns", 4, params.mNumColumns); 605 assertEquals("4 key auto 4 M0 rows", 1, params.mNumRows); 606 assertEquals("4 key auto 4 M0 left", 1, params.mLeftKeys); 607 assertEquals("4 key auto 4 M0 right", 3, params.mRightKeys); 608 assertEquals("4 key auto 4 M0 <1>", 0, params.getColumnPos(0)); 609 assertEquals("4 key auto 4 M0 [2]", 1, params.getColumnPos(1)); 610 assertEquals("4 key auto 4 M0 [3]", -1, params.getColumnPos(2)); 611 assertEquals("4 key auto 4 M0 [4]", 2, params.getColumnPos(3)); 612 assertEquals("4 key auto 4 M0 adjust", 0, params.mTopRowAdjustment); 613 assertEquals("4 key auto 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 614 } 615 616 // |<1> [2] [3] [4] 617 @Test testLayout4KeyAuto4L0()618 public void testLayout4KeyAuto4L0() { 619 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_L0); 620 assertEquals("4 key auto 4 L0 columns", 4, params.mNumColumns); 621 assertEquals("4 key auto 4 L0 rows", 1, params.mNumRows); 622 assertEquals("4 key auto 4 L0 left", 0, params.mLeftKeys); 623 assertEquals("4 key auto 4 L0 right", 4, params.mRightKeys); 624 assertEquals("4 key auto 4 L0 <1>", 0, params.getColumnPos(0)); 625 assertEquals("4 key auto 4 L0 [2]", 1, params.getColumnPos(1)); 626 assertEquals("4 key auto 4 L0 [3]", 2, params.getColumnPos(2)); 627 assertEquals("4 key auto 4 L0 [4]", 3, params.getColumnPos(3)); 628 assertEquals("4 key auto 4 L0 adjust", 0, params.mTopRowAdjustment); 629 assertEquals("4 key auto 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 630 } 631 632 // |___ <1> [2] [3] [4] 633 @Test testLayout4KeyAuto4L1()634 public void testLayout4KeyAuto4L1() { 635 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_L1); 636 assertEquals("4 key auto 4 L1 columns", 4, params.mNumColumns); 637 assertEquals("4 key auto 4 L1 rows", 1, params.mNumRows); 638 assertEquals("4 key auto 4 L1 left", 0, params.mLeftKeys); 639 assertEquals("4 key auto 4 L1 right", 4, params.mRightKeys); 640 assertEquals("4 key auto 4 L1 <1>", 0, params.getColumnPos(0)); 641 assertEquals("4 key auto 4 L1 [2]", 1, params.getColumnPos(1)); 642 assertEquals("4 key auto 4 L1 [3]", 2, params.getColumnPos(2)); 643 assertEquals("4 key auto 4 L1 [4]", 3, params.getColumnPos(3)); 644 assertEquals("4 key auto 4 L1 adjust", 0, params.mTopRowAdjustment); 645 assertEquals("4 key auto 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 646 } 647 648 // |___ [3] <1> [2] [4] 649 @Test testLayout4KeyAuto4L2()650 public void testLayout4KeyAuto4L2() { 651 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_L2); 652 assertEquals("4 key auto 4 L2 columns", 4, params.mNumColumns); 653 assertEquals("4 key auto 4 L2 rows", 1, params.mNumRows); 654 assertEquals("4 key auto 4 L2 left", 1, params.mLeftKeys); 655 assertEquals("4 key auto 4 L2 right", 3, params.mRightKeys); 656 assertEquals("4 key auto 4 L2 <1>", 0, params.getColumnPos(0)); 657 assertEquals("4 key auto 4 L2 [2]", 1, params.getColumnPos(1)); 658 assertEquals("4 key auto 4 L2 [3]", -1, params.getColumnPos(2)); 659 assertEquals("4 key auto 4 L2 [4]", 2, params.getColumnPos(3)); 660 assertEquals("4 key auto 4 L2 adjust", 0, params.mTopRowAdjustment); 661 assertEquals("4 key auto 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 662 } 663 664 // [4] [3] [2] <1>| 665 @Test testLayout4KeyAuto4R0()666 public void testLayout4KeyAuto4R0() { 667 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_R0); 668 assertEquals("4 key auto 4 R0 columns", 4, params.mNumColumns); 669 assertEquals("4 key auto 4 R0 rows", 1, params.mNumRows); 670 assertEquals("4 key auto 4 R0 left", 3, params.mLeftKeys); 671 assertEquals("4 key auto 4 R0 right", 1, params.mRightKeys); 672 assertEquals("4 key auto 4 R0 <1>", 0, params.getColumnPos(0)); 673 assertEquals("4 key auto 4 R0 [2]", -1, params.getColumnPos(1)); 674 assertEquals("4 key auto 4 R0 [3]", -2, params.getColumnPos(2)); 675 assertEquals("4 key auto 4 R0 [4]", -3, params.getColumnPos(3)); 676 assertEquals("4 key auto 4 R0 adjust", 0, params.mTopRowAdjustment); 677 assertEquals("4 key auto 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 678 } 679 680 // [4] [3] [2] <1> ___| 681 @Test testLayout4KeyAuto4R1()682 public void testLayout4KeyAuto4R1() { 683 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_R1); 684 assertEquals("4 key auto 4 R1 columns", 4, params.mNumColumns); 685 assertEquals("4 key auto 4 R1 rows", 1, params.mNumRows); 686 assertEquals("4 key auto 4 R1 left", 3, params.mLeftKeys); 687 assertEquals("4 key auto 4 R1 right", 1, params.mRightKeys); 688 assertEquals("4 key auto 4 R1 <1>", 0, params.getColumnPos(0)); 689 assertEquals("4 key auto 4 R1 [2]", -1, params.getColumnPos(1)); 690 assertEquals("4 key auto 4 R1 [3]", -2, params.getColumnPos(2)); 691 assertEquals("4 key auto 4 R1 [4]", -3, params.getColumnPos(3)); 692 assertEquals("4 key auto 4 R1 adjust", 0, params.mTopRowAdjustment); 693 assertEquals("4 key auto 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 694 } 695 696 // [4] [3] <1> [2] ___| 697 @Test testLayout4KeyAuto4R2()698 public void testLayout4KeyAuto4R2() { 699 MoreKeysKeyboardParams params = createParams(4, 4, XPOS_R2); 700 assertEquals("4 key auto 4 R2 columns", 4, params.mNumColumns); 701 assertEquals("4 key auto 4 R2 rows", 1, params.mNumRows); 702 assertEquals("4 key auto 4 R2 left", 2, params.mLeftKeys); 703 assertEquals("4 key auto 4 R2 right", 2, params.mRightKeys); 704 assertEquals("4 key auto 4 R2 <1>", 0, params.getColumnPos(0)); 705 assertEquals("4 key auto 4 R2 [2]", 1, params.getColumnPos(1)); 706 assertEquals("4 key auto 4 R2 [3]", -1, params.getColumnPos(2)); 707 assertEquals("4 key auto 4 R2 [4]", -2, params.getColumnPos(3)); 708 assertEquals("4 key auto 4 R2 adjust", 0, params.mTopRowAdjustment); 709 assertEquals("4 key auto 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 710 } 711 712 // [3] <1> [2] [4] 713 @Test testLayout4KeyAuto5M0()714 public void testLayout4KeyAuto5M0() { 715 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_M0); 716 assertEquals("4 key auto 5 M0 columns", 4, params.mNumColumns); 717 assertEquals("4 key auto 5 M0 rows", 1, params.mNumRows); 718 assertEquals("4 key auto 5 M0 left", 1, params.mLeftKeys); 719 assertEquals("4 key auto 5 M0 right", 3, params.mRightKeys); 720 assertEquals("4 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 721 assertEquals("4 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 722 assertEquals("4 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 723 assertEquals("4 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 724 assertEquals("4 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 725 assertEquals("4 key auto 5 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 726 } 727 728 // |<1> [2] [3] [4] 729 @Test testLayout4KeyAuto5L0()730 public void testLayout4KeyAuto5L0() { 731 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L0); 732 assertEquals("4 key auto 5 L0 columns", 4, params.mNumColumns); 733 assertEquals("4 key auto 5 L0 rows", 1, params.mNumRows); 734 assertEquals("4 key auto 5 L0 left", 0, params.mLeftKeys); 735 assertEquals("4 key auto 5 L0 right", 4, params.mRightKeys); 736 assertEquals("4 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 737 assertEquals("4 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 738 assertEquals("4 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 739 assertEquals("4 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 740 assertEquals("4 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 741 assertEquals("4 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 742 } 743 744 // |___ <1> [2] [3] [4] 745 @Test testLayout4KeyAuto5L1()746 public void testLayout4KeyAuto5L1() { 747 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L1); 748 assertEquals("4 key auto 5 L1 columns", 4, params.mNumColumns); 749 assertEquals("4 key auto 5 L1 rows", 1, params.mNumRows); 750 assertEquals("4 key auto 5 L1 left", 0, params.mLeftKeys); 751 assertEquals("4 key auto 5 L1 right", 4, params.mRightKeys); 752 assertEquals("4 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 753 assertEquals("4 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 754 assertEquals("4 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 755 assertEquals("4 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 756 assertEquals("4 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 757 assertEquals("4 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 758 } 759 760 // |___ [3] <1> [2] [4] 761 @Test testLayout4KeyAuto5L2()762 public void testLayout4KeyAuto5L2() { 763 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L2); 764 assertEquals("4 key auto 5 L2 columns", 4, params.mNumColumns); 765 assertEquals("4 key auto 5 L2 rows", 1, params.mNumRows); 766 assertEquals("4 key auto 5 L2 left", 1, params.mLeftKeys); 767 assertEquals("4 key auto 5 L2 right", 3, params.mRightKeys); 768 assertEquals("4 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 769 assertEquals("4 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 770 assertEquals("4 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 771 assertEquals("4 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 772 assertEquals("4 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 773 assertEquals("4 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 774 } 775 776 // [4] [3] [2] <1>| 777 @Test testLayout4KeyAuto5R0()778 public void testLayout4KeyAuto5R0() { 779 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R0); 780 assertEquals("4 key auto 5 R0 columns", 4, params.mNumColumns); 781 assertEquals("4 key auto 5 R0 rows", 1, params.mNumRows); 782 assertEquals("4 key auto 5 R0 left", 3, params.mLeftKeys); 783 assertEquals("4 key auto 5 R0 right", 1, params.mRightKeys); 784 assertEquals("4 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 785 assertEquals("4 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 786 assertEquals("4 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 787 assertEquals("4 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 788 assertEquals("4 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 789 assertEquals("4 key auto 5 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 790 } 791 792 // [4] [3] [2] <1> ___| 793 @Test testLayout4KeyAuto5R1()794 public void testLayout4KeyAuto5R1() { 795 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R1); 796 assertEquals("4 key auto 5 R1 columns", 4, params.mNumColumns); 797 assertEquals("4 key auto 5 R1 rows", 1, params.mNumRows); 798 assertEquals("4 key auto 5 R1 left", 3, params.mLeftKeys); 799 assertEquals("4 key auto 5 R1 right", 1, params.mRightKeys); 800 assertEquals("4 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 801 assertEquals("4 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 802 assertEquals("4 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 803 assertEquals("4 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 804 assertEquals("4 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 805 assertEquals("4 key auto 5 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 806 } 807 808 // [4] [3] <1> [2] ___| 809 @Test testLayout4KeyAuto5R2()810 public void testLayout4KeyAuto5R2() { 811 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R2); 812 assertEquals("4 key auto 5 R2 columns", 4, params.mNumColumns); 813 assertEquals("4 key auto 5 R2 rows", 1, params.mNumRows); 814 assertEquals("4 key auto 5 R2 left", 2, params.mLeftKeys); 815 assertEquals("4 key auto 5 R2 right", 2, params.mRightKeys); 816 assertEquals("4 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 817 assertEquals("4 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 818 assertEquals("4 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 819 assertEquals("4 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 820 assertEquals("4 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 821 assertEquals("4 key auto 5 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 822 } 823 824 // [4] [5] 825 // [3] <1> [2] 826 @Test testLayout5KeyAuto3M0()827 public void testLayout5KeyAuto3M0() { 828 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_M0); 829 assertEquals("5 key auto 3 M0 columns", 3, params.mNumColumns); 830 assertEquals("5 key auto 3 M0 rows", 2, params.mNumRows); 831 assertEquals("5 key auto 3 M0 left", 1, params.mLeftKeys); 832 assertEquals("5 key auto 3 M0 right", 2, params.mRightKeys); 833 assertEquals("5 key auto 3 M0 <1>", 0, params.getColumnPos(0)); 834 assertEquals("5 key auto 3 M0 [2]", 1, params.getColumnPos(1)); 835 assertEquals("5 key auto 3 M0 [3]", -1, params.getColumnPos(2)); 836 assertEquals("5 key auto 3 M0 [4]", 0, params.getColumnPos(3)); 837 assertEquals("5 key auto 3 M0 [5]", 1, params.getColumnPos(4)); 838 assertEquals("5 key auto 3 M0 adjust", -1, params.mTopRowAdjustment); 839 assertEquals("5 key auto 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 840 } 841 842 // |[4] [5] 843 // |<1> [2] [3] 844 @Test testLayout5KeyAuto3L0()845 public void testLayout5KeyAuto3L0() { 846 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L0); 847 assertEquals("5 key auto 3 L0 columns", 3, params.mNumColumns); 848 assertEquals("5 key auto 3 L0 rows", 2, params.mNumRows); 849 assertEquals("5 key auto 3 L0 left", 0, params.mLeftKeys); 850 assertEquals("5 key auto 3 L0 right", 3, params.mRightKeys); 851 assertEquals("5 key auto 3 L0 <1>", 0, params.getColumnPos(0)); 852 assertEquals("5 key auto 3 L0 [2]", 1, params.getColumnPos(1)); 853 assertEquals("5 key auto 3 L0 [3]", 2, params.getColumnPos(2)); 854 assertEquals("5 key auto 3 L0 [4]", 0, params.getColumnPos(3)); 855 assertEquals("5 key auto 3 L0 [5]", 1, params.getColumnPos(4)); 856 assertEquals("5 key auto 3 L0 adjust", 0, params.mTopRowAdjustment); 857 assertEquals("5 key auto 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 858 } 859 860 // |___ [4] [5] 861 // |___ <1> [2] [3] 862 @Test testLayout5KeyAuto3L1()863 public void testLayout5KeyAuto3L1() { 864 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L1); 865 assertEquals("5 key auto 3 L1 columns", 3, params.mNumColumns); 866 assertEquals("5 key auto 3 L1 rows", 2, params.mNumRows); 867 assertEquals("5 key auto 3 L1 left", 0, params.mLeftKeys); 868 assertEquals("5 key auto 3 L1 right", 3, params.mRightKeys); 869 assertEquals("5 key auto 3 L1 <1>", 0, params.getColumnPos(0)); 870 assertEquals("5 key auto 3 L1 [2]", 1, params.getColumnPos(1)); 871 assertEquals("5 key auto 3 L1 [3]", 2, params.getColumnPos(2)); 872 assertEquals("5 key auto 3 L1 [4]", 0, params.getColumnPos(3)); 873 assertEquals("5 key auto 3 L1 [5]", 1, params.getColumnPos(4)); 874 assertEquals("5 key auto 3 L1 adjust", 0, params.mTopRowAdjustment); 875 assertEquals("5 key auto 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 876 } 877 878 // |___ [4] [5] 879 // |___ [3] <1> [2] 880 @Test testLayout5KeyAuto3L2()881 public void testLayout5KeyAuto3L2() { 882 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L2); 883 assertEquals("5 key auto 3 L2 columns", 3, params.mNumColumns); 884 assertEquals("5 key auto 3 L2 rows", 2, params.mNumRows); 885 assertEquals("5 key auto 3 L2 left", 1, params.mLeftKeys); 886 assertEquals("5 key auto 3 L2 right", 2, params.mRightKeys); 887 assertEquals("5 key auto 3 L2 <1>", 0, params.getColumnPos(0)); 888 assertEquals("5 key auto 3 L2 [2]", 1, params.getColumnPos(1)); 889 assertEquals("5 key auto 3 L2 [3]", -1, params.getColumnPos(2)); 890 assertEquals("5 key auto 3 L2 [4]", 0, params.getColumnPos(3)); 891 assertEquals("5 key auto 3 L2 [5]", 1, params.getColumnPos(4)); 892 assertEquals("5 key auto 3 L2 adjust", -1, params.mTopRowAdjustment); 893 assertEquals("5 key auto 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 894 } 895 896 // [5] [4]| 897 // [3] [2] <1>| 898 @Test testLayout5KeyAuto3R0()899 public void testLayout5KeyAuto3R0() { 900 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R0); 901 assertEquals("5 key auto 3 R0 columns", 3, params.mNumColumns); 902 assertEquals("5 key auto 3 R0 rows", 2, params.mNumRows); 903 assertEquals("5 key auto 3 R0 left", 2, params.mLeftKeys); 904 assertEquals("5 key auto 3 R0 right", 1, params.mRightKeys); 905 assertEquals("5 key auto 3 R0 <1>", 0, params.getColumnPos(0)); 906 assertEquals("5 key auto 3 R0 [2]", -1, params.getColumnPos(1)); 907 assertEquals("5 key auto 3 R0 [3]", -2, params.getColumnPos(2)); 908 assertEquals("5 key auto 3 R0 [4]", 0, params.getColumnPos(3)); 909 assertEquals("5 key auto 3 R0 [5]", -1, params.getColumnPos(4)); 910 assertEquals("5 key auto 3 R0 adjust", 0, params.mTopRowAdjustment); 911 assertEquals("5 key auto 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 912 } 913 914 // [5] [4] ___| 915 // [3] [2] <1> ___| 916 @Test testLayout5KeyAuto3R1()917 public void testLayout5KeyAuto3R1() { 918 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R1); 919 assertEquals("5 key auto 3 R1 columns", 3, params.mNumColumns); 920 assertEquals("5 key auto 3 R1 rows", 2, params.mNumRows); 921 assertEquals("5 key auto 3 R1 left", 2, params.mLeftKeys); 922 assertEquals("5 key auto 3 R1 right", 1, params.mRightKeys); 923 assertEquals("5 key auto 3 R1 <1>", 0, params.getColumnPos(0)); 924 assertEquals("5 key auto 3 R1 [2]", -1, params.getColumnPos(1)); 925 assertEquals("5 key auto 3 R1 [3]", -2, params.getColumnPos(2)); 926 assertEquals("5 key auto 3 R1 [4]", 0, params.getColumnPos(3)); 927 assertEquals("5 key auto 3 R1 [5]", -1, params.getColumnPos(4)); 928 assertEquals("5 key auto 3 R1 adjust", 0, params.mTopRowAdjustment); 929 assertEquals("5 key auto 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 930 } 931 932 // [4] [5] ___| 933 // [3] <1> [2] ___| 934 @Test testLayout5KeyAuto3R2()935 public void testLayout5KeyAuto3R2() { 936 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R2); 937 assertEquals("5 key auto 3 R2 columns", 3, params.mNumColumns); 938 assertEquals("5 key auto 3 R2 rows", 2, params.mNumRows); 939 assertEquals("5 key auto 3 R2 left", 1, params.mLeftKeys); 940 assertEquals("5 key auto 3 R2 right", 2, params.mRightKeys); 941 assertEquals("5 key auto 3 R2 <1>", 0, params.getColumnPos(0)); 942 assertEquals("5 key auto 3 R2 [2]", 1, params.getColumnPos(1)); 943 assertEquals("5 key auto 3 R2 [3]", -1, params.getColumnPos(2)); 944 assertEquals("5 key auto 3 R2 [4]", 0, params.getColumnPos(3)); 945 assertEquals("5 key auto 3 R2 [5]", 1, params.getColumnPos(4)); 946 assertEquals("5 key auto 3 R2 adjust", -1, params.mTopRowAdjustment); 947 assertEquals("5 key auto 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 948 } 949 950 // [5] 951 // [3] <1> [2] [4] 952 @Test testLayout5KeyAuto4M0()953 public void testLayout5KeyAuto4M0() { 954 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_M0); 955 assertEquals("5 key auto 4 M0 columns", 4, params.mNumColumns); 956 assertEquals("5 key auto 4 M0 rows", 2, params.mNumRows); 957 assertEquals("5 key auto 4 M0 left", 1, params.mLeftKeys); 958 assertEquals("5 key auto 4 M0 right", 3, params.mRightKeys); 959 assertEquals("5 key auto 4 M0 <1>", 0, params.getColumnPos(0)); 960 assertEquals("5 key auto 4 M0 [2]", 1, params.getColumnPos(1)); 961 assertEquals("5 key auto 4 M0 [3]", -1, params.getColumnPos(2)); 962 assertEquals("5 key auto 4 M0 [4]", 2, params.getColumnPos(3)); 963 assertEquals("5 key auto 4 M0 [5]", 0, params.getColumnPos(4)); 964 assertEquals("5 key auto 4 M0 adjust", 0, params.mTopRowAdjustment); 965 assertEquals("5 key auto 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 966 } 967 968 // |[5] 969 // |<1> [2] [3] [4] 970 @Test testLayout5KeyAuto4L0()971 public void testLayout5KeyAuto4L0() { 972 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L0); 973 assertEquals("5 key auto 4 L0 columns", 4, params.mNumColumns); 974 assertEquals("5 key auto 4 L0 rows", 2, params.mNumRows); 975 assertEquals("5 key auto 4 L0 left", 0, params.mLeftKeys); 976 assertEquals("5 key auto 4 L0 right", 4, params.mRightKeys); 977 assertEquals("5 key auto 4 L0 <1>", 0, params.getColumnPos(0)); 978 assertEquals("5 key auto 4 L0 [2]", 1, params.getColumnPos(1)); 979 assertEquals("5 key auto 4 L0 [3]", 2, params.getColumnPos(2)); 980 assertEquals("5 key auto 4 L0 [4]", 3, params.getColumnPos(3)); 981 assertEquals("5 key auto 4 L0 [5]", 0, params.getColumnPos(4)); 982 assertEquals("5 key auto 4 L0 adjust", 0, params.mTopRowAdjustment); 983 assertEquals("5 key auto 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 984 } 985 986 // |___ [5] 987 // |___ <1> [2] [3] [4] 988 @Test testLayout5KeyAuto4L1()989 public void testLayout5KeyAuto4L1() { 990 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L1); 991 assertEquals("5 key auto 4 L1 columns", 4, params.mNumColumns); 992 assertEquals("5 key auto 4 L1 rows", 2, params.mNumRows); 993 assertEquals("5 key auto 4 L1 left", 0, params.mLeftKeys); 994 assertEquals("5 key auto 4 L1 right", 4, params.mRightKeys); 995 assertEquals("5 key auto 4 L1 <1>", 0, params.getColumnPos(0)); 996 assertEquals("5 key auto 4 L1 [2]", 1, params.getColumnPos(1)); 997 assertEquals("5 key auto 4 L1 [3]", 2, params.getColumnPos(2)); 998 assertEquals("5 key auto 4 L1 [4]", 3, params.getColumnPos(3)); 999 assertEquals("5 key auto 4 L1 [5]", 0, params.getColumnPos(4)); 1000 assertEquals("5 key auto 4 L1 adjust", 0, params.mTopRowAdjustment); 1001 assertEquals("5 key auto 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1002 } 1003 1004 // |___ [5] 1005 // |___ [3] <1> [2] [4] 1006 @Test testLayout5KeyAuto4L2()1007 public void testLayout5KeyAuto4L2() { 1008 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L2); 1009 assertEquals("5 key auto 4 L2 columns", 4, params.mNumColumns); 1010 assertEquals("5 key auto 4 L2 rows", 2, params.mNumRows); 1011 assertEquals("5 key auto 4 L2 left", 1, params.mLeftKeys); 1012 assertEquals("5 key auto 4 L2 right", 3, params.mRightKeys); 1013 assertEquals("5 key auto 4 L2 <1>", 0, params.getColumnPos(0)); 1014 assertEquals("5 key auto 4 L2 [2]", 1, params.getColumnPos(1)); 1015 assertEquals("5 key auto 4 L2 [3]", -1, params.getColumnPos(2)); 1016 assertEquals("5 key auto 4 L2 [4]", 2, params.getColumnPos(3)); 1017 assertEquals("5 key auto 4 L2 [5]", 0, params.getColumnPos(4)); 1018 assertEquals("5 key auto 4 L2 adjust", 0, params.mTopRowAdjustment); 1019 assertEquals("5 key auto 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1020 } 1021 1022 // [5]| 1023 // [4] [3] [2] <1>| 1024 @Test testLayout5KeyAuto4R0()1025 public void testLayout5KeyAuto4R0() { 1026 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R0); 1027 assertEquals("5 key auto 4 R0 columns", 4, params.mNumColumns); 1028 assertEquals("5 key auto 4 R0 rows", 2, params.mNumRows); 1029 assertEquals("5 key auto 4 R0 left", 3, params.mLeftKeys); 1030 assertEquals("5 key auto 4 R0 right", 1, params.mRightKeys); 1031 assertEquals("5 key auto 4 R0 <1>", 0, params.getColumnPos(0)); 1032 assertEquals("5 key auto 4 R0 [2]", -1, params.getColumnPos(1)); 1033 assertEquals("5 key auto 4 R0 [3]", -2, params.getColumnPos(2)); 1034 assertEquals("5 key auto 4 R0 [4]", -3, params.getColumnPos(3)); 1035 assertEquals("5 key auto 4 R0 [5]", 0, params.getColumnPos(4)); 1036 assertEquals("5 key auto 4 R0 adjust", 0, params.mTopRowAdjustment); 1037 assertEquals("5 key auto 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1038 } 1039 1040 // [5] ___| 1041 // [4] [3] [2] <1> ___| 1042 @Test testLayout5KeyAuto4R1()1043 public void testLayout5KeyAuto4R1() { 1044 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R1); 1045 assertEquals("5 key auto 4 R1 columns", 4, params.mNumColumns); 1046 assertEquals("5 key auto 4 R1 rows", 2, params.mNumRows); 1047 assertEquals("5 key auto 4 R1 left", 3, params.mLeftKeys); 1048 assertEquals("5 key auto 4 R1 right", 1, params.mRightKeys); 1049 assertEquals("5 key auto 4 R1 <1>", 0, params.getColumnPos(0)); 1050 assertEquals("5 key auto 4 R1 [2]", -1, params.getColumnPos(1)); 1051 assertEquals("5 key auto 4 R1 [3]", -2, params.getColumnPos(2)); 1052 assertEquals("5 key auto 4 R1 [4]", -3, params.getColumnPos(3)); 1053 assertEquals("5 key auto 4 R1 [5]", 0, params.getColumnPos(4)); 1054 assertEquals("5 key auto 4 R1 adjust", 0, params.mTopRowAdjustment); 1055 assertEquals("5 key auto 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1056 } 1057 1058 // [5] ___| 1059 // [4] [3] <1> [2] ___| 1060 @Test testLayout5KeyAuto4R2()1061 public void testLayout5KeyAuto4R2() { 1062 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R2); 1063 assertEquals("5 key auto 4 R2 columns", 4, params.mNumColumns); 1064 assertEquals("5 key auto 4 R2 rows", 2, params.mNumRows); 1065 assertEquals("5 key auto 4 R2 left", 2, params.mLeftKeys); 1066 assertEquals("5 key auto 4 R2 right", 2, params.mRightKeys); 1067 assertEquals("5 key auto 4 R2 <1>", 0, params.getColumnPos(0)); 1068 assertEquals("5 key auto 4 R2 [2]", 1, params.getColumnPos(1)); 1069 assertEquals("5 key auto 4 R2 [3]", -1, params.getColumnPos(2)); 1070 assertEquals("5 key auto 4 R2 [4]", -2, params.getColumnPos(3)); 1071 assertEquals("5 key auto 4 R2 [5]", 0, params.getColumnPos(4)); 1072 assertEquals("5 key auto 4 R2 adjust", 0, params.mTopRowAdjustment); 1073 assertEquals("5 key auto 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1074 } 1075 1076 // [5] [3] <1> [2] [4] 1077 @Test testLayout5KeyAuto5M0()1078 public void testLayout5KeyAuto5M0() { 1079 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_M0); 1080 assertEquals("5 key auto 5 M0 columns", 5, params.mNumColumns); 1081 assertEquals("5 key auto 5 M0 rows", 1, params.mNumRows); 1082 assertEquals("5 key auto 5 M0 left", 2, params.mLeftKeys); 1083 assertEquals("5 key auto 5 M0 right", 3, params.mRightKeys); 1084 assertEquals("5 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 1085 assertEquals("5 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 1086 assertEquals("5 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 1087 assertEquals("5 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 1088 assertEquals("5 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 1089 assertEquals("5 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 1090 assertEquals("5 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1091 } 1092 1093 // |<1> [2] [3] [4] [5] 1094 @Test testLayout5KeyAuto5L0()1095 public void testLayout5KeyAuto5L0() { 1096 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L0); 1097 assertEquals("5 key auto 5 L0 columns", 5, params.mNumColumns); 1098 assertEquals("5 key auto 5 L0 rows", 1, params.mNumRows); 1099 assertEquals("5 key auto 5 L0 left", 0, params.mLeftKeys); 1100 assertEquals("5 key auto 5 L0 right", 5, params.mRightKeys); 1101 assertEquals("5 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 1102 assertEquals("5 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 1103 assertEquals("5 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 1104 assertEquals("5 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 1105 assertEquals("5 key auto 5 L0 [5]", 4, params.getColumnPos(4)); 1106 assertEquals("5 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 1107 assertEquals("5 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1108 } 1109 1110 // |___ <1> [2] [3] [4] [5] 1111 @Test testLayout5KeyAuto5L1()1112 public void testLayout5KeyAuto5L1() { 1113 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L1); 1114 assertEquals("5 key auto 5 L1 columns", 5, params.mNumColumns); 1115 assertEquals("5 key auto 5 L1 rows", 1, params.mNumRows); 1116 assertEquals("5 key auto 5 L1 left", 0, params.mLeftKeys); 1117 assertEquals("5 key auto 5 L1 right", 5, params.mRightKeys); 1118 assertEquals("5 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 1119 assertEquals("5 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 1120 assertEquals("5 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 1121 assertEquals("5 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 1122 assertEquals("5 key auto 5 L1 [5]", 4, params.getColumnPos(4)); 1123 assertEquals("5 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 1124 assertEquals("5 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1125 } 1126 1127 // |___ [3] <1> [2] [4] [5] 1128 @Test testLayout5KeyAuto5L2()1129 public void testLayout5KeyAuto5L2() { 1130 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L2); 1131 assertEquals("5 key auto 5 L2 columns", 5, params.mNumColumns); 1132 assertEquals("5 key auto 5 L2 rows", 1, params.mNumRows); 1133 assertEquals("5 key auto 5 L2 left", 1, params.mLeftKeys); 1134 assertEquals("5 key auto 5 L2 right", 4, params.mRightKeys); 1135 assertEquals("5 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 1136 assertEquals("5 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 1137 assertEquals("5 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 1138 assertEquals("5 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 1139 assertEquals("5 key auto 5 L2 [5]", 3, params.getColumnPos(4)); 1140 assertEquals("5 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 1141 assertEquals("5 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1142 } 1143 1144 // [5] [4] [3] [2] <1>| 1145 @Test testLayout5KeyAuto5R0()1146 public void testLayout5KeyAuto5R0() { 1147 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R0); 1148 assertEquals("5 key auto 5 R0 columns", 5, params.mNumColumns); 1149 assertEquals("5 key auto 5 R0 rows", 1, params.mNumRows); 1150 assertEquals("5 key auto 5 R0 left", 4, params.mLeftKeys); 1151 assertEquals("5 key auto 5 R0 right", 1, params.mRightKeys); 1152 assertEquals("5 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 1153 assertEquals("5 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 1154 assertEquals("5 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 1155 assertEquals("5 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 1156 assertEquals("5 key auto 5 R0 [5]", -4, params.getColumnPos(4)); 1157 assertEquals("5 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 1158 assertEquals("5 key auto 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1159 } 1160 1161 // [5] [4] [3] [2] <1> ___| 1162 @Test testLayout5KeyAuto5R1()1163 public void testLayout5KeyAuto5R1() { 1164 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R1); 1165 assertEquals("5 key auto 5 R1 columns", 5, params.mNumColumns); 1166 assertEquals("5 key auto 5 R1 rows", 1, params.mNumRows); 1167 assertEquals("5 key auto 5 R1 left", 4, params.mLeftKeys); 1168 assertEquals("5 key auto 5 R1 right", 1, params.mRightKeys); 1169 assertEquals("5 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 1170 assertEquals("5 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 1171 assertEquals("5 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 1172 assertEquals("5 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 1173 assertEquals("5 key auto 5 R1 [5]", -4, params.getColumnPos(4)); 1174 assertEquals("5 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 1175 assertEquals("5 key auto 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1176 } 1177 1178 // [5] [4] [3] <1> [2] ___| 1179 @Test testLayout5KeyAuto5R2()1180 public void testLayout5KeyAuto5R2() { 1181 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R2); 1182 assertEquals("5 key auto 5 R2 columns", 5, params.mNumColumns); 1183 assertEquals("5 key auto 5 R2 rows", 1, params.mNumRows); 1184 assertEquals("5 key auto 5 R2 left", 3, params.mLeftKeys); 1185 assertEquals("5 key auto 5 R2 right", 2, params.mRightKeys); 1186 assertEquals("5 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 1187 assertEquals("5 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 1188 assertEquals("5 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 1189 assertEquals("5 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 1190 assertEquals("5 key auto 5 R2 [5]", -3, params.getColumnPos(4)); 1191 assertEquals("5 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 1192 assertEquals("5 key auto 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1193 } 1194 1195 // [5] [6] 1196 // [3] <1> [2] [4] 1197 @Test testLayout6KeyAuto4M0()1198 public void testLayout6KeyAuto4M0() { 1199 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_M0); 1200 assertEquals("6 key auto 4 M0 columns", 4, params.mNumColumns); 1201 assertEquals("6 key auto 4 M0 rows", 2, params.mNumRows); 1202 assertEquals("6 key auto 4 M0 left", 1, params.mLeftKeys); 1203 assertEquals("6 key auto 4 M0 right", 3, params.mRightKeys); 1204 assertEquals("6 key auto 4 M0 <1>", 0, params.getColumnPos(0)); 1205 assertEquals("6 key auto 4 M0 [2]", 1, params.getColumnPos(1)); 1206 assertEquals("6 key auto 4 M0 [3]", -1, params.getColumnPos(2)); 1207 assertEquals("6 key auto 4 M0 [4]", 2, params.getColumnPos(3)); 1208 assertEquals("6 key auto 4 M0 [5]", 0, params.getColumnPos(4)); 1209 assertEquals("6 key auto 4 M0 [6]", 1, params.getColumnPos(5)); 1210 assertEquals("6 key auto 4 M0 adjust", 0, params.mTopRowAdjustment); 1211 assertEquals("6 key auto 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1212 } 1213 1214 // |[5] [6] 1215 // |<1> [2] [3] [4] 1216 @Test testLayout6KeyAuto4L0()1217 public void testLayout6KeyAuto4L0() { 1218 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L0); 1219 assertEquals("6 key auto 4 L0 columns", 4, params.mNumColumns); 1220 assertEquals("6 key auto 4 L0 rows", 2, params.mNumRows); 1221 assertEquals("6 key auto 4 L0 left", 0, params.mLeftKeys); 1222 assertEquals("6 key auto 4 L0 right", 4, params.mRightKeys); 1223 assertEquals("6 key auto 4 L0 <1>", 0, params.getColumnPos(0)); 1224 assertEquals("6 key auto 4 L0 [2]", 1, params.getColumnPos(1)); 1225 assertEquals("6 key auto 4 L0 [3]", 2, params.getColumnPos(2)); 1226 assertEquals("6 key auto 4 L0 [4]", 3, params.getColumnPos(3)); 1227 assertEquals("6 key auto 4 L0 [5]", 0, params.getColumnPos(4)); 1228 assertEquals("6 key auto 4 L0 [6]", 1, params.getColumnPos(5)); 1229 assertEquals("6 key auto 4 L0 adjust", 0, params.mTopRowAdjustment); 1230 assertEquals("6 key auto 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1231 } 1232 1233 // |___ [5] [6] 1234 // |___ <1> [2] [3] [4] 1235 @Test testLayout6KeyAuto4L1()1236 public void testLayout6KeyAuto4L1() { 1237 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L1); 1238 assertEquals("6 key auto 4 L1 columns", 4, params.mNumColumns); 1239 assertEquals("6 key auto 4 L1 rows", 2, params.mNumRows); 1240 assertEquals("6 key auto 4 L1 left", 0, params.mLeftKeys); 1241 assertEquals("6 key auto 4 L1 right", 4, params.mRightKeys); 1242 assertEquals("6 key auto 4 L1 <1>", 0, params.getColumnPos(0)); 1243 assertEquals("6 key auto 4 L1 [2]", 1, params.getColumnPos(1)); 1244 assertEquals("6 key auto 4 L1 [3]", 2, params.getColumnPos(2)); 1245 assertEquals("6 key auto 4 L1 [4]", 3, params.getColumnPos(3)); 1246 assertEquals("6 key auto 4 L1 [5]", 0, params.getColumnPos(4)); 1247 assertEquals("6 key auto 4 L1 [6]", 1, params.getColumnPos(5)); 1248 assertEquals("6 key auto 4 L1 adjust", 0, params.mTopRowAdjustment); 1249 assertEquals("6 key auto 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1250 } 1251 1252 // |___ [5] [6] 1253 // |___ [3] <1> [2] [4] 1254 @Test testLayout6KeyAuto4L2()1255 public void testLayout6KeyAuto4L2() { 1256 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L2); 1257 assertEquals("6 key auto 4 L2 columns", 4, params.mNumColumns); 1258 assertEquals("6 key auto 4 L2 rows", 2, params.mNumRows); 1259 assertEquals("6 key auto 4 L2 left", 1, params.mLeftKeys); 1260 assertEquals("6 key auto 4 L2 right", 3, params.mRightKeys); 1261 assertEquals("6 key auto 4 L2 <1>", 0, params.getColumnPos(0)); 1262 assertEquals("6 key auto 4 L2 [2]", 1, params.getColumnPos(1)); 1263 assertEquals("6 key auto 4 L2 [3]", -1, params.getColumnPos(2)); 1264 assertEquals("6 key auto 4 L2 [4]", 2, params.getColumnPos(3)); 1265 assertEquals("6 key auto 4 L2 [5]", 0, params.getColumnPos(4)); 1266 assertEquals("6 key auto 4 L2 [6]", 1, params.getColumnPos(5)); 1267 assertEquals("6 key auto 4 L2 adjust", 0, params.mTopRowAdjustment); 1268 assertEquals("6 key auto 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1269 } 1270 1271 // [6] [5]| 1272 // [4] [3] [2] <1>| 1273 @Test testLayout6KeyAuto4R0()1274 public void testLayout6KeyAuto4R0() { 1275 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R0); 1276 assertEquals("6 key auto 4 R0 columns", 4, params.mNumColumns); 1277 assertEquals("6 key auto 4 R0 rows", 2, params.mNumRows); 1278 assertEquals("6 key auto 4 R0 left", 3, params.mLeftKeys); 1279 assertEquals("6 key auto 4 R0 right", 1, params.mRightKeys); 1280 assertEquals("6 key auto 4 R0 <1>", 0, params.getColumnPos(0)); 1281 assertEquals("6 key auto 4 R0 [2]", -1, params.getColumnPos(1)); 1282 assertEquals("6 key auto 4 R0 [3]", -2, params.getColumnPos(2)); 1283 assertEquals("6 key auto 4 R0 [4]", -3, params.getColumnPos(3)); 1284 assertEquals("6 key auto 4 R0 [5]", 0, params.getColumnPos(4)); 1285 assertEquals("6 key auto 4 R0 [6]", -1, params.getColumnPos(5)); 1286 assertEquals("6 key auto 4 R0 adjust", 0, params.mTopRowAdjustment); 1287 assertEquals("6 key auto 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1288 } 1289 1290 // [6] [5] ___| 1291 // [4] [3] [2] <1> ___| 1292 @Test testLayout6KeyAuto4R1()1293 public void testLayout6KeyAuto4R1() { 1294 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R1); 1295 assertEquals("6 key auto 4 R1 columns", 4, params.mNumColumns); 1296 assertEquals("6 key auto 4 R1 rows", 2, params.mNumRows); 1297 assertEquals("6 key auto 4 R1 left", 3, params.mLeftKeys); 1298 assertEquals("6 key auto 4 R1 right", 1, params.mRightKeys); 1299 assertEquals("6 key auto 4 R1 <1>", 0, params.getColumnPos(0)); 1300 assertEquals("6 key auto 4 R1 [2]", -1, params.getColumnPos(1)); 1301 assertEquals("6 key auto 4 R1 [3]", -2, params.getColumnPos(2)); 1302 assertEquals("6 key auto 4 R1 [4]", -3, params.getColumnPos(3)); 1303 assertEquals("6 key auto 4 R1 [5]", 0, params.getColumnPos(4)); 1304 assertEquals("6 key auto 4 R1 [6]", -1, params.getColumnPos(5)); 1305 assertEquals("6 key auto 4 R1 adjust", 0, params.mTopRowAdjustment); 1306 assertEquals("6 key auto 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1307 } 1308 1309 // [5] [6] ___| 1310 // [4] [3] <1> [2] ___| 1311 @Test testLayout6KeyAuto4R2()1312 public void testLayout6KeyAuto4R2() { 1313 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R2); 1314 assertEquals("6 key auto 4 R2 columns", 4, params.mNumColumns); 1315 assertEquals("6 key auto 4 R2 rows", 2, params.mNumRows); 1316 assertEquals("6 key auto 4 R2 left", 2, params.mLeftKeys); 1317 assertEquals("6 key auto 4 R2 right", 2, params.mRightKeys); 1318 assertEquals("6 key auto 4 R2 <1>", 0, params.getColumnPos(0)); 1319 assertEquals("6 key auto 4 R2 [2]", 1, params.getColumnPos(1)); 1320 assertEquals("6 key auto 4 R2 [3]", -1, params.getColumnPos(2)); 1321 assertEquals("6 key auto 4 R2 [4]", -2, params.getColumnPos(3)); 1322 assertEquals("6 key auto 4 R2 [5]", 0, params.getColumnPos(4)); 1323 assertEquals("6 key auto 4 R2 [6]", 1, params.getColumnPos(5)); 1324 assertEquals("6 key auto 4 R2 adjust", 0, params.mTopRowAdjustment); 1325 assertEquals("6 key auto 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1326 } 1327 1328 // [6] 1329 // [5] [3] <1> [2] [4] 1330 @Test testLayout6KeyAuto5M0()1331 public void testLayout6KeyAuto5M0() { 1332 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_M0); 1333 assertEquals("6 key auto 5 M0 columns", 5, params.mNumColumns); 1334 assertEquals("6 key auto 5 M0 rows", 2, params.mNumRows); 1335 assertEquals("6 key auto 5 M0 left", 2, params.mLeftKeys); 1336 assertEquals("6 key auto 5 M0 right", 3, params.mRightKeys); 1337 assertEquals("6 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 1338 assertEquals("6 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 1339 assertEquals("6 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 1340 assertEquals("6 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 1341 assertEquals("6 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 1342 assertEquals("6 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 1343 assertEquals("6 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 1344 assertEquals("6 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1345 } 1346 1347 // |[6] 1348 // |<1> [2] [3] [4] [5] 1349 @Test testLayout6KeyAuto5L0()1350 public void testLayout6KeyAuto5L0() { 1351 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L0); 1352 assertEquals("6 key auto 5 L0 columns", 5, params.mNumColumns); 1353 assertEquals("6 key auto 5 L0 rows", 2, params.mNumRows); 1354 assertEquals("6 key auto 5 L0 left", 0, params.mLeftKeys); 1355 assertEquals("6 key auto 5 L0 right", 5, params.mRightKeys); 1356 assertEquals("6 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 1357 assertEquals("6 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 1358 assertEquals("6 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 1359 assertEquals("6 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 1360 assertEquals("6 key auto 5 L0 [5]", 4, params.getColumnPos(4)); 1361 assertEquals("6 key auto 5 L0 [6]", 0, params.getColumnPos(5)); 1362 assertEquals("6 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 1363 assertEquals("6 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1364 } 1365 1366 // |___ [6] 1367 // |___ <1> [2] [3] [4] [5] 1368 @Test testLayout6KeyAuto5L1()1369 public void testLayout6KeyAuto5L1() { 1370 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L1); 1371 assertEquals("6 key auto 5 L1 columns", 5, params.mNumColumns); 1372 assertEquals("6 key auto 5 L1 rows", 2, params.mNumRows); 1373 assertEquals("6 key auto 5 L1 left", 0, params.mLeftKeys); 1374 assertEquals("6 key auto 5 L1 right", 5, params.mRightKeys); 1375 assertEquals("6 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 1376 assertEquals("6 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 1377 assertEquals("6 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 1378 assertEquals("6 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 1379 assertEquals("6 key auto 5 L1 [5]", 4, params.getColumnPos(4)); 1380 assertEquals("6 key auto 5 L1 [6]", 0, params.getColumnPos(5)); 1381 assertEquals("6 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 1382 assertEquals("6 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1383 } 1384 1385 // |___ [6] 1386 // |___ [3] <1> [2] [4] [5] 1387 @Test testLayout6KeyAuto5L2()1388 public void testLayout6KeyAuto5L2() { 1389 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L2); 1390 assertEquals("6 key auto 5 L2 columns", 5, params.mNumColumns); 1391 assertEquals("6 key auto 5 L2 rows", 2, params.mNumRows); 1392 assertEquals("6 key auto 5 L2 left", 1, params.mLeftKeys); 1393 assertEquals("6 key auto 5 L2 right", 4, params.mRightKeys); 1394 assertEquals("6 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 1395 assertEquals("6 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 1396 assertEquals("6 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 1397 assertEquals("6 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 1398 assertEquals("6 key auto 5 L2 [5]", 3, params.getColumnPos(4)); 1399 assertEquals("6 key auto 5 L2 [6]", 0, params.getColumnPos(5)); 1400 assertEquals("6 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 1401 assertEquals("6 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1402 } 1403 1404 // [6]| 1405 // [5] [4] [3] [2] <1>| 1406 @Test testLayout6KeyAuto5R0()1407 public void testLayout6KeyAuto5R0() { 1408 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R0); 1409 assertEquals("6 key auto 5 R0 columns", 5, params.mNumColumns); 1410 assertEquals("6 key auto 5 R0 rows", 2, params.mNumRows); 1411 assertEquals("6 key auto 5 R0 left", 4, params.mLeftKeys); 1412 assertEquals("6 key auto 5 R0 right", 1, params.mRightKeys); 1413 assertEquals("6 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 1414 assertEquals("6 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 1415 assertEquals("6 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 1416 assertEquals("6 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 1417 assertEquals("6 key auto 5 R0 [5]", -4, params.getColumnPos(4)); 1418 assertEquals("6 key auto 5 R0 [6]", 0, params.getColumnPos(5)); 1419 assertEquals("6 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 1420 assertEquals("6 key auto 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1421 } 1422 1423 // [6] ___| 1424 // [5] [4] [3] [2] <1> ___| 1425 @Test testLayout6KeyAuto5R1()1426 public void testLayout6KeyAuto5R1() { 1427 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R1); 1428 assertEquals("6 key auto 5 R1 columns", 5, params.mNumColumns); 1429 assertEquals("6 key auto 5 R1 rows", 2, params.mNumRows); 1430 assertEquals("6 key auto 5 R1 left", 4, params.mLeftKeys); 1431 assertEquals("6 key auto 5 R1 right", 1, params.mRightKeys); 1432 assertEquals("6 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 1433 assertEquals("6 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 1434 assertEquals("6 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 1435 assertEquals("6 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 1436 assertEquals("6 key auto 5 R1 [5]", -4, params.getColumnPos(4)); 1437 assertEquals("6 key auto 5 R1 [6]", 0, params.getColumnPos(5)); 1438 assertEquals("6 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 1439 assertEquals("6 key auto 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1440 } 1441 1442 // [6] ___| 1443 // [5] [4] [3] <1> [2] ___| 1444 @Test testLayout6KeyAuto5R2()1445 public void testLayout6KeyAuto5R2() { 1446 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R2); 1447 assertEquals("6 key auto 5 R2 columns", 5, params.mNumColumns); 1448 assertEquals("6 key auto 5 R2 rows", 2, params.mNumRows); 1449 assertEquals("6 key auto 5 R2 left", 3, params.mLeftKeys); 1450 assertEquals("6 key auto 5 R2 right", 2, params.mRightKeys); 1451 assertEquals("6 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 1452 assertEquals("6 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 1453 assertEquals("6 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 1454 assertEquals("6 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 1455 assertEquals("6 key auto 5 R2 [5]", -3, params.getColumnPos(4)); 1456 assertEquals("6 key auto 5 R2 [6]", 0, params.getColumnPos(5)); 1457 assertEquals("6 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 1458 assertEquals("6 key auto 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1459 } 1460 1461 // |<1> [2] [3] [4] [5] [6] [7] ___ ___ ___| 1462 @Test testLayout7KeyAuto7L0()1463 public void testLayout7KeyAuto7L0() { 1464 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L0); 1465 assertEquals("7 key auto 7 L0 columns", 7, params.mNumColumns); 1466 assertEquals("7 key auto 7 L0 rows", 1, params.mNumRows); 1467 assertEquals("7 key auto 7 L0 left", 0, params.mLeftKeys); 1468 assertEquals("7 key auto 7 L0 right", 7, params.mRightKeys); 1469 assertEquals("7 key auto 7 L0 <1>", 0, params.getColumnPos(0)); 1470 assertEquals("7 key auto 7 L0 [2]", 1, params.getColumnPos(1)); 1471 assertEquals("7 key auto 7 L0 [3]", 2, params.getColumnPos(2)); 1472 assertEquals("7 key auto 7 L0 [4]", 3, params.getColumnPos(3)); 1473 assertEquals("7 key auto 7 L0 [5]", 4, params.getColumnPos(4)); 1474 assertEquals("7 key auto 7 L0 [6]", 5, params.getColumnPos(5)); 1475 assertEquals("7 key auto 7 L0 [7]", 6, params.getColumnPos(6)); 1476 assertEquals("7 key auto 7 L0 adjust", 0, params.mTopRowAdjustment); 1477 assertEquals("7 key auto 7 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1478 } 1479 1480 // |___ <1> [2] [3] [4] [5] [6] [7] ___ ___| 1481 @Test testLayout7KeyAuto7L1()1482 public void testLayout7KeyAuto7L1() { 1483 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L1); 1484 assertEquals("7 key auto 7 L1 columns", 7, params.mNumColumns); 1485 assertEquals("7 key auto 7 L1 rows", 1, params.mNumRows); 1486 assertEquals("7 key auto 7 L1 left", 0, params.mLeftKeys); 1487 assertEquals("7 key auto 7 L1 right", 7, params.mRightKeys); 1488 assertEquals("7 key auto 7 L1 <1>", 0, params.getColumnPos(0)); 1489 assertEquals("7 key auto 7 L1 [2]", 1, params.getColumnPos(1)); 1490 assertEquals("7 key auto 7 L1 [3]", 2, params.getColumnPos(2)); 1491 assertEquals("7 key auto 7 L1 [4]", 3, params.getColumnPos(3)); 1492 assertEquals("7 key auto 7 L1 [5]", 4, params.getColumnPos(4)); 1493 assertEquals("7 key auto 7 L1 [6]", 5, params.getColumnPos(5)); 1494 assertEquals("7 key auto 7 L1 [7]", 6, params.getColumnPos(6)); 1495 assertEquals("7 key auto 7 L1 adjust", 0, params.mTopRowAdjustment); 1496 assertEquals("7 key auto 7 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1497 } 1498 1499 // |___ [3] <1> [2] [4] [5] [6] [7] ___ ___| 1500 @Test testLayout7KeyAuto7L2()1501 public void testLayout7KeyAuto7L2() { 1502 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L2); 1503 assertEquals("7 key auto 7 L2 columns", 7, params.mNumColumns); 1504 assertEquals("7 key auto 7 L2 rows", 1, params.mNumRows); 1505 assertEquals("7 key auto 7 L2 left", 1, params.mLeftKeys); 1506 assertEquals("7 key auto 7 L2 right", 6, params.mRightKeys); 1507 assertEquals("7 key auto 7 L2 <1>", 0, params.getColumnPos(0)); 1508 assertEquals("7 key auto 7 L2 [2]", 1, params.getColumnPos(1)); 1509 assertEquals("7 key auto 7 L2 [3]", -1, params.getColumnPos(2)); 1510 assertEquals("7 key auto 7 L2 [4]", 2, params.getColumnPos(3)); 1511 assertEquals("7 key auto 7 L2 [5]", 3, params.getColumnPos(4)); 1512 assertEquals("7 key auto 7 L2 [6]", 4, params.getColumnPos(5)); 1513 assertEquals("7 key auto 7 L2 [7]", 5, params.getColumnPos(6)); 1514 assertEquals("7 key auto 7 L2 adjust", 0, params.mTopRowAdjustment); 1515 assertEquals("7 key auto 7 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1516 } 1517 1518 // |___ [5] [3] <1> [2] [4] [6] [7] ___ ___| 1519 @Test testLayout7KeyAuto7L3()1520 public void testLayout7KeyAuto7L3() { 1521 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L3); 1522 assertEquals("7 key auto 7 L3 columns", 7, params.mNumColumns); 1523 assertEquals("7 key auto 7 L3 rows", 1, params.mNumRows); 1524 assertEquals("7 key auto 7 L3 left", 2, params.mLeftKeys); 1525 assertEquals("7 key auto 7 L3 right", 5, params.mRightKeys); 1526 assertEquals("7 key auto 7 L3 <1>", 0, params.getColumnPos(0)); 1527 assertEquals("7 key auto 7 L3 [2]", 1, params.getColumnPos(1)); 1528 assertEquals("7 key auto 7 L3 [3]", -1, params.getColumnPos(2)); 1529 assertEquals("7 key auto 7 L3 [4]", 2, params.getColumnPos(3)); 1530 assertEquals("7 key auto 7 L3 [5]", -2, params.getColumnPos(4)); 1531 assertEquals("7 key auto 7 L3 [6]", 3, params.getColumnPos(5)); 1532 assertEquals("7 key auto 7 L3 [7]", 4, params.getColumnPos(6)); 1533 assertEquals("7 key auto 7 L3 adjust", 0, params.mTopRowAdjustment); 1534 assertEquals("7 key auto 7 L3 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1535 } 1536 1537 // |___ [7] [5] [3] <1> [2] [4] [6] ___ ___| 1538 @Test testLayout7KeyAuto7M0()1539 public void testLayout7KeyAuto7M0() { 1540 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_M0); 1541 assertEquals("7 key auto 7 M0 columns", 7, params.mNumColumns); 1542 assertEquals("7 key auto 7 M0 rows", 1, params.mNumRows); 1543 assertEquals("7 key auto 7 M0 left", 3, params.mLeftKeys); 1544 assertEquals("7 key auto 7 M0 right", 4, params.mRightKeys); 1545 assertEquals("7 key auto 7 M0 <1>", 0, params.getColumnPos(0)); 1546 assertEquals("7 key auto 7 M0 [2]", 1, params.getColumnPos(1)); 1547 assertEquals("7 key auto 7 M0 [3]", -1, params.getColumnPos(2)); 1548 assertEquals("7 key auto 7 M0 [4]", 2, params.getColumnPos(3)); 1549 assertEquals("7 key auto 7 M0 [5]", -2, params.getColumnPos(4)); 1550 assertEquals("7 key auto 7 M0 [6]", 3, params.getColumnPos(5)); 1551 assertEquals("7 key auto 7 M0 [7]", -3, params.getColumnPos(6)); 1552 assertEquals("7 key auto 7 M0 adjust", 0, params.mTopRowAdjustment); 1553 assertEquals("7 key auto 7 M0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1554 } 1555 1556 // |___ ___ [7] [5] [3] <1> [2] [4] [6] ___| 1557 @Test testLayout7KeyAuto7M1()1558 public void testLayout7KeyAuto7M1() { 1559 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_M1); 1560 assertEquals("7 key auto 7 M1 columns", 7, params.mNumColumns); 1561 assertEquals("7 key auto 7 M1 rows", 1, params.mNumRows); 1562 assertEquals("7 key auto 7 M1 left", 3, params.mLeftKeys); 1563 assertEquals("7 key auto 7 M1 right", 4, params.mRightKeys); 1564 assertEquals("7 key auto 7 M1 <1>", 0, params.getColumnPos(0)); 1565 assertEquals("7 key auto 7 M1 [2]", 1, params.getColumnPos(1)); 1566 assertEquals("7 key auto 7 M1 [3]", -1, params.getColumnPos(2)); 1567 assertEquals("7 key auto 7 M1 [4]", 2, params.getColumnPos(3)); 1568 assertEquals("7 key auto 7 M1 [5]", -2, params.getColumnPos(4)); 1569 assertEquals("7 key auto 7 M1 [6]", 3, params.getColumnPos(5)); 1570 assertEquals("7 key auto 7 M1 [7]", -3, params.getColumnPos(6)); 1571 assertEquals("7 key auto 7 M1 adjust", 0, params.mTopRowAdjustment); 1572 assertEquals("7 key auto 7 M1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1573 } 1574 1575 // |___ ___ [7] [6] [5] [3] <1> [2] [4] ___| 1576 @Test testLayout7KeyAuto7R3()1577 public void testLayout7KeyAuto7R3() { 1578 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R3); 1579 assertEquals("7 key auto 7 R3 columns", 7, params.mNumColumns); 1580 assertEquals("7 key auto 7 R3 rows", 1, params.mNumRows); 1581 assertEquals("7 key auto 7 R3 left", 4, params.mLeftKeys); 1582 assertEquals("7 key auto 7 R3 right", 3, params.mRightKeys); 1583 assertEquals("7 key auto 7 R3 <1>", 0, params.getColumnPos(0)); 1584 assertEquals("7 key auto 7 R3 [2]", 1, params.getColumnPos(1)); 1585 assertEquals("7 key auto 7 R3 [3]", -1, params.getColumnPos(2)); 1586 assertEquals("7 key auto 7 R3 [4]", 2, params.getColumnPos(3)); 1587 assertEquals("7 key auto 7 R3 [5]", -2, params.getColumnPos(4)); 1588 assertEquals("7 key auto 7 R3 [6]", -3, params.getColumnPos(5)); 1589 assertEquals("7 key auto 7 R3 [7]", -4, params.getColumnPos(6)); 1590 assertEquals("7 key auto 7 R3 adjust", 0, params.mTopRowAdjustment); 1591 assertEquals("7 key auto 7 R3 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1592 } 1593 1594 // |___ ___ [7] [6] [5] [4] [3] <1> [2] ___| 1595 @Test testLayout7KeyAuto7R2()1596 public void testLayout7KeyAuto7R2() { 1597 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R2); 1598 assertEquals("7 key auto 7 R2 columns", 7, params.mNumColumns); 1599 assertEquals("7 key auto 7 R2 rows", 1, params.mNumRows); 1600 assertEquals("7 key auto 7 R2 left", 5, params.mLeftKeys); 1601 assertEquals("7 key auto 7 R2 right", 2, params.mRightKeys); 1602 assertEquals("7 key auto 7 R2 <1>", 0, params.getColumnPos(0)); 1603 assertEquals("7 key auto 7 R2 [2]", 1, params.getColumnPos(1)); 1604 assertEquals("7 key auto 7 R2 [3]", -1, params.getColumnPos(2)); 1605 assertEquals("7 key auto 7 R2 [4]", -2, params.getColumnPos(3)); 1606 assertEquals("7 key auto 7 R2 [5]", -3, params.getColumnPos(4)); 1607 assertEquals("7 key auto 7 R2 [6]", -4, params.getColumnPos(5)); 1608 assertEquals("7 key auto 7 R2 [7]", -5, params.getColumnPos(6)); 1609 assertEquals("7 key auto 7 R2 adjust", 0, params.mTopRowAdjustment); 1610 assertEquals("7 key auto 7 R2 default", WIDTH * 5, params.getDefaultKeyCoordX()); 1611 } 1612 1613 // |___ ___ [7] [6] [5] [4] [3] [2] <1> ___| 1614 @Test testLayout7KeyAuto7R1()1615 public void testLayout7KeyAuto7R1() { 1616 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R1); 1617 assertEquals("7 key auto 7 R1 columns", 7, params.mNumColumns); 1618 assertEquals("7 key auto 7 R1 rows", 1, params.mNumRows); 1619 assertEquals("7 key auto 7 R1 left", 6, params.mLeftKeys); 1620 assertEquals("7 key auto 7 R1 right", 1, params.mRightKeys); 1621 assertEquals("7 key auto 7 R1 <1>", 0, params.getColumnPos(0)); 1622 assertEquals("7 key auto 7 R1 [2]", -1, params.getColumnPos(1)); 1623 assertEquals("7 key auto 7 R1 [3]", -2, params.getColumnPos(2)); 1624 assertEquals("7 key auto 7 R1 [4]", -3, params.getColumnPos(3)); 1625 assertEquals("7 key auto 7 R1 [5]", -4, params.getColumnPos(4)); 1626 assertEquals("7 key auto 7 R1 [6]", -5, params.getColumnPos(5)); 1627 assertEquals("7 key auto 7 R1 [7]", -6, params.getColumnPos(6)); 1628 assertEquals("7 key auto 7 R1 adjust", 0, params.mTopRowAdjustment); 1629 assertEquals("7 key auto 7 R1 default", WIDTH * 6, params.getDefaultKeyCoordX()); 1630 } 1631 1632 // |___ ___ [7] [6] [5] [4] [3] [2] <1>| 1633 @Test testLayout7KeyAuto7R0()1634 public void testLayout7KeyAuto7R0() { 1635 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R0); 1636 assertEquals("7 key auto 7 R0 columns", 7, params.mNumColumns); 1637 assertEquals("7 key auto 7 R0 rows", 1, params.mNumRows); 1638 assertEquals("7 key auto 7 R0 left", 6, params.mLeftKeys); 1639 assertEquals("7 key auto 7 R0 right", 1, params.mRightKeys); 1640 assertEquals("7 key auto 7 R0 <1>", 0, params.getColumnPos(0)); 1641 assertEquals("7 key auto 7 R0 [2]", -1, params.getColumnPos(1)); 1642 assertEquals("7 key auto 7 R0 [3]", -2, params.getColumnPos(2)); 1643 assertEquals("7 key auto 7 R0 [4]", -3, params.getColumnPos(3)); 1644 assertEquals("7 key auto 7 R0 [5]", -4, params.getColumnPos(4)); 1645 assertEquals("7 key auto 7 R0 [6]", -5, params.getColumnPos(5)); 1646 assertEquals("7 key auto 7 R0 [7]", -6, params.getColumnPos(6)); 1647 assertEquals("7 key auto 7 R0 adjust", 0, params.mTopRowAdjustment); 1648 assertEquals("7 key auto 7 R0 default", WIDTH * 6, params.getDefaultKeyCoordX()); 1649 } 1650 1651 // [6] [7] 1652 // [5] [3] <1> [2] [4] 1653 @Test testLayout7KeyAuto5M0()1654 public void testLayout7KeyAuto5M0() { 1655 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_M0); 1656 assertEquals("7 key auto 5 M0 columns", 5, params.mNumColumns); 1657 assertEquals("7 key auto 5 M0 rows", 2, params.mNumRows); 1658 assertEquals("7 key auto 5 M0 left", 2, params.mLeftKeys); 1659 assertEquals("7 key auto 5 M0 right", 3, params.mRightKeys); 1660 assertEquals("7 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 1661 assertEquals("7 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 1662 assertEquals("7 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 1663 assertEquals("7 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 1664 assertEquals("7 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 1665 assertEquals("7 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 1666 assertEquals("7 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 1667 assertEquals("7 key auto 5 M0 adjust", -1, params.mTopRowAdjustment); 1668 assertEquals("7 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1669 } 1670 1671 // |[6] [7] 1672 // |<1> [2] [3] [4] [5] 1673 @Test testLayout7KeyAuto5L0()1674 public void testLayout7KeyAuto5L0() { 1675 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L0); 1676 assertEquals("7 key auto 5 L0 columns", 5, params.mNumColumns); 1677 assertEquals("7 key auto 5 L0 rows", 2, params.mNumRows); 1678 assertEquals("7 key auto 5 L0 left", 0, params.mLeftKeys); 1679 assertEquals("7 key auto 5 L0 right", 5, params.mRightKeys); 1680 assertEquals("7 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 1681 assertEquals("7 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 1682 assertEquals("7 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 1683 assertEquals("7 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 1684 assertEquals("7 key auto 5 L0 [5]", 4, params.getColumnPos(4)); 1685 assertEquals("7 key auto 5 L0 [6]", 0, params.getColumnPos(5)); 1686 assertEquals("7 key auto 5 L0 [7]", 1, params.getColumnPos(6)); 1687 assertEquals("7 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 1688 assertEquals("7 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1689 } 1690 1691 // |___ [6] [7] 1692 // |___ <1> [2] [3] [4] [5] 1693 @Test testLayout7KeyAuto5L1()1694 public void testLayout7KeyAuto5L1() { 1695 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L1); 1696 assertEquals("7 key auto 5 L1 columns", 5, params.mNumColumns); 1697 assertEquals("7 key auto 5 L1 rows", 2, params.mNumRows); 1698 assertEquals("7 key auto 5 L1 left", 0, params.mLeftKeys); 1699 assertEquals("7 key auto 5 L1 right", 5, params.mRightKeys); 1700 assertEquals("7 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 1701 assertEquals("7 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 1702 assertEquals("7 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 1703 assertEquals("7 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 1704 assertEquals("7 key auto 5 L1 [5]", 4, params.getColumnPos(4)); 1705 assertEquals("7 key auto 5 L1 [6]", 0, params.getColumnPos(5)); 1706 assertEquals("7 key auto 5 L1 [7]", 1, params.getColumnPos(6)); 1707 assertEquals("7 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 1708 assertEquals("7 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1709 } 1710 1711 // |___ [6] [7] 1712 // |___ [3] <1> [2] [4] [5] 1713 @Test testLayout7KeyAuto5L2()1714 public void testLayout7KeyAuto5L2() { 1715 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L2); 1716 assertEquals("7 key auto 5 L2 columns", 5, params.mNumColumns); 1717 assertEquals("7 key auto 5 L2 rows", 2, params.mNumRows); 1718 assertEquals("7 key auto 5 L2 left", 1, params.mLeftKeys); 1719 assertEquals("7 key auto 5 L2 right", 4, params.mRightKeys); 1720 assertEquals("7 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 1721 assertEquals("7 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 1722 assertEquals("7 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 1723 assertEquals("7 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 1724 assertEquals("7 key auto 5 L2 [5]", 3, params.getColumnPos(4)); 1725 assertEquals("7 key auto 5 L2 [6]", 0, params.getColumnPos(5)); 1726 assertEquals("7 key auto 5 L2 [7]", 1, params.getColumnPos(6)); 1727 assertEquals("7 key auto 5 L2 adjust", -1, params.mTopRowAdjustment); 1728 assertEquals("7 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1729 } 1730 1731 // [7] [6]| 1732 // [5] [4] [3] [2] <1>| 1733 @Test testLayout7KeyAuto5R0()1734 public void testLayout7KeyAuto5R0() { 1735 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R0); 1736 assertEquals("7 key auto 5 R0 columns", 5, params.mNumColumns); 1737 assertEquals("7 key auto 5 R0 rows", 2, params.mNumRows); 1738 assertEquals("7 key auto 5 R0 left", 4, params.mLeftKeys); 1739 assertEquals("7 key auto 5 R0 right", 1, params.mRightKeys); 1740 assertEquals("7 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 1741 assertEquals("7 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 1742 assertEquals("7 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 1743 assertEquals("7 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 1744 assertEquals("7 key auto 5 R0 [5]", -4, params.getColumnPos(4)); 1745 assertEquals("7 key auto 5 R0 [6]", 0, params.getColumnPos(5)); 1746 assertEquals("7 key auto 5 R0 [7]", -1, params.getColumnPos(6)); 1747 assertEquals("7 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 1748 assertEquals("7 key auto 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1749 } 1750 1751 // [7] [6] ___| 1752 // [5] [4] [3] [2] <1> ___| 1753 @Test testLayout7KeyAuto5R1()1754 public void testLayout7KeyAuto5R1() { 1755 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R1); 1756 assertEquals("7 key auto 5 R1 columns", 5, params.mNumColumns); 1757 assertEquals("7 key auto 5 R1 rows", 2, params.mNumRows); 1758 assertEquals("7 key auto 5 R1 left", 4, params.mLeftKeys); 1759 assertEquals("7 key auto 5 R1 right", 1, params.mRightKeys); 1760 assertEquals("7 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 1761 assertEquals("7 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 1762 assertEquals("7 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 1763 assertEquals("7 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 1764 assertEquals("7 key auto 5 R1 [5]", -4, params.getColumnPos(4)); 1765 assertEquals("7 key auto 5 R1 [6]", 0, params.getColumnPos(5)); 1766 assertEquals("7 key auto 5 R1 [7]", -1, params.getColumnPos(6)); 1767 assertEquals("7 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 1768 assertEquals("7 key auto 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1769 } 1770 1771 // [6] [7] ___| 1772 // [5] [4] [3] <1> [2] ___| 1773 @Test testLayout7KeyAuto5R2()1774 public void testLayout7KeyAuto5R2() { 1775 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R2); 1776 assertEquals("7 key auto 5 R2 columns", 5, params.mNumColumns); 1777 assertEquals("7 key auto 5 R2 rows", 2, params.mNumRows); 1778 assertEquals("7 key auto 5 R2 left", 3, params.mLeftKeys); 1779 assertEquals("7 key auto 5 R2 right", 2, params.mRightKeys); 1780 assertEquals("7 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 1781 assertEquals("7 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 1782 assertEquals("7 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 1783 assertEquals("7 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 1784 assertEquals("7 key auto 5 R2 [5]", -3, params.getColumnPos(4)); 1785 assertEquals("7 key auto 5 R2 [6]", 0, params.getColumnPos(5)); 1786 assertEquals("7 key auto 5 R2 [7]", 1, params.getColumnPos(6)); 1787 assertEquals("7 key auto 5 R2 adjust", -1, params.mTopRowAdjustment); 1788 assertEquals("7 key auto 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1789 } 1790 1791 // [7] 1792 // [6] [4] [5] 1793 // [3] <1> [2] 1794 @Test testLayout7KeyAuto3M0()1795 public void testLayout7KeyAuto3M0() { 1796 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_M0); 1797 assertEquals("7 key auto 3 M0 columns", 3, params.mNumColumns); 1798 assertEquals("7 key auto 3 M0 rows", 3, params.mNumRows); 1799 assertEquals("7 key auto 3 M0 left", 1, params.mLeftKeys); 1800 assertEquals("7 key auto 3 M0 right", 2, params.mRightKeys); 1801 assertEquals("7 key auto 3 M0 <1>", 0, params.getColumnPos(0)); 1802 assertEquals("7 key auto 3 M0 [2]", 1, params.getColumnPos(1)); 1803 assertEquals("7 key auto 3 M0 [3]", -1, params.getColumnPos(2)); 1804 assertEquals("7 key auto 3 M0 [4]", 0, params.getColumnPos(3)); 1805 assertEquals("7 key auto 3 M0 [5]", 1, params.getColumnPos(4)); 1806 assertEquals("7 key auto 3 M0 [6]", -1, params.getColumnPos(5)); 1807 assertEquals("7 key auto 3 M0 [7]", 0, params.getColumnPos(6)); 1808 assertEquals("7 key auto 3 M0 adjust", 0, params.mTopRowAdjustment); 1809 assertEquals("7 key auto 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1810 } 1811 1812 // |[7] 1813 // |[4] [5] [6] 1814 // |<1> [2] [3] 1815 @Test testLayout7KeyAuto3L0()1816 public void testLayout7KeyAuto3L0() { 1817 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_L0); 1818 assertEquals("7 key auto 3 L0 columns", 3, params.mNumColumns); 1819 assertEquals("7 key auto 3 L0 rows", 3, params.mNumRows); 1820 assertEquals("7 key auto 3 L0 left", 0, params.mLeftKeys); 1821 assertEquals("7 key auto 3 L0 right", 3, params.mRightKeys); 1822 assertEquals("7 key auto 3 L0 <1>", 0, params.getColumnPos(0)); 1823 assertEquals("7 key auto 3 L0 [2]", 1, params.getColumnPos(1)); 1824 assertEquals("7 key auto 3 L0 [3]", 2, params.getColumnPos(2)); 1825 assertEquals("7 key auto 3 L0 [4]", 0, params.getColumnPos(3)); 1826 assertEquals("7 key auto 3 L0 [5]", 1, params.getColumnPos(4)); 1827 assertEquals("7 key auto 3 L0 [6]", 2, params.getColumnPos(5)); 1828 assertEquals("7 key auto 3 L0 [7]", 0, params.getColumnPos(6)); 1829 assertEquals("7 key auto 3 L0 adjust", 0, params.mTopRowAdjustment); 1830 assertEquals("7 key auto 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1831 } 1832 1833 // |___ [7] 1834 // |___ [4] [5] [6] 1835 // |___ <1> [2] [3] 1836 @Test testLayout7KeyAuto3L1()1837 public void testLayout7KeyAuto3L1() { 1838 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_L1); 1839 assertEquals("7 key auto 3 L1 columns", 3, params.mNumColumns); 1840 assertEquals("7 key auto 3 L1 rows", 3, params.mNumRows); 1841 assertEquals("7 key auto 3 L1 left", 0, params.mLeftKeys); 1842 assertEquals("7 key auto 3 L1 right", 3, params.mRightKeys); 1843 assertEquals("7 key auto 3 L1 <1>", 0, params.getColumnPos(0)); 1844 assertEquals("7 key auto 3 L1 [2]", 1, params.getColumnPos(1)); 1845 assertEquals("7 key auto 3 L1 [3]", 2, params.getColumnPos(2)); 1846 assertEquals("7 key auto 3 L1 [4]", 0, params.getColumnPos(3)); 1847 assertEquals("7 key auto 3 L1 [5]", 1, params.getColumnPos(4)); 1848 assertEquals("7 key auto 3 L1 [6]", 2, params.getColumnPos(5)); 1849 assertEquals("7 key auto 3 L1 [7]", 0, params.getColumnPos(6)); 1850 assertEquals("7 key auto 3 L1 adjust", 0, params.mTopRowAdjustment); 1851 assertEquals("7 key auto 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1852 } 1853 1854 // |___ [7] 1855 // |___ [6] [4] [5] 1856 // |___ [3] <1> [2] 1857 @Test testLayout7KeyAuto3L2()1858 public void testLayout7KeyAuto3L2() { 1859 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_L2); 1860 assertEquals("7 key auto 3 L2 columns", 3, params.mNumColumns); 1861 assertEquals("7 key auto 3 L2 rows", 3, params.mNumRows); 1862 assertEquals("7 key auto 3 L2 left", 1, params.mLeftKeys); 1863 assertEquals("7 key auto 3 L2 right", 2, params.mRightKeys); 1864 assertEquals("7 key auto 3 L2 <1>", 0, params.getColumnPos(0)); 1865 assertEquals("7 key auto 3 L2 [2]", 1, params.getColumnPos(1)); 1866 assertEquals("7 key auto 3 L2 [3]", -1, params.getColumnPos(2)); 1867 assertEquals("7 key auto 3 L2 [4]", 0, params.getColumnPos(3)); 1868 assertEquals("7 key auto 3 L2 [5]", 1, params.getColumnPos(4)); 1869 assertEquals("7 key auto 3 L2 [6]", -1, params.getColumnPos(5)); 1870 assertEquals("7 key auto 3 L2 [7]", 0, params.getColumnPos(6)); 1871 assertEquals("7 key auto 3 L2 adjust", 0, params.mTopRowAdjustment); 1872 assertEquals("7 key auto 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1873 } 1874 1875 // [7]| 1876 // [6] [5] [4]| 1877 // [3] [2] <1>| 1878 @Test testLayout7KeyAuto3R0()1879 public void testLayout7KeyAuto3R0() { 1880 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_R0); 1881 assertEquals("7 key auto 3 R0 columns", 3, params.mNumColumns); 1882 assertEquals("7 key auto 3 R0 rows", 3, params.mNumRows); 1883 assertEquals("7 key auto 3 R0 left", 2, params.mLeftKeys); 1884 assertEquals("7 key auto 3 R0 right", 1, params.mRightKeys); 1885 assertEquals("7 key auto 3 R0 <1>", 0, params.getColumnPos(0)); 1886 assertEquals("7 key auto 3 R0 [2]", -1, params.getColumnPos(1)); 1887 assertEquals("7 key auto 3 R0 [3]", -2, params.getColumnPos(2)); 1888 assertEquals("7 key auto 3 R0 [4]", 0, params.getColumnPos(3)); 1889 assertEquals("7 key auto 3 R0 [5]", -1, params.getColumnPos(4)); 1890 assertEquals("7 key auto 3 R0 [6]", -2, params.getColumnPos(5)); 1891 assertEquals("7 key auto 3 R0 [7]", 0, params.getColumnPos(6)); 1892 assertEquals("7 key auto 3 R0 adjust", 0, params.mTopRowAdjustment); 1893 assertEquals("7 key auto 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1894 } 1895 1896 // [7] ___| 1897 // [6] [5] [4] ___| 1898 // [3] [2] <1> ___| 1899 @Test testLayout7KeyAuto3R1()1900 public void testLayout7KeyAuto3R1() { 1901 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_R1); 1902 assertEquals("7 key auto 3 R1 columns", 3, params.mNumColumns); 1903 assertEquals("7 key auto 3 R1 rows", 3, params.mNumRows); 1904 assertEquals("7 key auto 3 R1 left", 2, params.mLeftKeys); 1905 assertEquals("7 key auto 3 R1 right", 1, params.mRightKeys); 1906 assertEquals("7 key auto 3 R1 <1>", 0, params.getColumnPos(0)); 1907 assertEquals("7 key auto 3 R1 [2]", -1, params.getColumnPos(1)); 1908 assertEquals("7 key auto 3 R1 [3]", -2, params.getColumnPos(2)); 1909 assertEquals("7 key auto 3 R1 [4]", 0, params.getColumnPos(3)); 1910 assertEquals("7 key auto 3 R1 [5]", -1, params.getColumnPos(4)); 1911 assertEquals("7 key auto 3 R1 [6]", -2, params.getColumnPos(5)); 1912 assertEquals("7 key auto 3 R1 [7]", 0, params.getColumnPos(6)); 1913 assertEquals("7 key auto 3 R1 adjust", 0, params.mTopRowAdjustment); 1914 assertEquals("7 key auto 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1915 } 1916 1917 // [7] ___| 1918 // [6] [4] [5] ___| 1919 // [3] <1> [2] ___| 1920 @Test testLayout7KeyAuto3R2()1921 public void testLayout7KeyAuto3R2() { 1922 MoreKeysKeyboardParams params = createParams(7, 3, XPOS_R2); 1923 assertEquals("7 key auto 3 R2 columns", 3, params.mNumColumns); 1924 assertEquals("7 key auto 3 R2 rows", 3, params.mNumRows); 1925 assertEquals("7 key auto 3 R2 left", 1, params.mLeftKeys); 1926 assertEquals("7 key auto 3 R2 right", 2, params.mRightKeys); 1927 assertEquals("7 key auto 3 R2 <1>", 0, params.getColumnPos(0)); 1928 assertEquals("7 key auto 3 R2 [2]", 1, params.getColumnPos(1)); 1929 assertEquals("7 key auto 3 R2 [3]", -1, params.getColumnPos(2)); 1930 assertEquals("7 key auto 3 R2 [4]", 0, params.getColumnPos(3)); 1931 assertEquals("7 key auto 3 R2 [5]", 1, params.getColumnPos(4)); 1932 assertEquals("7 key auto 3 R2 [6]", -1, params.getColumnPos(5)); 1933 assertEquals("7 key auto 3 R2 [7]", 0, params.getColumnPos(6)); 1934 assertEquals("7 key auto 3 R2 adjust", 0, params.mTopRowAdjustment); 1935 assertEquals("7 key auto 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1936 } 1937 1938 // [8] [6] [7] 1939 // [5] [3] <1> [2] [4] 1940 @Test testLayout8KeyAuto5M0()1941 public void testLayout8KeyAuto5M0() { 1942 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_M0); 1943 assertEquals("8 key auto 5 M0 columns", 5, params.mNumColumns); 1944 assertEquals("8 key auto 5 M0 rows", 2, params.mNumRows); 1945 assertEquals("8 key auto 5 M0 left", 2, params.mLeftKeys); 1946 assertEquals("8 key auto 5 M0 right", 3, params.mRightKeys); 1947 assertEquals("8 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 1948 assertEquals("8 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 1949 assertEquals("8 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 1950 assertEquals("8 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 1951 assertEquals("8 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 1952 assertEquals("8 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 1953 assertEquals("8 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 1954 assertEquals("8 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 1955 assertEquals("8 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 1956 assertEquals("8 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1957 } 1958 1959 // |[6] [7] [8] 1960 // |<1> [2] [3] [4] [5] 1961 @Test testLayout8KeyAuto5L0()1962 public void testLayout8KeyAuto5L0() { 1963 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L0); 1964 assertEquals("8 key auto 5 L0 columns", 5, params.mNumColumns); 1965 assertEquals("8 key auto 5 L0 rows", 2, params.mNumRows); 1966 assertEquals("8 key auto 5 L0 left", 0, params.mLeftKeys); 1967 assertEquals("8 key auto 5 L0 right", 5, params.mRightKeys); 1968 assertEquals("8 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 1969 assertEquals("8 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 1970 assertEquals("8 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 1971 assertEquals("8 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 1972 assertEquals("8 key auto 5 L0 [5]", 4, params.getColumnPos(4)); 1973 assertEquals("8 key auto 5 L0 [6]", 0, params.getColumnPos(5)); 1974 assertEquals("8 key auto 5 L0 [7]", 1, params.getColumnPos(6)); 1975 assertEquals("8 key auto 5 L0 [8]", 2, params.getColumnPos(7)); 1976 assertEquals("8 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 1977 assertEquals("8 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1978 } 1979 1980 // |___ [6] [7] [8] 1981 // |___ <1> [2] [3] [4] [5] 1982 @Test testLayout8KeyAuto5L1()1983 public void testLayout8KeyAuto5L1() { 1984 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L1); 1985 assertEquals("8 key auto 5 L1 columns", 5, params.mNumColumns); 1986 assertEquals("8 key auto 5 L1 rows", 2, params.mNumRows); 1987 assertEquals("8 key auto 5 L1 left", 0, params.mLeftKeys); 1988 assertEquals("8 key auto 5 L1 right", 5, params.mRightKeys); 1989 assertEquals("8 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 1990 assertEquals("8 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 1991 assertEquals("8 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 1992 assertEquals("8 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 1993 assertEquals("8 key auto 5 L1 [5]", 4, params.getColumnPos(4)); 1994 assertEquals("8 key auto 5 L1 [6]", 0, params.getColumnPos(5)); 1995 assertEquals("8 key auto 5 L1 [7]", 1, params.getColumnPos(6)); 1996 assertEquals("8 key auto 5 L1 [8]", 2, params.getColumnPos(7)); 1997 assertEquals("8 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 1998 assertEquals("8 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1999 } 2000 2001 // |___ [8] [6] [7] 2002 // |___ [3] <1> [2] [4] [5] 2003 @Test testLayout8KeyAuto5L2()2004 public void testLayout8KeyAuto5L2() { 2005 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L2); 2006 assertEquals("8 key auto 5 L2 columns", 5, params.mNumColumns); 2007 assertEquals("8 key auto 5 L2 rows", 2, params.mNumRows); 2008 assertEquals("8 key auto 5 L2 left", 1, params.mLeftKeys); 2009 assertEquals("8 key auto 5 L2 right", 4, params.mRightKeys); 2010 assertEquals("8 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 2011 assertEquals("8 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 2012 assertEquals("8 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 2013 assertEquals("8 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 2014 assertEquals("8 key auto 5 L2 [5]", 3, params.getColumnPos(4)); 2015 assertEquals("8 key auto 5 L2 [6]", 0, params.getColumnPos(5)); 2016 assertEquals("8 key auto 5 L2 [7]", 1, params.getColumnPos(6)); 2017 assertEquals("8 key auto 5 L2 [8]", -1, params.getColumnPos(7)); 2018 assertEquals("8 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 2019 assertEquals("8 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2020 } 2021 2022 // [8] [7] [6]| 2023 // [5] [4] [3] [2] <1>| 2024 @Test testLayout8KeyAuto5R0()2025 public void testLayout8KeyAuto5R0() { 2026 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R0); 2027 assertEquals("8 key auto 5 R0 columns", 5, params.mNumColumns); 2028 assertEquals("8 key auto 5 R0 rows", 2, params.mNumRows); 2029 assertEquals("8 key auto 5 R0 left", 4, params.mLeftKeys); 2030 assertEquals("8 key auto 5 R0 right", 1, params.mRightKeys); 2031 assertEquals("8 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 2032 assertEquals("8 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 2033 assertEquals("8 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 2034 assertEquals("8 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 2035 assertEquals("8 key auto 5 R0 [5]", -4, params.getColumnPos(4)); 2036 assertEquals("8 key auto 5 R0 [6]", 0, params.getColumnPos(5)); 2037 assertEquals("8 key auto 5 R0 [7]", -1, params.getColumnPos(6)); 2038 assertEquals("8 key auto 5 R0 [8]", -2, params.getColumnPos(7)); 2039 assertEquals("8 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 2040 assertEquals("8 key auto 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2041 } 2042 2043 // [8] [7] [6] ___| 2044 // [5] [4] [3] [2] <1> ___| 2045 @Test testLayout8KeyAuto5R1()2046 public void testLayout8KeyAuto5R1() { 2047 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R1); 2048 assertEquals("8 key auto 5 R1 columns", 5, params.mNumColumns); 2049 assertEquals("8 key auto 5 R1 rows", 2, params.mNumRows); 2050 assertEquals("8 key auto 5 R1 left", 4, params.mLeftKeys); 2051 assertEquals("8 key auto 5 R1 right", 1, params.mRightKeys); 2052 assertEquals("8 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 2053 assertEquals("8 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 2054 assertEquals("8 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 2055 assertEquals("8 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 2056 assertEquals("8 key auto 5 R1 [5]", -4, params.getColumnPos(4)); 2057 assertEquals("8 key auto 5 R1 [6]", 0, params.getColumnPos(5)); 2058 assertEquals("8 key auto 5 R1 [7]", -1, params.getColumnPos(6)); 2059 assertEquals("8 key auto 5 R1 [8]", -2, params.getColumnPos(7)); 2060 assertEquals("8 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 2061 assertEquals("8 key auto 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2062 } 2063 2064 // [8] [6] [7] ___| 2065 // [5] [4] [3] <1> [2] ___| 2066 @Test testLayout8KeyAuto5R2()2067 public void testLayout8KeyAuto5R2() { 2068 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R2); 2069 assertEquals("8 key auto 5 R2 columns", 5, params.mNumColumns); 2070 assertEquals("8 key auto 5 R2 rows", 2, params.mNumRows); 2071 assertEquals("8 key auto 5 R2 left", 3, params.mLeftKeys); 2072 assertEquals("8 key auto 5 R2 right", 2, params.mRightKeys); 2073 assertEquals("8 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 2074 assertEquals("8 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 2075 assertEquals("8 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 2076 assertEquals("8 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 2077 assertEquals("8 key auto 5 R2 [5]", -3, params.getColumnPos(4)); 2078 assertEquals("8 key auto 5 R2 [6]", 0, params.getColumnPos(5)); 2079 assertEquals("8 key auto 5 R2 [7]", 1, params.getColumnPos(6)); 2080 assertEquals("8 key auto 5 R2 [8]", -1, params.getColumnPos(7)); 2081 assertEquals("8 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 2082 assertEquals("8 key auto 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2083 } 2084 2085 // [8] [6] [7] [9] 2086 // [5] [3] <1> [2] [4] 2087 @Test testLayout9KeyAuto5M0()2088 public void testLayout9KeyAuto5M0() { 2089 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_M0); 2090 assertEquals("9 key auto 5 M0 columns", 5, params.mNumColumns); 2091 assertEquals("9 key auto 5 M0 rows", 2, params.mNumRows); 2092 assertEquals("9 key auto 5 M0 left", 2, params.mLeftKeys); 2093 assertEquals("9 key auto 5 M0 right", 3, params.mRightKeys); 2094 assertEquals("9 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 2095 assertEquals("9 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 2096 assertEquals("9 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 2097 assertEquals("9 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 2098 assertEquals("9 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 2099 assertEquals("9 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 2100 assertEquals("9 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 2101 assertEquals("9 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 2102 assertEquals("9 key auto 5 M0 [9]", 2, params.getColumnPos(8)); 2103 assertEquals("9 key auto 5 M0 adjust", -1, params.mTopRowAdjustment); 2104 assertEquals("9 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2105 } 2106 2107 // |[6] [7] [8] [9] 2108 // |<1> [2] [3] [4] [5] 2109 @Test testLayout9KeyAuto5L0()2110 public void testLayout9KeyAuto5L0() { 2111 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L0); 2112 assertEquals("9 key auto 5 L0 columns", 5, params.mNumColumns); 2113 assertEquals("9 key auto 5 L0 rows", 2, params.mNumRows); 2114 assertEquals("9 key auto 5 L0 left", 0, params.mLeftKeys); 2115 assertEquals("9 key auto 5 L0 right", 5, params.mRightKeys); 2116 assertEquals("9 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 2117 assertEquals("9 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 2118 assertEquals("9 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 2119 assertEquals("9 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 2120 assertEquals("9 key auto 5 L0 [5]", 4, params.getColumnPos(4)); 2121 assertEquals("9 key auto 5 L0 [6]", 0, params.getColumnPos(5)); 2122 assertEquals("9 key auto 5 L0 [7]", 1, params.getColumnPos(6)); 2123 assertEquals("9 key auto 5 L0 [8]", 2, params.getColumnPos(7)); 2124 assertEquals("9 key auto 5 L0 [9]", 3, params.getColumnPos(8)); 2125 assertEquals("9 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 2126 assertEquals("9 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2127 } 2128 2129 // |___ [6] [7] [8] [9] 2130 // |___ <1> [2] [3] [4] [5] 2131 @Test testLayout9KeyAuto5L1()2132 public void testLayout9KeyAuto5L1() { 2133 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L1); 2134 assertEquals("9 key auto 5 L1 columns", 5, params.mNumColumns); 2135 assertEquals("9 key auto 5 L1 rows", 2, params.mNumRows); 2136 assertEquals("9 key auto 5 L1 left", 0, params.mLeftKeys); 2137 assertEquals("9 key auto 5 L1 right", 5, params.mRightKeys); 2138 assertEquals("9 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 2139 assertEquals("9 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 2140 assertEquals("9 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 2141 assertEquals("9 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 2142 assertEquals("9 key auto 5 L1 [5]", 4, params.getColumnPos(4)); 2143 assertEquals("9 key auto 5 L1 [6]", 0, params.getColumnPos(5)); 2144 assertEquals("9 key auto 5 L1 [7]", 1, params.getColumnPos(6)); 2145 assertEquals("9 key auto 5 L1 [8]", 2, params.getColumnPos(7)); 2146 assertEquals("9 key auto 5 L1 [9]", 3, params.getColumnPos(8)); 2147 assertEquals("9 key auto 5 L1 adjust",0, params.mTopRowAdjustment); 2148 assertEquals("9 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2149 } 2150 2151 // |___ [6] [7] [8] [9] 2152 // |___ [3] <1> [2] [4] [5] 2153 @Test testLayout9KeyAuto5L2()2154 public void testLayout9KeyAuto5L2() { 2155 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L2); 2156 assertEquals("9 key auto 5 L2 columns", 5, params.mNumColumns); 2157 assertEquals("9 key auto 5 L2 rows", 2, params.mNumRows); 2158 assertEquals("9 key auto 5 L2 left", 1, params.mLeftKeys); 2159 assertEquals("9 key auto 5 L2 right", 4, params.mRightKeys); 2160 assertEquals("9 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 2161 assertEquals("9 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 2162 assertEquals("9 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 2163 assertEquals("9 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 2164 assertEquals("9 key auto 5 L2 [5]", 3, params.getColumnPos(4)); 2165 assertEquals("9 key auto 5 L2 [6]", 0, params.getColumnPos(5)); 2166 assertEquals("9 key auto 5 L2 [7]", 1, params.getColumnPos(6)); 2167 assertEquals("9 key auto 5 L2 [8]", 2, params.getColumnPos(7)); 2168 assertEquals("9 key auto 5 L2 [9]", 3, params.getColumnPos(8)); 2169 assertEquals("9 key auto 5 L2 adjust", -1, params.mTopRowAdjustment); 2170 assertEquals("9 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2171 } 2172 2173 // [9] [8] [7] [6]| 2174 // [5] [4] [3] [2] <1>| 2175 @Test testLayout9KeyAuto5R0()2176 public void testLayout9KeyAuto5R0() { 2177 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R0); 2178 assertEquals("9 key auto 5 R0 columns", 5, params.mNumColumns); 2179 assertEquals("9 key auto 5 R0 rows", 2, params.mNumRows); 2180 assertEquals("9 key auto 5 R0 left", 4, params.mLeftKeys); 2181 assertEquals("9 key auto 5 R0 right", 1, params.mRightKeys); 2182 assertEquals("9 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 2183 assertEquals("9 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 2184 assertEquals("9 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 2185 assertEquals("9 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 2186 assertEquals("9 key auto 5 R0 [5]", -4, params.getColumnPos(4)); 2187 assertEquals("9 key auto 5 R0 [6]", 0, params.getColumnPos(5)); 2188 assertEquals("9 key auto 5 R0 [7]", -1, params.getColumnPos(6)); 2189 assertEquals("9 key auto 5 R0 [8]", -2, params.getColumnPos(7)); 2190 assertEquals("9 key auto 5 R0 [9]", -3, params.getColumnPos(8)); 2191 assertEquals("9 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 2192 assertEquals("9 key auto 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2193 } 2194 2195 // [9] [8] [7] [6] ___| 2196 // [5] [4] [3] [2] <1> ___| 2197 @Test testLayout9KeyAuto5R1()2198 public void testLayout9KeyAuto5R1() { 2199 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R1); 2200 assertEquals("9 key auto 5 R1 columns", 5, params.mNumColumns); 2201 assertEquals("9 key auto 5 R1 rows", 2, params.mNumRows); 2202 assertEquals("9 key auto 5 R1 left", 4, params.mLeftKeys); 2203 assertEquals("9 key auto 5 R1 right", 1, params.mRightKeys); 2204 assertEquals("9 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 2205 assertEquals("9 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 2206 assertEquals("9 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 2207 assertEquals("9 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 2208 assertEquals("9 key auto 5 R1 [5]", -4, params.getColumnPos(4)); 2209 assertEquals("9 key auto 5 R1 [6]", 0, params.getColumnPos(5)); 2210 assertEquals("9 key auto 5 R1 [7]", -1, params.getColumnPos(6)); 2211 assertEquals("9 key auto 5 R1 [8]", -2, params.getColumnPos(7)); 2212 assertEquals("9 key auto 5 R1 [9]", -3, params.getColumnPos(8)); 2213 assertEquals("9 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 2214 assertEquals("9 key auto 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2215 } 2216 2217 // [9] [8] [6] [7] ___| 2218 // [5] [4] [3] <1> [2] ___| 2219 @Test testLayout9KeyAuto5R2()2220 public void testLayout9KeyAuto5R2() { 2221 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R2); 2222 assertEquals("9 key auto 5 R2 columns", 5, params.mNumColumns); 2223 assertEquals("9 key auto 5 R2 rows", 2, params.mNumRows); 2224 assertEquals("9 key auto 5 R2 left", 3, params.mLeftKeys); 2225 assertEquals("9 key auto 5 R2 right", 2, params.mRightKeys); 2226 assertEquals("9 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 2227 assertEquals("9 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 2228 assertEquals("9 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 2229 assertEquals("9 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 2230 assertEquals("9 key auto 5 R2 [5]", -3, params.getColumnPos(4)); 2231 assertEquals("9 key auto 5 R2 [6]", 0, params.getColumnPos(5)); 2232 assertEquals("9 key auto 5 R2 [7]", 1, params.getColumnPos(6)); 2233 assertEquals("9 key auto 5 R2 [8]", -1, params.getColumnPos(7)); 2234 assertEquals("9 key auto 5 R2 [9]", -2, params.getColumnPos(8)); 2235 assertEquals("9 key auto 5 R2 adjust", -1, params.mTopRowAdjustment); 2236 assertEquals("9 key auto 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2237 } 2238 2239 // [A] [8] [6] [7] [9] 2240 // [5] [3] <1> [2] [4] 2241 @Test testLayout10KeyAuto5M0()2242 public void testLayout10KeyAuto5M0() { 2243 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_M0); 2244 assertEquals("10 key auto 5 M0 columns", 5, params.mNumColumns); 2245 assertEquals("10 key auto 5 M0 rows", 2, params.mNumRows); 2246 assertEquals("10 key auto 5 M0 left", 2, params.mLeftKeys); 2247 assertEquals("10 key auto 5 M0 right", 3, params.mRightKeys); 2248 assertEquals("10 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 2249 assertEquals("10 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 2250 assertEquals("10 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 2251 assertEquals("10 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 2252 assertEquals("10 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 2253 assertEquals("10 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 2254 assertEquals("10 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 2255 assertEquals("10 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 2256 assertEquals("10 key auto 5 M0 [9]", 2, params.getColumnPos(8)); 2257 assertEquals("10 key auto 5 M0 [A]", -2, params.getColumnPos(9)); 2258 assertEquals("10 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 2259 assertEquals("10 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2260 } 2261 2262 // |[6] [7] [8] [9] [A] 2263 // |<1> [2] [3] [4] [5] 2264 @Test testLayout10KeyAuto5L0()2265 public void testLayout10KeyAuto5L0() { 2266 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L0); 2267 assertEquals("10 key auto 5 L0 columns", 5, params.mNumColumns); 2268 assertEquals("10 key auto 5 L0 rows", 2, params.mNumRows); 2269 assertEquals("10 key auto 5 L0 left", 0, params.mLeftKeys); 2270 assertEquals("10 key auto 5 L0 right", 5, params.mRightKeys); 2271 assertEquals("10 key auto 5 L0 <1>", 0, params.getColumnPos(0)); 2272 assertEquals("10 key auto 5 L0 [2]", 1, params.getColumnPos(1)); 2273 assertEquals("10 key auto 5 L0 [3]", 2, params.getColumnPos(2)); 2274 assertEquals("10 key auto 5 L0 [4]", 3, params.getColumnPos(3)); 2275 assertEquals("10 key auto 5 L0 [5]", 4, params.getColumnPos(4)); 2276 assertEquals("10 key auto 5 L0 [6]", 0, params.getColumnPos(5)); 2277 assertEquals("10 key auto 5 L0 [7]", 1, params.getColumnPos(6)); 2278 assertEquals("10 key auto 5 L0 [8]", 2, params.getColumnPos(7)); 2279 assertEquals("10 key auto 5 L0 [9]", 3, params.getColumnPos(8)); 2280 assertEquals("10 key auto 5 L0 [A]", 4, params.getColumnPos(9)); 2281 assertEquals("10 key auto 5 L0 adjust", 0, params.mTopRowAdjustment); 2282 assertEquals("10 key auto 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2283 } 2284 2285 // |___ [6] [7] [8] [9] [A] 2286 // |___ <1> [2] [3] [4] [5] 2287 @Test testLayout10KeyAuto5L1()2288 public void testLayout10KeyAuto5L1() { 2289 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L1); 2290 assertEquals("10 key auto 5 L1 columns", 5, params.mNumColumns); 2291 assertEquals("10 key auto 5 L1 rows", 2, params.mNumRows); 2292 assertEquals("10 key auto 5 L1 left", 0, params.mLeftKeys); 2293 assertEquals("10 key auto 5 L1 right", 5, params.mRightKeys); 2294 assertEquals("10 key auto 5 L1 <1>", 0, params.getColumnPos(0)); 2295 assertEquals("10 key auto 5 L1 [2]", 1, params.getColumnPos(1)); 2296 assertEquals("10 key auto 5 L1 [3]", 2, params.getColumnPos(2)); 2297 assertEquals("10 key auto 5 L1 [4]", 3, params.getColumnPos(3)); 2298 assertEquals("10 key auto 5 L1 [5]", 4, params.getColumnPos(4)); 2299 assertEquals("10 key auto 5 L1 [6]", 0, params.getColumnPos(5)); 2300 assertEquals("10 key auto 5 L1 [7]", 1, params.getColumnPos(6)); 2301 assertEquals("10 key auto 5 L1 [8]", 2, params.getColumnPos(7)); 2302 assertEquals("10 key auto 5 L1 [9]", 3, params.getColumnPos(8)); 2303 assertEquals("10 key auto 5 L1 [A]", 4, params.getColumnPos(9)); 2304 assertEquals("10 key auto 5 L1 adjust", 0, params.mTopRowAdjustment); 2305 assertEquals("10 key auto 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2306 } 2307 2308 // |___ [8] [6] [7] [9] [A] 2309 // |___ [3] <1> [2] [4] [5] 2310 @Test testLayout10KeyAuto5L2()2311 public void testLayout10KeyAuto5L2() { 2312 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L2); 2313 assertEquals("10 key auto 5 L2 columns", 5, params.mNumColumns); 2314 assertEquals("10 key auto 5 L2 rows", 2, params.mNumRows); 2315 assertEquals("10 key auto 5 L2 left", 1, params.mLeftKeys); 2316 assertEquals("10 key auto 5 L2 right", 4, params.mRightKeys); 2317 assertEquals("10 key auto 5 L2 <1>", 0, params.getColumnPos(0)); 2318 assertEquals("10 key auto 5 L2 [2]", 1, params.getColumnPos(1)); 2319 assertEquals("10 key auto 5 L2 [3]", -1, params.getColumnPos(2)); 2320 assertEquals("10 key auto 5 L2 [4]", 2, params.getColumnPos(3)); 2321 assertEquals("10 key auto 5 L2 [5]", 3, params.getColumnPos(4)); 2322 assertEquals("10 key auto 5 L2 [6]", 0, params.getColumnPos(5)); 2323 assertEquals("10 key auto 5 L2 [7]", 1, params.getColumnPos(6)); 2324 assertEquals("10 key auto 5 L2 [8]", -1, params.getColumnPos(7)); 2325 assertEquals("10 key auto 5 L2 [9]", 2, params.getColumnPos(8)); 2326 assertEquals("10 key auto 5 L2 [A]", 3, params.getColumnPos(9)); 2327 assertEquals("10 key auto 5 L2 adjust", 0, params.mTopRowAdjustment); 2328 assertEquals("10 key auto 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2329 } 2330 2331 // [A] [9] [8] [7] [6]| 2332 // [5] [4] [3] [2] <1>| 2333 @Test testLayout10KeyAuto5R0()2334 public void testLayout10KeyAuto5R0() { 2335 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R0); 2336 assertEquals("10 key auto 5 R0 columns", 5, params.mNumColumns); 2337 assertEquals("10 key auto 5 R0 rows", 2, params.mNumRows); 2338 assertEquals("10 key auto 5 R0 left", 4, params.mLeftKeys); 2339 assertEquals("10 key auto 5 R0 right", 1, params.mRightKeys); 2340 assertEquals("10 key auto 5 R0 <1>", 0, params.getColumnPos(0)); 2341 assertEquals("10 key auto 5 R0 [2]", -1, params.getColumnPos(1)); 2342 assertEquals("10 key auto 5 R0 [3]", -2, params.getColumnPos(2)); 2343 assertEquals("10 key auto 5 R0 [4]", -3, params.getColumnPos(3)); 2344 assertEquals("10 key auto 5 R0 [5]", -4, params.getColumnPos(4)); 2345 assertEquals("10 key auto 5 R0 [6]", 0, params.getColumnPos(5)); 2346 assertEquals("10 key auto 5 R0 [7]", -1, params.getColumnPos(6)); 2347 assertEquals("10 key auto 5 R0 [8]", -2, params.getColumnPos(7)); 2348 assertEquals("10 key auto 5 R0 [9]", -3, params.getColumnPos(8)); 2349 assertEquals("10 key auto 5 R0 [A]", -4, params.getColumnPos(9)); 2350 assertEquals("10 key auto 5 R0 adjust", 0, params.mTopRowAdjustment); 2351 assertEquals("10 key auto 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2352 } 2353 2354 // [A] [9] [8] [7] [6] ___| 2355 // [5] [4] [3] [2] <1> ___| 2356 @Test testLayout10KeyAuto5R1()2357 public void testLayout10KeyAuto5R1() { 2358 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R1); 2359 assertEquals("10 key auto 5 R1 columns", 5, params.mNumColumns); 2360 assertEquals("10 key auto 5 R1 rows", 2, params.mNumRows); 2361 assertEquals("10 key auto 5 R1 left", 4, params.mLeftKeys); 2362 assertEquals("10 key auto 5 R1 right", 1, params.mRightKeys); 2363 assertEquals("10 key auto 5 R1 <1>", 0, params.getColumnPos(0)); 2364 assertEquals("10 key auto 5 R1 [2]", -1, params.getColumnPos(1)); 2365 assertEquals("10 key auto 5 R1 [3]", -2, params.getColumnPos(2)); 2366 assertEquals("10 key auto 5 R1 [4]", -3, params.getColumnPos(3)); 2367 assertEquals("10 key auto 5 R1 [5]", -4, params.getColumnPos(4)); 2368 assertEquals("10 key auto 5 R1 [6]", 0, params.getColumnPos(5)); 2369 assertEquals("10 key auto 5 R1 [7]", -1, params.getColumnPos(6)); 2370 assertEquals("10 key auto 5 R1 [8]", -2, params.getColumnPos(7)); 2371 assertEquals("10 key auto 5 R1 [9]", -3, params.getColumnPos(8)); 2372 assertEquals("10 key auto 5 R1 [A]", -4, params.getColumnPos(9)); 2373 assertEquals("10 key auto 5 R1 adjust", 0, params.mTopRowAdjustment); 2374 assertEquals("10 key auto 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2375 } 2376 2377 // [A] [9] [8] [6] [7] ___| 2378 // [5] [4] [3] <1> [2] ___| 2379 @Test testLayout10KeyAuto5R2()2380 public void testLayout10KeyAuto5R2() { 2381 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R2); 2382 assertEquals("10 key auto 5 R2 columns", 5, params.mNumColumns); 2383 assertEquals("10 key auto 5 R2 rows", 2, params.mNumRows); 2384 assertEquals("10 key auto 5 R2 left", 3, params.mLeftKeys); 2385 assertEquals("10 key auto 5 R2 right", 2, params.mRightKeys); 2386 assertEquals("10 key auto 5 R2 <1>", 0, params.getColumnPos(0)); 2387 assertEquals("10 key auto 5 R2 [2]", 1, params.getColumnPos(1)); 2388 assertEquals("10 key auto 5 R2 [3]", -1, params.getColumnPos(2)); 2389 assertEquals("10 key auto 5 R2 [4]", -2, params.getColumnPos(3)); 2390 assertEquals("10 key auto 5 R2 [5]", -3, params.getColumnPos(4)); 2391 assertEquals("10 key auto 5 R2 [6]", 0, params.getColumnPos(5)); 2392 assertEquals("10 key auto 5 R2 [7]", 1, params.getColumnPos(6)); 2393 assertEquals("10 key auto 5 R2 [8]", -1, params.getColumnPos(7)); 2394 assertEquals("10 key auto 5 R2 [9]", -2, params.getColumnPos(8)); 2395 assertEquals("10 key auto 5 R2 [A]", -3, params.getColumnPos(9)); 2396 assertEquals("10 key auto 5 R2 adjust", 0, params.mTopRowAdjustment); 2397 assertEquals("10 key auto 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2398 } 2399 2400 // [B] 2401 // [A] [8] [6] [7] [9] 2402 // [5] [3] <1> [2] [4] 2403 @Test testLayout11KeyAuto5M0()2404 public void testLayout11KeyAuto5M0() { 2405 MoreKeysKeyboardParams params = createParams(11, 5, XPOS_M0); 2406 assertEquals("11 key auto 5 M0 columns", 5, params.mNumColumns); 2407 assertEquals("11 key auto 5 M0 rows", 3, params.mNumRows); 2408 assertEquals("11 key auto 5 M0 left", 2, params.mLeftKeys); 2409 assertEquals("11 key auto 5 M0 right", 3, params.mRightKeys); 2410 assertEquals("11 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 2411 assertEquals("11 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 2412 assertEquals("11 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 2413 assertEquals("11 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 2414 assertEquals("11 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 2415 assertEquals("11 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 2416 assertEquals("11 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 2417 assertEquals("11 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 2418 assertEquals("11 key auto 5 M0 [9]", 2, params.getColumnPos(8)); 2419 assertEquals("11 key auto 5 M0 [A]", -2, params.getColumnPos(9)); 2420 assertEquals("11 key auto 5 M0 [B]", 0, params.getColumnPos(10)); 2421 assertEquals("11 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 2422 assertEquals("11 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2423 } 2424 2425 // [B] [C] 2426 // [A] [8] [6] [7] [9] 2427 // [5] [3] <1> [2] [4] 2428 @Test testLayout12KeyAuto5M0()2429 public void testLayout12KeyAuto5M0() { 2430 MoreKeysKeyboardParams params = createParams(12, 5, XPOS_M0); 2431 assertEquals("12 key auto 5 M0 columns", 5, params.mNumColumns); 2432 assertEquals("12 key auto 5 M0 rows", 3, params.mNumRows); 2433 assertEquals("12 key auto 5 M0 left", 2, params.mLeftKeys); 2434 assertEquals("12 key auto 5 M0 right", 3, params.mRightKeys); 2435 assertEquals("12 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 2436 assertEquals("12 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 2437 assertEquals("12 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 2438 assertEquals("12 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 2439 assertEquals("12 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 2440 assertEquals("12 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 2441 assertEquals("12 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 2442 assertEquals("12 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 2443 assertEquals("12 key auto 5 M0 [9]", 2, params.getColumnPos(8)); 2444 assertEquals("12 key auto 5 M0 [A]", -2, params.getColumnPos(9)); 2445 assertEquals("12 key auto 5 M0 [B]", 0, params.getColumnPos(10)); 2446 assertEquals("12 key auto 5 M0 [C]", 1, params.getColumnPos(11)); 2447 assertEquals("12 key auto 5 M0 adjust", -1, params.mTopRowAdjustment); 2448 assertEquals("12 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2449 } 2450 2451 // [D] [B] [C] 2452 // [A] [8] [6] [7] [9] 2453 // [5] [3] <1> [2] [4] 2454 @Test testLayout13KeyAuto5M0()2455 public void testLayout13KeyAuto5M0() { 2456 MoreKeysKeyboardParams params = createParams(13, 5, XPOS_M0); 2457 assertEquals("13 key auto 5 M0 columns", 5, params.mNumColumns); 2458 assertEquals("13 key auto 5 M0 rows", 3, params.mNumRows); 2459 assertEquals("13 key auto 5 M0 left", 2, params.mLeftKeys); 2460 assertEquals("13 key auto 5 M0 right", 3, params.mRightKeys); 2461 assertEquals("13 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 2462 assertEquals("13 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 2463 assertEquals("13 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 2464 assertEquals("13 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 2465 assertEquals("13 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 2466 assertEquals("13 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 2467 assertEquals("13 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 2468 assertEquals("13 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 2469 assertEquals("13 key auto 5 M0 [9]", 2, params.getColumnPos(8)); 2470 assertEquals("13 key auto 5 M0 [A]", -2, params.getColumnPos(9)); 2471 assertEquals("13 key auto 5 M0 [B]", 0, params.getColumnPos(10)); 2472 assertEquals("13 key auto 5 M0 [C]", 1, params.getColumnPos(11)); 2473 assertEquals("13 key auto 5 M0 [D]", -1, params.getColumnPos(12)); 2474 assertEquals("13 key auto 5 M0 adjust", 0, params.mTopRowAdjustment); 2475 assertEquals("13 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2476 } 2477 2478 // [D] [B] [C] [E] 2479 // [A] [8] [6] [7] [9] 2480 // [5] [3] <1> [2] [4] 2481 @Test testLayout14KeyAuto5M0()2482 public void testLayout14KeyAuto5M0() { 2483 MoreKeysKeyboardParams params = createParams(14, 5, XPOS_M0); 2484 assertEquals("13 key auto 5 M0 columns", 5, params.mNumColumns); 2485 assertEquals("13 key auto 5 M0 rows", 3, params.mNumRows); 2486 assertEquals("13 key auto 5 M0 left", 2, params.mLeftKeys); 2487 assertEquals("13 key auto 5 M0 right", 3, params.mRightKeys); 2488 assertEquals("13 key auto 5 M0 <1>", 0, params.getColumnPos(0)); 2489 assertEquals("13 key auto 5 M0 [2]", 1, params.getColumnPos(1)); 2490 assertEquals("13 key auto 5 M0 [3]", -1, params.getColumnPos(2)); 2491 assertEquals("13 key auto 5 M0 [4]", 2, params.getColumnPos(3)); 2492 assertEquals("13 key auto 5 M0 [5]", -2, params.getColumnPos(4)); 2493 assertEquals("13 key auto 5 M0 [6]", 0, params.getColumnPos(5)); 2494 assertEquals("13 key auto 5 M0 [7]", 1, params.getColumnPos(6)); 2495 assertEquals("13 key auto 5 M0 [8]", -1, params.getColumnPos(7)); 2496 assertEquals("13 key auto 5 M0 [9]", 2, params.getColumnPos(8)); 2497 assertEquals("13 key auto 5 M0 [A]", -2, params.getColumnPos(9)); 2498 assertEquals("13 key auto 5 M0 [B]", 0, params.getColumnPos(10)); 2499 assertEquals("13 key auto 5 M0 [C]", 1, params.getColumnPos(11)); 2500 assertEquals("13 key auto 5 M0 [D]", -1, params.getColumnPos(12)); 2501 assertEquals("13 key auto 5 M0 [E]", 2, params.getColumnPos(13)); 2502 assertEquals("13 key auto 5 M0 adjust", -1, params.mTopRowAdjustment); 2503 assertEquals("13 key auto 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2504 } 2505 2506 // [J] [I] [H] ___| 2507 // [G] [F] [E] [D] [C] [B] [A] [9] ___| 2508 // [8] [7] [6] [5] [4] [3] [2] <1> ___| 2509 @Test testLayout19KeyAuto8R1()2510 public void testLayout19KeyAuto8R1() { 2511 MoreKeysKeyboardParams params = createParams(19, 8, XPOS_R1); 2512 assertEquals("19 key auto 8 R1 columns", 8, params.mNumColumns); 2513 assertEquals("19 key auto 8 R1 rows", 3, params.mNumRows); 2514 assertEquals("19 key auto 8 R1 left", 7, params.mLeftKeys); 2515 assertEquals("19 key auto 8 R1 right", 1, params.mRightKeys); 2516 assertEquals("19 key auto 8 R1 <1>", 0, params.getColumnPos(0)); 2517 assertEquals("19 key auto 8 R1 [2]", -1, params.getColumnPos(1)); 2518 assertEquals("19 key auto 8 R1 [3]", -2, params.getColumnPos(2)); 2519 assertEquals("19 key auto 8 R1 [4]", -3, params.getColumnPos(3)); 2520 assertEquals("19 key auto 8 R1 [5]", -4, params.getColumnPos(4)); 2521 assertEquals("19 key auto 8 R1 [6]", -5, params.getColumnPos(5)); 2522 assertEquals("19 key auto 8 R1 [7]", -6, params.getColumnPos(6)); 2523 assertEquals("19 key auto 8 R1 [8]", -7, params.getColumnPos(7)); 2524 assertEquals("19 key auto 8 R1 [9]", 0, params.getColumnPos(8)); 2525 assertEquals("19 key auto 8 R1 [A]", -1, params.getColumnPos(9)); 2526 assertEquals("19 key auto 8 R1 [B]", -2, params.getColumnPos(10)); 2527 assertEquals("19 key auto 8 R1 [C]", -3, params.getColumnPos(11)); 2528 assertEquals("19 key auto 8 R1 [D]", -4, params.getColumnPos(12)); 2529 assertEquals("19 key auto 8 R1 [E]", -5, params.getColumnPos(13)); 2530 assertEquals("19 key auto 8 R1 [F]", -6, params.getColumnPos(14)); 2531 assertEquals("19 key auto 8 R1 [G]", -7, params.getColumnPos(15)); 2532 assertEquals("19 key auto 8 R1 [H]", 0, params.getColumnPos(16)); 2533 assertEquals("19 key auto 8 R1 [I]", -1, params.getColumnPos(17)); 2534 assertEquals("19 key auto 8 R1 [J]", -2, params.getColumnPos(18)); 2535 assertEquals("19 key auto 8 R1 adjust", 0, params.mTopRowAdjustment); 2536 assertEquals("19 key auto 8 R1 default", WIDTH * 7, params.getDefaultKeyCoordX()); 2537 } 2538 2539 // [J] [H] [I] ___| 2540 // [G] [F] [E] [D] [C] [B] [9] [A] ___| 2541 // [8] [7] [6] [5] [4] [3] <1> [2] ___| 2542 @Test testLayout19KeyAuto8R2()2543 public void testLayout19KeyAuto8R2() { 2544 MoreKeysKeyboardParams params = createParams(19, 8, XPOS_R2); 2545 assertEquals("19 key auto 8 R2 columns", 8, params.mNumColumns); 2546 assertEquals("19 key auto 8 R2 rows", 3, params.mNumRows); 2547 assertEquals("19 key auto 8 R2 left", 6, params.mLeftKeys); 2548 assertEquals("19 key auto 8 R2 right", 2, params.mRightKeys); 2549 assertEquals("19 key auto 8 R2 <1>", 0, params.getColumnPos(0)); 2550 assertEquals("19 key auto 8 R2 [2]", 1, params.getColumnPos(1)); 2551 assertEquals("19 key auto 8 R2 [3]", -1, params.getColumnPos(2)); 2552 assertEquals("19 key auto 8 R2 [4]", -2, params.getColumnPos(3)); 2553 assertEquals("19 key auto 8 R2 [5]", -3, params.getColumnPos(4)); 2554 assertEquals("19 key auto 8 R2 [6]", -4, params.getColumnPos(5)); 2555 assertEquals("19 key auto 8 R2 [7]", -5, params.getColumnPos(6)); 2556 assertEquals("19 key auto 8 R2 [8]", -6, params.getColumnPos(7)); 2557 assertEquals("19 key auto 8 R2 [9]", 0, params.getColumnPos(8)); 2558 assertEquals("19 key auto 8 R2 [A]", 1, params.getColumnPos(9)); 2559 assertEquals("19 key auto 8 R2 [B]", -1, params.getColumnPos(10)); 2560 assertEquals("19 key auto 8 R2 [C]", -2, params.getColumnPos(11)); 2561 assertEquals("19 key auto 8 R2 [D]", -3, params.getColumnPos(12)); 2562 assertEquals("19 key auto 8 R2 [E]", -4, params.getColumnPos(13)); 2563 assertEquals("19 key auto 8 R2 [F]", -5, params.getColumnPos(14)); 2564 assertEquals("19 key auto 8 R2 [G]", -6, params.getColumnPos(15)); 2565 assertEquals("19 key auto 8 R2 [H]", 0, params.getColumnPos(16)); 2566 assertEquals("19 key auto 8 R2 [I]", 1, params.getColumnPos(17)); 2567 assertEquals("19 key auto 8 R2 [J]", -1, params.getColumnPos(18)); 2568 assertEquals("19 key auto 8 R2 adjust", -1, params.mTopRowAdjustment); 2569 assertEquals("19 key auto 8 R2 default", WIDTH * 6, params.getDefaultKeyCoordX()); 2570 } 2571 2572 // [J] [H] [I] ___| 2573 // [G] [F] [E] [D] [B] [9] [A] [C] ___| 2574 // [8] [7] [6] [5] [3] <1> [2] [4] ___| 2575 @Test testLayout19KeyAuto8R3()2576 public void testLayout19KeyAuto8R3() { 2577 MoreKeysKeyboardParams params = createParams(19, 8, XPOS_R3); 2578 assertEquals("19 key auto 8 R3 columns", 8, params.mNumColumns); 2579 assertEquals("19 key auto 8 R3 rows", 3, params.mNumRows); 2580 assertEquals("19 key auto 8 R3 left", 5, params.mLeftKeys); 2581 assertEquals("19 key auto 8 R3 right", 3, params.mRightKeys); 2582 assertEquals("19 key auto 8 R3 <1>", 0, params.getColumnPos(0)); 2583 assertEquals("19 key auto 8 R3 [2]", 1, params.getColumnPos(1)); 2584 assertEquals("19 key auto 8 R3 [3]", -1, params.getColumnPos(2)); 2585 assertEquals("19 key auto 8 R3 [4]", 2, params.getColumnPos(3)); 2586 assertEquals("19 key auto 8 R3 [5]", -2, params.getColumnPos(4)); 2587 assertEquals("19 key auto 8 R3 [6]", -3, params.getColumnPos(5)); 2588 assertEquals("19 key auto 8 R3 [7]", -4, params.getColumnPos(6)); 2589 assertEquals("19 key auto 8 R3 [8]", -5, params.getColumnPos(7)); 2590 assertEquals("19 key auto 8 R3 [9]", 0, params.getColumnPos(8)); 2591 assertEquals("19 key auto 8 R3 [A]", 1, params.getColumnPos(9)); 2592 assertEquals("19 key auto 8 R3 [B]", -1, params.getColumnPos(10)); 2593 assertEquals("19 key auto 8 R3 [C]", 2, params.getColumnPos(11)); 2594 assertEquals("19 key auto 8 R3 [D]", -2, params.getColumnPos(12)); 2595 assertEquals("19 key auto 8 R3 [E]", -3, params.getColumnPos(13)); 2596 assertEquals("19 key auto 8 R3 [F]", -4, params.getColumnPos(14)); 2597 assertEquals("19 key auto 8 R3 [G]", -5, params.getColumnPos(15)); 2598 assertEquals("19 key auto 8 R3 [H]", 0, params.getColumnPos(16)); 2599 assertEquals("19 key auto 8 R3 [I]", 1, params.getColumnPos(17)); 2600 assertEquals("19 key auto 8 R3 [J]", -1, params.getColumnPos(18)); 2601 assertEquals("19 key auto 8 R3 adjust", -1, params.mTopRowAdjustment); 2602 assertEquals("19 key auto 8 R3 default", WIDTH * 5, params.getDefaultKeyCoordX()); 2603 } 2604 } 2605