1 /* 2 * Copyright (C) 2012 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 MoreKeysKeyboardBuilderFixedOrderTests { 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 */, true /* 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 fixColumns = KEYBOARD_WIDTH / WIDTH; 63 params = createParams(fixColumns + 1, fixColumns + 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 // "<m>" is the default key. 74 75 // <1> 76 @Test testLayout1KeyFix5M0()77 public void testLayout1KeyFix5M0() { 78 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_M0); 79 assertEquals("1 key fix 5 M0 columns", 1, params.mNumColumns); 80 assertEquals("1 key fix 5 M0 rows", 1, params.mNumRows); 81 assertEquals("1 key fix 5 M0 left", 0, params.mLeftKeys); 82 assertEquals("1 key fix 5 M0 right", 1, params.mRightKeys); 83 assertEquals("1 key fix 5 M0 <1>", 0, params.getColumnPos(0)); 84 assertEquals("1 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 85 assertEquals("1 key fix 5 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 86 } 87 88 // |<1> 89 @Test testLayout1KeyFix5L0()90 public void testLayout1KeyFix5L0() { 91 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L0); 92 assertEquals("1 key fix 5 L0 columns", 1, params.mNumColumns); 93 assertEquals("1 key fix 5 L0 rows", 1, params.mNumRows); 94 assertEquals("1 key fix 5 L0 left", 0, params.mLeftKeys); 95 assertEquals("1 key fix 5 L0 right", 1, params.mRightKeys); 96 assertEquals("1 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 97 assertEquals("1 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 98 assertEquals("1 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 99 } 100 101 // |___ <1> 102 @Test testLayout1KeyFix5L1()103 public void testLayout1KeyFix5L1() { 104 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L1); 105 assertEquals("1 key fix 5 L1 columns", 1, params.mNumColumns); 106 assertEquals("1 key fix 5 L1 rows", 1, params.mNumRows); 107 assertEquals("1 key fix 5 L1 left", 0, params.mLeftKeys); 108 assertEquals("1 key fix 5 L1 right", 1, params.mRightKeys); 109 assertEquals("1 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 110 assertEquals("1 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 111 assertEquals("1 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 112 } 113 114 // |___ ___ <1> 115 @Test testLayout1KeyFix5L2()116 public void testLayout1KeyFix5L2() { 117 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_L2); 118 assertEquals("1 key fix 5 L2 columns", 1, params.mNumColumns); 119 assertEquals("1 key fix 5 L2 rows", 1, params.mNumRows); 120 assertEquals("1 key fix 5 L2 left", 0, params.mLeftKeys); 121 assertEquals("1 key fix 5 L2 right", 1, params.mRightKeys); 122 assertEquals("1 key fix 5 L2 <1>", 0, params.getColumnPos(0)); 123 assertEquals("1 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 124 assertEquals("1 key fix 5 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 125 } 126 127 // <1>| 128 @Test testLayout1KeyFix5R0()129 public void testLayout1KeyFix5R0() { 130 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R0); 131 assertEquals("1 key fix 5 R0 columns", 1, params.mNumColumns); 132 assertEquals("1 key fix 5 R0 rows", 1, params.mNumRows); 133 assertEquals("1 key fix 5 R0 left", 0, params.mLeftKeys); 134 assertEquals("1 key fix 5 R0 right", 1, params.mRightKeys); 135 assertEquals("1 key fix 5 R0 <1>", 0, params.getColumnPos(0)); 136 assertEquals("1 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 137 assertEquals("1 key fix 5 R0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 138 } 139 140 // <1> ___| 141 @Test testLayout1KeyFix5R1()142 public void testLayout1KeyFix5R1() { 143 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R1); 144 assertEquals("1 key fix 5 R1 columns", 1, params.mNumColumns); 145 assertEquals("1 key fix 5 R1 rows", 1, params.mNumRows); 146 assertEquals("1 key fix 5 R1 left", 0, params.mLeftKeys); 147 assertEquals("1 key fix 5 R1 right", 1, params.mRightKeys); 148 assertEquals("1 key fix 5 R1 <1>", 0, params.getColumnPos(0)); 149 assertEquals("1 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 150 assertEquals("1 key fix 5 R1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 151 } 152 153 // <1> ___ ___| 154 @Test testLayout1KeyFix5R2()155 public void testLayout1KeyFix5R2() { 156 MoreKeysKeyboardParams params = createParams(1, 5, XPOS_R2); 157 assertEquals("1 key fix 5 R2 columns", 1, params.mNumColumns); 158 assertEquals("1 key fix 5 R2 rows", 1, params.mNumRows); 159 assertEquals("1 key fix 5 R2 left", 0, params.mLeftKeys); 160 assertEquals("1 key fix 5 R2 right", 1, params.mRightKeys); 161 assertEquals("1 key fix 5 R2 <1>", 0, params.getColumnPos(0)); 162 assertEquals("1 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 163 assertEquals("1 key fix 5 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 164 } 165 166 // <1> [2] 167 @Test testLayout2KeyFix5M0()168 public void testLayout2KeyFix5M0() { 169 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_M0); 170 assertEquals("2 key fix 5 M0 columns", 2, params.mNumColumns); 171 assertEquals("2 key fix 5 M0 rows", 1, params.mNumRows); 172 assertEquals("2 key fix 5 M0 left", 0, params.mLeftKeys); 173 assertEquals("2 key fix 5 M0 right", 2, params.mRightKeys); 174 assertEquals("2 key fix 5 M0 <1>", 0, params.getColumnPos(0)); 175 assertEquals("2 key fix 5 M0 [2]", 1, params.getColumnPos(1)); 176 assertEquals("2 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 177 assertEquals("2 key fix 5 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 178 } 179 180 // |<1> [2] 181 @Test testLayout2KeyFix5L0()182 public void testLayout2KeyFix5L0() { 183 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L0); 184 assertEquals("2 key fix 5 L0 columns", 2, params.mNumColumns); 185 assertEquals("2 key fix 5 L0 rows", 1, params.mNumRows); 186 assertEquals("2 key fix 5 L0 left", 0, params.mLeftKeys); 187 assertEquals("2 key fix 5 L0 right", 2, params.mRightKeys); 188 assertEquals("2 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 189 assertEquals("2 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 190 assertEquals("2 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 191 assertEquals("2 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 192 } 193 194 // |___ <1> [2] 195 @Test testLayout2KeyFix5L1()196 public void testLayout2KeyFix5L1() { 197 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L1); 198 assertEquals("2 key fix 5 L1 columns", 2, params.mNumColumns); 199 assertEquals("2 key fix 5 L1 rows", 1, params.mNumRows); 200 assertEquals("2 key fix 5 L1 left", 0, params.mLeftKeys); 201 assertEquals("2 key fix 5 L1 right", 2, params.mRightKeys); 202 assertEquals("2 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 203 assertEquals("2 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 204 assertEquals("2 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 205 assertEquals("2 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 206 } 207 208 // |___ ___ <1> [2] 209 @Test testLayout2KeyFix5L2()210 public void testLayout2KeyFix5L2() { 211 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_L2); 212 assertEquals("2 key fix 5 L2 columns", 2, params.mNumColumns); 213 assertEquals("2 key fix 5 L2 rows", 1, params.mNumRows); 214 assertEquals("2 key fix 5 L2 left", 0, params.mLeftKeys); 215 assertEquals("2 key fix 5 L2 right", 2, params.mRightKeys); 216 assertEquals("2 key fix 5 L2 <1>", 0, params.getColumnPos(0)); 217 assertEquals("2 key fix 5 L2 [2]", 1, params.getColumnPos(1)); 218 assertEquals("2 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 219 assertEquals("2 key fix 5 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 220 } 221 222 // [1] <2>| 223 @Test testLayout2KeyFix5R0()224 public void testLayout2KeyFix5R0() { 225 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R0); 226 assertEquals("2 key fix 5 R0 columns", 2, params.mNumColumns); 227 assertEquals("2 key fix 5 R0 rows", 1, params.mNumRows); 228 assertEquals("2 key fix 5 R0 left", 1, params.mLeftKeys); 229 assertEquals("2 key fix 5 R0 right", 1, params.mRightKeys); 230 assertEquals("2 key fix 5 R0 [1]", -1, params.getColumnPos(0)); 231 assertEquals("2 key fix 5 R0 <2>", 0, params.getColumnPos(1)); 232 assertEquals("2 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 233 assertEquals("2 key fix 5 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 234 } 235 236 // [1] <2> ___| 237 @Test testLayout2KeyFix5R1()238 public void testLayout2KeyFix5R1() { 239 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R1); 240 assertEquals("2 key fix 5 R1 columns", 2, params.mNumColumns); 241 assertEquals("2 key fix 5 R1 rows", 1, params.mNumRows); 242 assertEquals("2 key fix 5 R1 left", 1, params.mLeftKeys); 243 assertEquals("2 key fix 5 R1 right", 1, params.mRightKeys); 244 assertEquals("2 key fix 5 R1 [1]", -1, params.getColumnPos(0)); 245 assertEquals("2 key fix 5 R1 <2>", 0, params.getColumnPos(1)); 246 assertEquals("2 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 247 assertEquals("2 key fix 5 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 248 } 249 250 // <1> [2] ___| 251 @Test testLayout2KeyFix5R2()252 public void testLayout2KeyFix5R2() { 253 MoreKeysKeyboardParams params = createParams(2, 5, XPOS_R2); 254 assertEquals("2 key fix 5 R2 columns", 2, params.mNumColumns); 255 assertEquals("2 key fix 5 R2 rows", 1, params.mNumRows); 256 assertEquals("2 key fix 5 R2 left", 0, params.mLeftKeys); 257 assertEquals("2 key fix 5 R2 right", 2, params.mRightKeys); 258 assertEquals("2 key fix 5 R2 <1>", 0, params.getColumnPos(0)); 259 assertEquals("2 key fix 5 R2 [2]", 1, params.getColumnPos(1)); 260 assertEquals("2 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 261 assertEquals("2 key fix 5 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 262 } 263 264 // [3] 265 // <1> [2] 266 @Test testLayout3KeyFix2M0()267 public void testLayout3KeyFix2M0() { 268 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_M0); 269 assertEquals("3 key fix 2 M0 columns", 2, params.mNumColumns); 270 assertEquals("3 key fix 2 M0 rows", 2, params.mNumRows); 271 assertEquals("3 key fix 2 M0 left", 0, params.mLeftKeys); 272 assertEquals("3 key fix 2 M0 right", 2, params.mRightKeys); 273 assertEquals("3 key fix 2 M0 <1>", 0, params.getColumnPos(0)); 274 assertEquals("3 key fix 2 M0 [2]", 1, params.getColumnPos(1)); 275 assertEquals("3 key fix 2 M0 [3]", 0, params.getColumnPos(2)); 276 assertEquals("3 key fix 2 M0 adjust", 0, params.mTopRowAdjustment); 277 assertEquals("3 key fix 2 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 278 } 279 280 // |[3] 281 // |<1> [2] 282 @Test testLayout3KeyFix2L0()283 public void testLayout3KeyFix2L0() { 284 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L0); 285 assertEquals("3 key fix 2 L0 columns", 2, params.mNumColumns); 286 assertEquals("3 key fix 2 L0 rows", 2, params.mNumRows); 287 assertEquals("3 key fix 2 L0 left", 0, params.mLeftKeys); 288 assertEquals("3 key fix 2 L0 right", 2, params.mRightKeys); 289 assertEquals("3 key fix 2 L0 <1>", 0, params.getColumnPos(0)); 290 assertEquals("3 key fix 2 L0 [2]", 1, params.getColumnPos(1)); 291 assertEquals("3 key fix 2 L0 [3]", 0, params.getColumnPos(2)); 292 assertEquals("3 key fix 2 L0 adjust", 0, params.mTopRowAdjustment); 293 assertEquals("3 key fix 2 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 294 } 295 296 // |___ [3] 297 // |___ <1> [2] 298 @Test testLayout3KeyFix2L1()299 public void testLayout3KeyFix2L1() { 300 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L1); 301 assertEquals("3 key fix 2 L1 columns", 2, params.mNumColumns); 302 assertEquals("3 key fix 2 L1 rows", 2, params.mNumRows); 303 assertEquals("3 key fix 2 L1 left", 0, params.mLeftKeys); 304 assertEquals("3 key fix 2 L1 right", 2, params.mRightKeys); 305 assertEquals("3 key fix 2 L1 <1>", 0, params.getColumnPos(0)); 306 assertEquals("3 key fix 2 L1 [2]", 1, params.getColumnPos(1)); 307 assertEquals("3 key fix 2 L1 [3]", 0, params.getColumnPos(2)); 308 assertEquals("3 key fix 2 L1 adjust", 0, params.mTopRowAdjustment); 309 assertEquals("3 key fix 2 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 310 } 311 312 // | [3] 313 // |___ ___ <1> [2] 314 @Test testLayout3KeyFix2L2()315 public void testLayout3KeyFix2L2() { 316 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_L2); 317 assertEquals("3 key fix 2 L2 columns", 2, params.mNumColumns); 318 assertEquals("3 key fix 2 L2 rows", 2, params.mNumRows); 319 assertEquals("3 key fix 2 L2 left", 0, params.mLeftKeys); 320 assertEquals("3 key fix 2 L2 right", 2, params.mRightKeys); 321 assertEquals("3 key fix 2 L2 <1>", 0, params.getColumnPos(0)); 322 assertEquals("3 key fix 2 L2 [2]", 1, params.getColumnPos(1)); 323 assertEquals("3 key fix 2 L2 [3]", 0, params.getColumnPos(2)); 324 assertEquals("3 key fix 2 L2 adjust", 0, params.mTopRowAdjustment); 325 assertEquals("3 key fix 2 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 326 } 327 328 // [3]| 329 // [1] <2>| 330 @Test testLayout3KeyFix2R0()331 public void testLayout3KeyFix2R0() { 332 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R0); 333 assertEquals("3 key fix 2 R0 columns", 2, params.mNumColumns); 334 assertEquals("3 key fix 2 R0 rows", 2, params.mNumRows); 335 assertEquals("3 key fix 2 R0 left", 1, params.mLeftKeys); 336 assertEquals("3 key fix 2 R0 right", 1, params.mRightKeys); 337 assertEquals("3 key fix 2 R0 [1]", -1, params.getColumnPos(0)); 338 assertEquals("3 key fix 2 R0 <2>", 0, params.getColumnPos(1)); 339 assertEquals("3 key fix 2 R0 [3]", 0, params.getColumnPos(2)); 340 assertEquals("3 key fix 2 R0 adjust", 0, params.mTopRowAdjustment); 341 assertEquals("3 key fix 2 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 342 } 343 344 // [3] ___| 345 // [1] <2> ___| 346 @Test testLayout3KeyFix2R1()347 public void testLayout3KeyFix2R1() { 348 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R1); 349 assertEquals("3 key fix 2 R1 columns", 2, params.mNumColumns); 350 assertEquals("3 key fix 2 R1 rows", 2, params.mNumRows); 351 assertEquals("3 key fix 2 R1 left", 1, params.mLeftKeys); 352 assertEquals("3 key fix 2 R1 right", 1, params.mRightKeys); 353 assertEquals("3 key fix 2 R1 [1]", -1, params.getColumnPos(0)); 354 assertEquals("3 key fix 2 R1 <2>", 0, params.getColumnPos(1)); 355 assertEquals("3 key fix 2 R1 [3]", 0, params.getColumnPos(2)); 356 assertEquals("3 key fix 2 R1 adjust", 0, params.mTopRowAdjustment); 357 assertEquals("3 key fix 2 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 358 } 359 360 // [3] ___| 361 // <1> [2] ___| 362 @Test testLayout3KeyFix2R2()363 public void testLayout3KeyFix2R2() { 364 MoreKeysKeyboardParams params = createParams(3, 2, XPOS_R2); 365 assertEquals("3 key fix 2 R2 columns", 2, params.mNumColumns); 366 assertEquals("3 key fix 2 R2 rows", 2, params.mNumRows); 367 assertEquals("3 key fix 2 R2 left", 0, params.mLeftKeys); 368 assertEquals("3 key fix 2 R2 right", 2, params.mRightKeys); 369 assertEquals("3 key fix 2 R2 <1>", 0, params.getColumnPos(0)); 370 assertEquals("3 key fix 2 R2 [2]", 1, params.getColumnPos(1)); 371 assertEquals("3 key fix 2 R2 [3]", 0, params.getColumnPos(2)); 372 assertEquals("3 key fix 2 R2 adjust", 0, params.mTopRowAdjustment); 373 assertEquals("3 key fix 2 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 374 } 375 376 // [3] [4] 377 // <1> [2] 378 @Test testLayout4KeyFix2M0()379 public void testLayout4KeyFix2M0() { 380 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_M0); 381 assertEquals("3 key fix 2 M0 columns", 2, params.mNumColumns); 382 assertEquals("3 key fix 2 M0 rows", 2, params.mNumRows); 383 assertEquals("3 key fix 2 M0 left", 0, params.mLeftKeys); 384 assertEquals("3 key fix 2 M0 right", 2, params.mRightKeys); 385 assertEquals("3 key fix 2 M0 <1>", 0, params.getColumnPos(0)); 386 assertEquals("3 key fix 2 M0 [2]", 1, params.getColumnPos(1)); 387 assertEquals("3 key fix 2 M0 [3]", 0, params.getColumnPos(2)); 388 assertEquals("3 key fix 2 M0 [4]", 1, params.getColumnPos(3)); 389 assertEquals("3 key fix 2 M0 adjust", 0, params.mTopRowAdjustment); 390 assertEquals("3 key fix 2 M0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 391 } 392 393 // |[3] [4] 394 // |<1> [2] 395 @Test testLayout4KeyFix2L0()396 public void testLayout4KeyFix2L0() { 397 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_L0); 398 assertEquals("3 key fix 2 L0 columns", 2, params.mNumColumns); 399 assertEquals("3 key fix 2 L0 rows", 2, params.mNumRows); 400 assertEquals("3 key fix 2 L0 left", 0, params.mLeftKeys); 401 assertEquals("3 key fix 2 L0 right", 2, params.mRightKeys); 402 assertEquals("3 key fix 2 L0 <1>", 0, params.getColumnPos(0)); 403 assertEquals("3 key fix 2 L0 [2]", 1, params.getColumnPos(1)); 404 assertEquals("3 key fix 2 L0 [3]", 0, params.getColumnPos(2)); 405 assertEquals("3 key fix 2 L0 [4]", 1, params.getColumnPos(3)); 406 assertEquals("3 key fix 2 L0 adjust", 0, params.mTopRowAdjustment); 407 assertEquals("3 key fix 2 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 408 } 409 410 // |___ [3] [4] 411 // |___ <1> [2] 412 @Test testLayout4KeyFix2L1()413 public void testLayout4KeyFix2L1() { 414 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_L1); 415 assertEquals("3 key fix 2 L1 columns", 2, params.mNumColumns); 416 assertEquals("3 key fix 2 L1 rows", 2, params.mNumRows); 417 assertEquals("3 key fix 2 L1 left", 0, params.mLeftKeys); 418 assertEquals("3 key fix 2 L1 right", 2, params.mRightKeys); 419 assertEquals("3 key fix 2 L1 <1>", 0, params.getColumnPos(0)); 420 assertEquals("3 key fix 2 L1 [2]", 1, params.getColumnPos(1)); 421 assertEquals("3 key fix 2 L1 [3]", 0, params.getColumnPos(2)); 422 assertEquals("3 key fix 2 L1 [4]", 1, params.getColumnPos(3)); 423 assertEquals("3 key fix 2 L1 adjust", 0, params.mTopRowAdjustment); 424 assertEquals("3 key fix 2 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 425 } 426 427 // | [3] [4] 428 // |___ ___ <1> [2] 429 @Test testLayout4KeyFix2L2()430 public void testLayout4KeyFix2L2() { 431 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_L2); 432 assertEquals("3 key fix 2 L2 columns", 2, params.mNumColumns); 433 assertEquals("3 key fix 2 L2 rows", 2, params.mNumRows); 434 assertEquals("3 key fix 2 L2 left", 0, params.mLeftKeys); 435 assertEquals("3 key fix 2 L2 right", 2, params.mRightKeys); 436 assertEquals("3 key fix 2 L2 <1>", 0, params.getColumnPos(0)); 437 assertEquals("3 key fix 2 L2 [2]", 1, params.getColumnPos(1)); 438 assertEquals("3 key fix 2 L2 [3]", 0, params.getColumnPos(2)); 439 assertEquals("3 key fix 2 L2 [4]", 1, params.getColumnPos(3)); 440 assertEquals("3 key fix 2 L2 adjust", 0, params.mTopRowAdjustment); 441 assertEquals("3 key fix 2 L2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 442 } 443 444 // [3] [4]| 445 // [1] <2>| 446 @Test testLayout4KeyFix2R0()447 public void testLayout4KeyFix2R0() { 448 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_R0); 449 assertEquals("3 key fix 2 R0 columns", 2, params.mNumColumns); 450 assertEquals("3 key fix 2 R0 rows", 2, params.mNumRows); 451 assertEquals("3 key fix 2 R0 left", 1, params.mLeftKeys); 452 assertEquals("3 key fix 2 R0 right", 1, params.mRightKeys); 453 assertEquals("3 key fix 2 R0 [1]", -1, params.getColumnPos(0)); 454 assertEquals("3 key fix 2 R0 <2>", 0, params.getColumnPos(1)); 455 assertEquals("3 key fix 2 R0 [3]", -1, params.getColumnPos(2)); 456 assertEquals("3 key fix 2 R0 [4]", 0, params.getColumnPos(3)); 457 assertEquals("3 key fix 2 R0 adjust", 0, params.mTopRowAdjustment); 458 assertEquals("3 key fix 2 R0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 459 } 460 461 // [3] [4] ___| 462 // [1] <2> ___| 463 @Test testLayout4KeyFix2R1()464 public void testLayout4KeyFix2R1() { 465 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_R1); 466 assertEquals("3 key fix 2 R1 columns", 2, params.mNumColumns); 467 assertEquals("3 key fix 2 R1 rows", 2, params.mNumRows); 468 assertEquals("3 key fix 2 R1 left", 1, params.mLeftKeys); 469 assertEquals("3 key fix 2 R1 right", 1, params.mRightKeys); 470 assertEquals("3 key fix 2 R1 [1]", -1, params.getColumnPos(0)); 471 assertEquals("3 key fix 2 R1 <2>", 0, params.getColumnPos(1)); 472 assertEquals("3 key fix 2 R1 [3]", -1, params.getColumnPos(2)); 473 assertEquals("3 key fix 2 R1 [4]", 0, params.getColumnPos(3)); 474 assertEquals("3 key fix 2 R1 adjust", 0, params.mTopRowAdjustment); 475 assertEquals("3 key fix 2 R1 default", WIDTH * 1, params.getDefaultKeyCoordX()); 476 } 477 478 // [3] [4] ___| 479 // <1> [2] ___| 480 @Test testLayout4KeyFix2R2()481 public void testLayout4KeyFix2R2() { 482 MoreKeysKeyboardParams params = createParams(4, 2, XPOS_R2); 483 assertEquals("3 key fix 2 R2 columns", 2, params.mNumColumns); 484 assertEquals("3 key fix 2 R2 rows", 2, params.mNumRows); 485 assertEquals("3 key fix 2 R2 left", 0, params.mLeftKeys); 486 assertEquals("3 key fix 2 R2 right", 2, params.mRightKeys); 487 assertEquals("3 key fix 2 R2 <1>", 0, params.getColumnPos(0)); 488 assertEquals("3 key fix 2 R2 [2]", 1, params.getColumnPos(1)); 489 assertEquals("3 key fix 2 R2 [3]", 0, params.getColumnPos(2)); 490 assertEquals("3 key fix 2 R2 [4]", 1, params.getColumnPos(3)); 491 assertEquals("3 key fix 2 R2 adjust", 0, params.mTopRowAdjustment); 492 assertEquals("3 key fix 2 R2 default", WIDTH * 0, params.getDefaultKeyCoordX()); 493 } 494 495 // [1] <2> [3] 496 @Test testLayout3KeyFix5M0()497 public void testLayout3KeyFix5M0() { 498 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_M0); 499 assertEquals("3 key fix 5 columns", 3, params.mNumColumns); 500 assertEquals("3 key fix 5 rows", 1, params.mNumRows); 501 assertEquals("3 key fix 5 left", 1, params.mLeftKeys); 502 assertEquals("3 key fix 5 right", 2, params.mRightKeys); 503 assertEquals("3 key fix 5 [1]", -1, params.getColumnPos(0)); 504 assertEquals("3 key fix 5 <2>", 0, params.getColumnPos(1)); 505 assertEquals("3 key fix 5 [3]", 1, params.getColumnPos(2)); 506 assertEquals("3 key fix 5 adjust", 0, params.mTopRowAdjustment); 507 assertEquals("3 key fix 5 default", WIDTH * 1, params.getDefaultKeyCoordX()); 508 } 509 510 // |<1> [2] [3] 511 @Test testLayout3KeyFix5L0()512 public void testLayout3KeyFix5L0() { 513 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L0); 514 assertEquals("3 key fix 5 L0 columns", 3, params.mNumColumns); 515 assertEquals("3 key fix 5 L0 rows", 1, params.mNumRows); 516 assertEquals("3 key fix 5 L0 left", 0, params.mLeftKeys); 517 assertEquals("3 key fix 5 L0 right", 3, params.mRightKeys); 518 assertEquals("3 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 519 assertEquals("3 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 520 assertEquals("3 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 521 assertEquals("3 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 522 assertEquals("3 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 523 } 524 525 // |___ <1> [2] [3] 526 @Test testLayout3KeyFix5L1()527 public void testLayout3KeyFix5L1() { 528 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L1); 529 assertEquals("3 key fix 5 L1 columns", 3, params.mNumColumns); 530 assertEquals("3 key fix 5 L1 rows", 1, params.mNumRows); 531 assertEquals("3 key fix 5 L1 left", 0, params.mLeftKeys); 532 assertEquals("3 key fix 5 L1 right", 3, params.mRightKeys); 533 assertEquals("3 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 534 assertEquals("3 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 535 assertEquals("3 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 536 assertEquals("3 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 537 assertEquals("3 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 538 } 539 540 // |___ [1] <2> [3] 541 @Test testLayout3KeyFix5L2()542 public void testLayout3KeyFix5L2() { 543 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_L2); 544 assertEquals("3 key fix 5 L2 columns", 3, params.mNumColumns); 545 assertEquals("3 key fix 5 L2 rows", 1, params.mNumRows); 546 assertEquals("3 key fix 5 L2 left", 1, params.mLeftKeys); 547 assertEquals("3 key fix 5 L2 right", 2, params.mRightKeys); 548 assertEquals("3 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 549 assertEquals("3 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 550 assertEquals("3 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 551 assertEquals("3 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 552 assertEquals("3 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 553 } 554 555 // [1] [2] <3>| 556 @Test testLayout3KeyFix5R0()557 public void testLayout3KeyFix5R0() { 558 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R0); 559 assertEquals("3 key fix 5 R0 columns", 3, params.mNumColumns); 560 assertEquals("3 key fix 5 R0 rows", 1, params.mNumRows); 561 assertEquals("3 key fix 5 R0 left", 2, params.mLeftKeys); 562 assertEquals("3 key fix 5 R0 right", 1, params.mRightKeys); 563 assertEquals("3 key fix 5 R0 [1]", -2, params.getColumnPos(0)); 564 assertEquals("3 key fix 5 R0 [2]", -1, params.getColumnPos(1)); 565 assertEquals("3 key fix 5 R0 <3>", 0, params.getColumnPos(2)); 566 assertEquals("3 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 567 assertEquals("3 key fix 5 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 568 } 569 570 // [1] [2] <3> ___| 571 @Test testLayout3KeyFix5R1()572 public void testLayout3KeyFix5R1() { 573 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R1); 574 assertEquals("3 key fix 5 R1 columns", 3, params.mNumColumns); 575 assertEquals("3 key fix 5 R1 rows", 1, params.mNumRows); 576 assertEquals("3 key fix 5 R1 left", 2, params.mLeftKeys); 577 assertEquals("3 key fix 5 R1 right", 1, params.mRightKeys); 578 assertEquals("3 key fix 5 R1 [1]", -2, params.getColumnPos(0)); 579 assertEquals("3 key fix 5 R1 [2]", -1, params.getColumnPos(1)); 580 assertEquals("3 key fix 5 R1 <3>", 0, params.getColumnPos(2)); 581 assertEquals("3 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 582 assertEquals("3 key fix 5 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 583 } 584 585 // [1] <2> [3] ___| 586 @Test testLayout3KeyFix5R2()587 public void testLayout3KeyFix5R2() { 588 MoreKeysKeyboardParams params = createParams(3, 5, XPOS_R2); 589 assertEquals("3 key fix 5 R2 columns", 3, params.mNumColumns); 590 assertEquals("3 key fix 5 R2 rows", 1, params.mNumRows); 591 assertEquals("3 key fix 5 R2 left", 1, params.mLeftKeys); 592 assertEquals("3 key fix 5 R2 right", 2, params.mRightKeys); 593 assertEquals("3 key fix 5 R2 [1]", -1, params.getColumnPos(0)); 594 assertEquals("3 key fix 5 R2 <2>", 0, params.getColumnPos(1)); 595 assertEquals("3 key fix 5 R2 [3]", 1, params.getColumnPos(2)); 596 assertEquals("3 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 597 assertEquals("3 key fix 5 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 598 } 599 600 // [4] 601 // [1] <2> [3] 602 @Test testLayout4KeyFix3M0()603 public void testLayout4KeyFix3M0() { 604 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_M0); 605 assertEquals("4 key fix 3 M0 columns", 3, params.mNumColumns); 606 assertEquals("4 key fix 3 M0 rows", 2, params.mNumRows); 607 assertEquals("4 key fix 3 M0 left", 1, params.mLeftKeys); 608 assertEquals("4 key fix 3 M0 right", 2, params.mRightKeys); 609 assertEquals("4 key fix 3 M0 [1]", -1, params.getColumnPos(0)); 610 assertEquals("4 key fix 3 M0 <2>", 0, params.getColumnPos(1)); 611 assertEquals("4 key fix 3 M0 [3]", 1, params.getColumnPos(2)); 612 assertEquals("4 key fix 3 M0 [4]", 0, params.getColumnPos(3)); 613 assertEquals("4 key fix 3 M0 adjust", 0, params.mTopRowAdjustment); 614 assertEquals("4 key fix 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 615 } 616 617 // |[4] 618 // |<1> [2] [3] 619 @Test testLayout4KeyFix3L0()620 public void testLayout4KeyFix3L0() { 621 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L0); 622 assertEquals("4 key fix 3 L0 columns", 3, params.mNumColumns); 623 assertEquals("4 key fix 3 L0 rows", 2, params.mNumRows); 624 assertEquals("4 key fix 3 L0 left", 0, params.mLeftKeys); 625 assertEquals("4 key fix 3 L0 right", 3, params.mRightKeys); 626 assertEquals("4 key fix 3 L0 <1>", 0, params.getColumnPos(0)); 627 assertEquals("4 key fix 3 L0 [2]", 1, params.getColumnPos(1)); 628 assertEquals("4 key fix 3 L0 [3]", 2, params.getColumnPos(2)); 629 assertEquals("4 key fix 3 L0 [4]", 0, params.getColumnPos(3)); 630 assertEquals("4 key fix 3 L0 adjust", 0, params.mTopRowAdjustment); 631 assertEquals("4 key fix 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 632 } 633 634 // |___ [4] 635 // |___ <1> [2] [3] 636 @Test testLayout4KeyFix3L1()637 public void testLayout4KeyFix3L1() { 638 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L1); 639 assertEquals("4 key fix 3 L1 columns", 3, params.mNumColumns); 640 assertEquals("4 key fix 3 L1 rows", 2, params.mNumRows); 641 assertEquals("4 key fix 3 L1 left", 0, params.mLeftKeys); 642 assertEquals("4 key fix 3 L1 right", 3, params.mRightKeys); 643 assertEquals("4 key fix 3 L1 <1>", 0, params.getColumnPos(0)); 644 assertEquals("4 key fix 3 L1 [2]", 1, params.getColumnPos(1)); 645 assertEquals("4 key fix 3 L1 [3]", 2, params.getColumnPos(2)); 646 assertEquals("4 key fix 3 L1 [4]", 0, params.getColumnPos(3)); 647 assertEquals("4 key fix 3 L1 adjust", 0, params.mTopRowAdjustment); 648 assertEquals("4 key fix 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 649 } 650 651 // |___ ___ [4] 652 // |___ ___ [1] <2> [3] 653 @Test testLayout4KeyFix3L2()654 public void testLayout4KeyFix3L2() { 655 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_L2); 656 assertEquals("4 key fix 3 L2 columns", 3, params.mNumColumns); 657 assertEquals("4 key fix 3 L2 rows", 2, params.mNumRows); 658 assertEquals("4 key fix 3 L2 left", 1, params.mLeftKeys); 659 assertEquals("4 key fix 3 L2 right", 2, params.mRightKeys); 660 assertEquals("4 key fix 3 L2 [1]", -1, params.getColumnPos(0)); 661 assertEquals("4 key fix 3 L2 <2>", 0, params.getColumnPos(1)); 662 assertEquals("4 key fix 3 L2 [3]", 1, params.getColumnPos(2)); 663 assertEquals("4 key fix 3 L2 [4]", 0, params.getColumnPos(3)); 664 assertEquals("4 key fix 3 L2 adjust", 0, params.mTopRowAdjustment); 665 assertEquals("4 key fix 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 666 } 667 668 // [4]| 669 // [1] [2] <3>| 670 @Test testLayout4KeyFix3R0()671 public void testLayout4KeyFix3R0() { 672 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R0); 673 assertEquals("4 key fix 3 R0 columns", 3, params.mNumColumns); 674 assertEquals("4 key fix 3 R0 rows", 2, params.mNumRows); 675 assertEquals("4 key fix 3 R0 left", 2, params.mLeftKeys); 676 assertEquals("4 key fix 3 R0 right", 1, params.mRightKeys); 677 assertEquals("4 key fix 3 R0 [1]", -2, params.getColumnPos(0)); 678 assertEquals("4 key fix 3 R0 [2]", -1, params.getColumnPos(1)); 679 assertEquals("4 key fix 3 R0 <3>", 0, params.getColumnPos(2)); 680 assertEquals("4 key fix 3 R0 [4]", 0, params.getColumnPos(3)); 681 assertEquals("4 key fix 3 R0 adjust", 0, params.mTopRowAdjustment); 682 assertEquals("4 key fix 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 683 } 684 685 // [4] ___| 686 // [1] [2] <3> ___| 687 @Test testLayout4KeyFix3R1()688 public void testLayout4KeyFix3R1() { 689 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R1); 690 assertEquals("4 key fix 3 R1 columns", 3, params.mNumColumns); 691 assertEquals("4 key fix 3 R1 rows", 2, params.mNumRows); 692 assertEquals("4 key fix 3 R1 left", 2, params.mLeftKeys); 693 assertEquals("4 key fix 3 R1 right", 1, params.mRightKeys); 694 assertEquals("4 key fix 3 R1 [1]", -2, params.getColumnPos(0)); 695 assertEquals("4 key fix 3 R1 [2]", -1, params.getColumnPos(1)); 696 assertEquals("4 key fix 3 R1 <3>", 0, params.getColumnPos(2)); 697 assertEquals("4 key fix 3 R1 [4]", 0, params.getColumnPos(3)); 698 assertEquals("4 key fix 3 R1 adjust", 0, params.mTopRowAdjustment); 699 assertEquals("4 key fix 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 700 } 701 702 // [4] ___| 703 // [1] <2> [3] ___| 704 @Test testLayout4KeyFix3R2()705 public void testLayout4KeyFix3R2() { 706 MoreKeysKeyboardParams params = createParams(4, 3, XPOS_R2); 707 assertEquals("4 key fix 3 R2 columns", 3, params.mNumColumns); 708 assertEquals("4 key fix 3 R2 rows", 2, params.mNumRows); 709 assertEquals("4 key fix 3 R2 left", 1, params.mLeftKeys); 710 assertEquals("4 key fix 3 R2 right", 2, params.mRightKeys); 711 assertEquals("4 key fix 3 R2 [1]", -1, params.getColumnPos(0)); 712 assertEquals("4 key fix 3 R2 <2>", 0, params.getColumnPos(1)); 713 assertEquals("4 key fix 3 R2 [3]", 1, params.getColumnPos(2)); 714 assertEquals("4 key fix 3 R2 [4]", 0, params.getColumnPos(3)); 715 assertEquals("4 key fix 3 R2 adjust", 0, params.mTopRowAdjustment); 716 assertEquals("4 key fix 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 717 } 718 719 // [4] [5] 720 // [1] <2> [3] 721 @Test testLayout5KeyFix3M0()722 public void testLayout5KeyFix3M0() { 723 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_M0); 724 assertEquals("5 key fix 3 M0 columns", 3, params.mNumColumns); 725 assertEquals("5 key fix 3 M0 rows", 2, params.mNumRows); 726 assertEquals("5 key fix 3 M0 left", 1, params.mLeftKeys); 727 assertEquals("5 key fix 3 M0 right", 2, params.mRightKeys); 728 assertEquals("5 key fix 3 M0 [1]", -1, params.getColumnPos(0)); 729 assertEquals("5 key fix 3 M0 <2>", 0, params.getColumnPos(1)); 730 assertEquals("5 key fix 3 M0 [3]", 1, params.getColumnPos(2)); 731 assertEquals("5 key fix 3 M0 [4]", 0, params.getColumnPos(3)); 732 assertEquals("5 key fix 3 M0 [5]", 1, params.getColumnPos(4)); 733 assertEquals("5 key fix 3 M0 adjust", -1, params.mTopRowAdjustment); 734 assertEquals("5 key fix 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 735 } 736 737 // |[4] [5] 738 // |<1> [2] [3] 739 @Test testLayout5KeyFix3L0()740 public void testLayout5KeyFix3L0() { 741 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L0); 742 assertEquals("5 key fix 3 L0 columns", 3, params.mNumColumns); 743 assertEquals("5 key fix 3 L0 rows", 2, params.mNumRows); 744 assertEquals("5 key fix 3 L0 left", 0, params.mLeftKeys); 745 assertEquals("5 key fix 3 L0 right", 3, params.mRightKeys); 746 assertEquals("5 key fix 3 L0 <1>", 0, params.getColumnPos(0)); 747 assertEquals("5 key fix 3 L0 [2]", 1, params.getColumnPos(1)); 748 assertEquals("5 key fix 3 L0 [3]", 2, params.getColumnPos(2)); 749 assertEquals("5 key fix 3 L0 [4]", 0, params.getColumnPos(3)); 750 assertEquals("5 key fix 3 L0 [5]", 1, params.getColumnPos(4)); 751 assertEquals("5 key fix 3 L0 adjust", 0, params.mTopRowAdjustment); 752 assertEquals("5 key fix 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 753 } 754 755 // |___ [4] [5] 756 // |___ <1> [2] [3] 757 @Test testLayout5KeyFix3L1()758 public void testLayout5KeyFix3L1() { 759 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L1); 760 assertEquals("5 key fix 3 L1 columns", 3, params.mNumColumns); 761 assertEquals("5 key fix 3 L1 rows", 2, params.mNumRows); 762 assertEquals("5 key fix 3 L1 left", 0, params.mLeftKeys); 763 assertEquals("5 key fix 3 L1 right", 3, params.mRightKeys); 764 assertEquals("5 key fix 3 L1 <1>", 0, params.getColumnPos(0)); 765 assertEquals("5 key fix 3 L1 [2]", 1, params.getColumnPos(1)); 766 assertEquals("5 key fix 3 L1 [3]", 2, params.getColumnPos(2)); 767 assertEquals("5 key fix 3 L1 [4]", 0, params.getColumnPos(3)); 768 assertEquals("5 key fix 3 L1 [5]", 1, params.getColumnPos(4)); 769 assertEquals("5 key fix 3 L1 adjust", 0, params.mTopRowAdjustment); 770 assertEquals("5 key fix 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 771 } 772 773 // |___ [4] [5] 774 // |___ [1] <2> [3] 775 @Test testLayout5KeyFix3L2()776 public void testLayout5KeyFix3L2() { 777 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_L2); 778 assertEquals("5 key fix 3 L2 columns", 3, params.mNumColumns); 779 assertEquals("5 key fix 3 L2 rows", 2, params.mNumRows); 780 assertEquals("5 key fix 3 L2 left", 1, params.mLeftKeys); 781 assertEquals("5 key fix 3 L2 right", 2, params.mRightKeys); 782 assertEquals("5 key fix 3 L2 [1]", -1, params.getColumnPos(0)); 783 assertEquals("5 key fix 3 L2 <2>", 0, params.getColumnPos(1)); 784 assertEquals("5 key fix 3 L2 [3]", 1, params.getColumnPos(2)); 785 assertEquals("5 key fix 3 L2 [4]", 0, params.getColumnPos(3)); 786 assertEquals("5 key fix 3 L2 [5]", 1, params.getColumnPos(4)); 787 assertEquals("5 key fix 3 L2 adjust", -1, params.mTopRowAdjustment); 788 assertEquals("5 key fix 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 789 } 790 791 // [4] [5]| 792 // [1] [2] <3>| 793 @Test testLayout5KeyFix3R0()794 public void testLayout5KeyFix3R0() { 795 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R0); 796 assertEquals("5 key fix 3 R0 columns", 3, params.mNumColumns); 797 assertEquals("5 key fix 3 R0 rows", 2, params.mNumRows); 798 assertEquals("5 key fix 3 R0 left", 2, params.mLeftKeys); 799 assertEquals("5 key fix 3 R0 right", 1, params.mRightKeys); 800 assertEquals("5 key fix 3 R0 [1]", -2, params.getColumnPos(0)); 801 assertEquals("5 key fix 3 R0 [2]", -1, params.getColumnPos(1)); 802 assertEquals("5 key fix 3 R0 <3>", 0, params.getColumnPos(2)); 803 assertEquals("5 key fix 3 R0 [4]", -1, params.getColumnPos(3)); 804 assertEquals("5 key fix 3 R0 [5]", 0, params.getColumnPos(4)); 805 assertEquals("5 key fix 3 R0 adjust", 0, params.mTopRowAdjustment); 806 assertEquals("5 key fix 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 807 } 808 809 // [4] [5] ___| 810 // [1] [2] <3> ___| 811 @Test testLayout5KeyFix3R1()812 public void testLayout5KeyFix3R1() { 813 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R1); 814 assertEquals("5 key fix 3 R1 columns", 3, params.mNumColumns); 815 assertEquals("5 key fix 3 R1 rows", 2, params.mNumRows); 816 assertEquals("5 key fix 3 R1 left", 2, params.mLeftKeys); 817 assertEquals("5 key fix 3 R1 right", 1, params.mRightKeys); 818 assertEquals("5 key fix 3 R1 [1]", -2, params.getColumnPos(0)); 819 assertEquals("5 key fix 3 R1 [2]", -1, params.getColumnPos(1)); 820 assertEquals("5 key fix 3 R1 <3>", 0, params.getColumnPos(2)); 821 assertEquals("5 key fix 3 R1 [4]", -1, params.getColumnPos(3)); 822 assertEquals("5 key fix 3 R1 [5]", 0, params.getColumnPos(4)); 823 assertEquals("5 key fix 3 R1 adjust", 0, params.mTopRowAdjustment); 824 assertEquals("5 key fix 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 825 } 826 827 // [4] [5] ___| 828 // [1] <2> [3] ___| 829 @Test testLayout5KeyFix3R2()830 public void testLayout5KeyFix3R2() { 831 MoreKeysKeyboardParams params = createParams(5, 3, XPOS_R2); 832 assertEquals("5 key fix 3 R2 columns", 3, params.mNumColumns); 833 assertEquals("5 key fix 3 R2 rows", 2, params.mNumRows); 834 assertEquals("5 key fix 3 R2 left", 1, params.mLeftKeys); 835 assertEquals("5 key fix 3 R2 right", 2, params.mRightKeys); 836 assertEquals("5 key fix 3 R2 [1]", -1, params.getColumnPos(0)); 837 assertEquals("5 key fix 3 R2 <2>", 0, params.getColumnPos(1)); 838 assertEquals("5 key fix 3 R2 [3]", 1, params.getColumnPos(2)); 839 assertEquals("5 key fix 3 R2 [4]", 0, params.getColumnPos(3)); 840 assertEquals("5 key fix 3 R2 [5]", 1, params.getColumnPos(4)); 841 assertEquals("5 key fix 3 R2 adjust", -1, params.mTopRowAdjustment); 842 assertEquals("5 key fix 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 843 } 844 845 // [4] [5] [6] 846 // [1] <2> [3] 847 @Test testLayout6KeyFix3M0()848 public void testLayout6KeyFix3M0() { 849 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_M0); 850 assertEquals("6 key fix 3 M0 columns", 3, params.mNumColumns); 851 assertEquals("6 key fix 3 M0 rows", 2, params.mNumRows); 852 assertEquals("6 key fix 3 M0 left", 1, params.mLeftKeys); 853 assertEquals("6 key fix 3 M0 right", 2, params.mRightKeys); 854 assertEquals("6 key fix 3 M0 [1]", -1, params.getColumnPos(0)); 855 assertEquals("6 key fix 3 M0 <2>", 0, params.getColumnPos(1)); 856 assertEquals("6 key fix 3 M0 [3]", 1, params.getColumnPos(2)); 857 assertEquals("6 key fix 3 M0 [4]", -1, params.getColumnPos(3)); 858 assertEquals("6 key fix 3 M0 [5]", 0, params.getColumnPos(4)); 859 assertEquals("6 key fix 3 M0 [6]", 1, params.getColumnPos(5)); 860 assertEquals("6 key fix 3 M0 adjust", 0, params.mTopRowAdjustment); 861 assertEquals("6 key fix 3 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 862 } 863 864 // |[4] [5] [6] 865 // |<1> [2] [3] 866 @Test testLayout6KeyFix3L0()867 public void testLayout6KeyFix3L0() { 868 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_L0); 869 assertEquals("6 key fix 3 L0 columns", 3, params.mNumColumns); 870 assertEquals("6 key fix 3 L0 rows", 2, params.mNumRows); 871 assertEquals("6 key fix 3 L0 left", 0, params.mLeftKeys); 872 assertEquals("6 key fix 3 L0 right", 3, params.mRightKeys); 873 assertEquals("6 key fix 3 L0 <1>", 0, params.getColumnPos(0)); 874 assertEquals("6 key fix 3 L0 [2]", 1, params.getColumnPos(1)); 875 assertEquals("6 key fix 3 L0 [3]", 2, params.getColumnPos(2)); 876 assertEquals("6 key fix 3 L0 [4]", 0, params.getColumnPos(3)); 877 assertEquals("6 key fix 3 L0 [5]", 1, params.getColumnPos(4)); 878 assertEquals("6 key fix 3 L0 [6]", 2, params.getColumnPos(5)); 879 assertEquals("6 key fix 3 L0 adjust", 0, params.mTopRowAdjustment); 880 assertEquals("6 key fix 3 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 881 } 882 883 // |___ [4] [5] [6] 884 // |___ <1> [2] [3] 885 @Test testLayout6KeyFix3L1()886 public void testLayout6KeyFix3L1() { 887 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_L1); 888 assertEquals("6 key fix 3 L1 columns", 3, params.mNumColumns); 889 assertEquals("6 key fix 3 L1 rows", 2, params.mNumRows); 890 assertEquals("6 key fix 3 L1 left", 0, params.mLeftKeys); 891 assertEquals("6 key fix 3 L1 right", 3, params.mRightKeys); 892 assertEquals("6 key fix 3 L1 <1>", 0, params.getColumnPos(0)); 893 assertEquals("6 key fix 3 L1 [2]", 1, params.getColumnPos(1)); 894 assertEquals("6 key fix 3 L1 [3]", 2, params.getColumnPos(2)); 895 assertEquals("6 key fix 3 L1 [4]", 0, params.getColumnPos(3)); 896 assertEquals("6 key fix 3 L1 [5]", 1, params.getColumnPos(4)); 897 assertEquals("6 key fix 3 L1 [6]", 2, params.getColumnPos(5)); 898 assertEquals("6 key fix 3 L1 adjust", 0, params.mTopRowAdjustment); 899 assertEquals("6 key fix 3 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 900 } 901 902 // |___ [4] [5] [6] 903 // |___ [1] <2> [3] 904 @Test testLayout6KeyFix3L2()905 public void testLayout6KeyFix3L2() { 906 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_L2); 907 assertEquals("6 key fix 3 L2 columns", 3, params.mNumColumns); 908 assertEquals("6 key fix 3 L2 rows", 2, params.mNumRows); 909 assertEquals("6 key fix 3 L2 left", 1, params.mLeftKeys); 910 assertEquals("6 key fix 3 L2 right", 2, params.mRightKeys); 911 assertEquals("6 key fix 3 L2 [1]", -1, params.getColumnPos(0)); 912 assertEquals("6 key fix 3 L2 <2>", 0, params.getColumnPos(1)); 913 assertEquals("6 key fix 3 L2 [3]", 1, params.getColumnPos(2)); 914 assertEquals("6 key fix 3 L2 [4]", -1, params.getColumnPos(3)); 915 assertEquals("6 key fix 3 L2 [5]", 0, params.getColumnPos(4)); 916 assertEquals("6 key fix 3 L2 [6]", 1, params.getColumnPos(5)); 917 assertEquals("6 key fix 3 L2 adjust", 0, params.mTopRowAdjustment); 918 assertEquals("6 key fix 3 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 919 } 920 921 // [4] [5] [6]| 922 // [1] [2] <3>| 923 @Test testLayout6KeyFix3R0()924 public void testLayout6KeyFix3R0() { 925 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_R0); 926 assertEquals("6 key fix 3 R0 columns", 3, params.mNumColumns); 927 assertEquals("6 key fix 3 R0 rows", 2, params.mNumRows); 928 assertEquals("6 key fix 3 R0 left", 2, params.mLeftKeys); 929 assertEquals("6 key fix 3 R0 right", 1, params.mRightKeys); 930 assertEquals("6 key fix 3 R0 [1]", -2, params.getColumnPos(0)); 931 assertEquals("6 key fix 3 R0 [2]", -1, params.getColumnPos(1)); 932 assertEquals("6 key fix 3 R0 <3>", 0, params.getColumnPos(2)); 933 assertEquals("6 key fix 3 R0 [4]", -2, params.getColumnPos(3)); 934 assertEquals("6 key fix 3 R0 [5]", -1, params.getColumnPos(4)); 935 assertEquals("6 key fix 3 R0 [6]", 0, params.getColumnPos(5)); 936 assertEquals("6 key fix 3 R0 adjust", 0, params.mTopRowAdjustment); 937 assertEquals("6 key fix 3 R0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 938 } 939 940 // [4] [5] [6] ___| 941 // [1] [2] <3> ___| 942 @Test testLayout6KeyFix3R1()943 public void testLayout6KeyFix3R1() { 944 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_R1); 945 assertEquals("6 key fix 3 R1 columns", 3, params.mNumColumns); 946 assertEquals("6 key fix 3 R1 rows", 2, params.mNumRows); 947 assertEquals("6 key fix 3 R1 left", 2, params.mLeftKeys); 948 assertEquals("6 key fix 3 R1 right", 1, params.mRightKeys); 949 assertEquals("6 key fix 3 R1 [1]", -2, params.getColumnPos(0)); 950 assertEquals("6 key fix 3 R1 [2]", -1, params.getColumnPos(1)); 951 assertEquals("6 key fix 3 R1 <3>", 0, params.getColumnPos(2)); 952 assertEquals("6 key fix 3 R1 [4]", -2, params.getColumnPos(3)); 953 assertEquals("6 key fix 3 R1 [5]", -1, params.getColumnPos(4)); 954 assertEquals("6 key fix 3 R1 [6]", 0, params.getColumnPos(5)); 955 assertEquals("6 key fix 3 R1 adjust", 0, params.mTopRowAdjustment); 956 assertEquals("6 key fix 3 R1 default", WIDTH * 2, params.getDefaultKeyCoordX()); 957 } 958 959 // [4] [5] [6] ___| 960 // [1] <2> [3] ___| 961 @Test testLayout6KeyFix3R2()962 public void testLayout6KeyFix3R2() { 963 MoreKeysKeyboardParams params = createParams(6, 3, XPOS_R2); 964 assertEquals("6 key fix 3 R2 columns", 3, params.mNumColumns); 965 assertEquals("6 key fix 3 R2 rows", 2, params.mNumRows); 966 assertEquals("6 key fix 3 R2 left", 1, params.mLeftKeys); 967 assertEquals("6 key fix 3 R2 right", 2, params.mRightKeys); 968 assertEquals("6 key fix 3 R2 [1]", -1, params.getColumnPos(0)); 969 assertEquals("6 key fix 3 R2 <2>", 0, params.getColumnPos(1)); 970 assertEquals("6 key fix 3 R2 [1]", 1, params.getColumnPos(2)); 971 assertEquals("6 key fix 3 R2 [4]", -1, params.getColumnPos(3)); 972 assertEquals("6 key fix 3 R2 [5]", 0, params.getColumnPos(4)); 973 assertEquals("6 key fix 3 R2 [6]", 1, params.getColumnPos(5)); 974 assertEquals("6 key fix 3 R2 adjust", 0, params.mTopRowAdjustment); 975 assertEquals("6 key fix 3 R2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 976 } 977 978 // <1> [2] [3] [4] 979 @Test testLayout4KeyFix5M0()980 public void testLayout4KeyFix5M0() { 981 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_M0); 982 assertEquals("4 key fix 5 columns", 4, params.mNumColumns); 983 assertEquals("4 key fix 5 rows", 1, params.mNumRows); 984 assertEquals("4 key fix 5 left", 1, params.mLeftKeys); 985 assertEquals("4 key fix 5 right", 3, params.mRightKeys); 986 assertEquals("4 key fix 5 <1>", -1, params.getColumnPos(0)); 987 assertEquals("4 key fix 5 [2]", 0, params.getColumnPos(1)); 988 assertEquals("4 key fix 5 [3]", 1, params.getColumnPos(2)); 989 assertEquals("4 key fix 5 [4]", 2, params.getColumnPos(3)); 990 assertEquals("4 key fix 5 adjust", 0, params.mTopRowAdjustment); 991 assertEquals("4 key fix 5 default", WIDTH * 1, params.getDefaultKeyCoordX()); 992 } 993 994 // |<1> [2] [3] [4] 995 @Test testLayout4KeyFix5L0()996 public void testLayout4KeyFix5L0() { 997 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L0); 998 assertEquals("4 key fix 5 L0 columns", 4, params.mNumColumns); 999 assertEquals("4 key fix 5 L0 rows", 1, params.mNumRows); 1000 assertEquals("4 key fix 5 L0 left", 0, params.mLeftKeys); 1001 assertEquals("4 key fix 5 L0 right", 4, params.mRightKeys); 1002 assertEquals("4 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1003 assertEquals("4 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1004 assertEquals("4 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1005 assertEquals("4 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1006 assertEquals("4 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1007 assertEquals("4 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1008 } 1009 1010 // |___ <1> [2] [3] [4] 1011 @Test testLayout4KeyFix5L1()1012 public void testLayout4KeyFix5L1() { 1013 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L1); 1014 assertEquals("4 key fix 5 L1 columns", 4, params.mNumColumns); 1015 assertEquals("4 key fix 5 L1 rows", 1, params.mNumRows); 1016 assertEquals("4 key fix 5 L1 left", 0, params.mLeftKeys); 1017 assertEquals("4 key fix 5 L1 right", 4, params.mRightKeys); 1018 assertEquals("4 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1019 assertEquals("4 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1020 assertEquals("4 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1021 assertEquals("4 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1022 assertEquals("4 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1023 assertEquals("4 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1024 } 1025 1026 // |___ [1] <2> [3] [4] 1027 @Test testLayout4KeyFix5L2()1028 public void testLayout4KeyFix5L2() { 1029 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_L2); 1030 assertEquals("4 key fix 5 L2 columns", 4, params.mNumColumns); 1031 assertEquals("4 key fix 5 L2 rows", 1, params.mNumRows); 1032 assertEquals("4 key fix 5 L2 left", 1, params.mLeftKeys); 1033 assertEquals("4 key fix 5 L2 right", 3, params.mRightKeys); 1034 assertEquals("4 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1035 assertEquals("4 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1036 assertEquals("4 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1037 assertEquals("4 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1038 assertEquals("4 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 1039 assertEquals("4 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1040 } 1041 1042 // [1] [2] [3] <4>| 1043 @Test testLayout4KeyFix5R0()1044 public void testLayout4KeyFix5R0() { 1045 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R0); 1046 assertEquals("4 key fix 5 R0 columns", 4, params.mNumColumns); 1047 assertEquals("4 key fix 5 R0 rows", 1, params.mNumRows); 1048 assertEquals("4 key fix 5 R0 left", 3, params.mLeftKeys); 1049 assertEquals("4 key fix 5 R0 right", 1, params.mRightKeys); 1050 assertEquals("4 key fix 5 R0 [1]", -3, params.getColumnPos(0)); 1051 assertEquals("4 key fix 5 R0 [2]", -2, params.getColumnPos(1)); 1052 assertEquals("4 key fix 5 R0 [3]", -1, params.getColumnPos(2)); 1053 assertEquals("4 key fix 5 R0 <4>", 0, params.getColumnPos(3)); 1054 assertEquals("4 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1055 assertEquals("4 key fix 5 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1056 } 1057 1058 // [1] [2] [3] <4> ___| 1059 @Test testLayout4KeyFix5R1()1060 public void testLayout4KeyFix5R1() { 1061 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R1); 1062 assertEquals("4 key fix 5 R1 columns", 4, params.mNumColumns); 1063 assertEquals("4 key fix 5 R1 rows", 1, params.mNumRows); 1064 assertEquals("4 key fix 5 R1 left", 3, params.mLeftKeys); 1065 assertEquals("4 key fix 5 R1 right", 1, params.mRightKeys); 1066 assertEquals("4 key fix 5 R1 [1]", -3, params.getColumnPos(0)); 1067 assertEquals("4 key fix 5 R1 [2]", -2, params.getColumnPos(1)); 1068 assertEquals("4 key fix 5 R1 [3]", -1, params.getColumnPos(2)); 1069 assertEquals("4 key fix 5 R1 <4>", 0, params.getColumnPos(3)); 1070 assertEquals("4 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1071 assertEquals("4 key fix 5 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1072 } 1073 1074 // [1] [2] <3> [4] ___| 1075 @Test testLayout4KeyFix5R2()1076 public void testLayout4KeyFix5R2() { 1077 MoreKeysKeyboardParams params = createParams(4, 5, XPOS_R2); 1078 assertEquals("4 key fix 5 R2 columns", 4, params.mNumColumns); 1079 assertEquals("4 key fix 5 R2 rows", 1, params.mNumRows); 1080 assertEquals("4 key fix 5 R2 left", 2, params.mLeftKeys); 1081 assertEquals("4 key fix 5 R2 right", 2, params.mRightKeys); 1082 assertEquals("4 key fix 5 R2 [1]", -2, params.getColumnPos(0)); 1083 assertEquals("4 key fix 5 R2 [2]", -1, params.getColumnPos(1)); 1084 assertEquals("4 key fix 5 R2 <3>", 0, params.getColumnPos(2)); 1085 assertEquals("4 key fix 5 R2 [4]", 1, params.getColumnPos(3)); 1086 assertEquals("4 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 1087 assertEquals("4 key fix 5 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1088 } 1089 1090 // [5] 1091 // [1] <2> [3] [4] 1092 @Test testLayout5KeyFix4M0()1093 public void testLayout5KeyFix4M0() { 1094 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_M0); 1095 assertEquals("5 key fix 4 M0 columns", 4, params.mNumColumns); 1096 assertEquals("5 key fix 4 M0 rows", 2, params.mNumRows); 1097 assertEquals("5 key fix 4 M0 left", 1, params.mLeftKeys); 1098 assertEquals("5 key fix 4 M0 right", 3, params.mRightKeys); 1099 assertEquals("5 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1100 assertEquals("5 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1101 assertEquals("5 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1102 assertEquals("5 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1103 assertEquals("5 key fix 4 M0 [5]", 0, params.getColumnPos(4)); 1104 assertEquals("5 key fix 4 M0 adjust", 0, params.mTopRowAdjustment); 1105 assertEquals("5 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1106 } 1107 1108 // |[5] 1109 // |<1> [2] [3] [4] 1110 @Test testLayout5KeyFix4L0()1111 public void testLayout5KeyFix4L0() { 1112 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L0); 1113 assertEquals("5 key fix 4 L0 columns", 4, params.mNumColumns); 1114 assertEquals("5 key fix 4 L0 rows", 2, params.mNumRows); 1115 assertEquals("5 key fix 4 L0 left", 0, params.mLeftKeys); 1116 assertEquals("5 key fix 4 L0 right", 4, params.mRightKeys); 1117 assertEquals("5 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1118 assertEquals("5 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1119 assertEquals("5 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1120 assertEquals("5 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1121 assertEquals("5 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1122 assertEquals("5 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1123 assertEquals("5 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1124 } 1125 1126 // |___ [5] 1127 // |___ <1> [2] [3] [4] 1128 @Test testLayout5KeyFix4L1()1129 public void testLayout5KeyFix4L1() { 1130 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L1); 1131 assertEquals("5 key fix 4 L1 columns", 4, params.mNumColumns); 1132 assertEquals("5 key fix 4 L1 rows", 2, params.mNumRows); 1133 assertEquals("5 key fix 4 L1 left", 0, params.mLeftKeys); 1134 assertEquals("5 key fix 4 L1 right", 4, params.mRightKeys); 1135 assertEquals("5 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1136 assertEquals("5 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1137 assertEquals("5 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1138 assertEquals("5 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1139 assertEquals("5 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1140 assertEquals("5 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1141 assertEquals("5 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1142 } 1143 1144 // |___ [5] 1145 // |___ [1] <2> [3] [4] 1146 @Test testLayout5KeyFix4L2()1147 public void testLayout5KeyFix4L2() { 1148 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_L2); 1149 assertEquals("5 key fix 4 L2 columns", 4, params.mNumColumns); 1150 assertEquals("5 key fix 4 L2 rows", 2, params.mNumRows); 1151 assertEquals("5 key fix 4 L2 left", 1, params.mLeftKeys); 1152 assertEquals("5 key fix 4 L2 right", 3, params.mRightKeys); 1153 assertEquals("5 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1154 assertEquals("5 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1155 assertEquals("5 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1156 assertEquals("5 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1157 assertEquals("5 key fix 4 L2 [5]", 0, params.getColumnPos(4)); 1158 assertEquals("5 key fix 4 L2 adjust", 0, params.mTopRowAdjustment); 1159 assertEquals("5 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1160 } 1161 1162 // [5]| 1163 // [1] [2] [3] <4>| 1164 @Test testLayout5KeyFix4R0()1165 public void testLayout5KeyFix4R0() { 1166 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R0); 1167 assertEquals("5 key fix 4 R0 columns", 4, params.mNumColumns); 1168 assertEquals("5 key fix 4 R0 rows", 2, params.mNumRows); 1169 assertEquals("5 key fix 4 R0 left", 3, params.mLeftKeys); 1170 assertEquals("5 key fix 4 R0 right", 1, params.mRightKeys); 1171 assertEquals("5 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1172 assertEquals("5 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1173 assertEquals("5 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1174 assertEquals("5 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1175 assertEquals("5 key fix 4 R0 [5]", 0, params.getColumnPos(4)); 1176 assertEquals("5 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1177 assertEquals("5 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1178 } 1179 1180 // [5] ___| 1181 // [1] [2] [3] <4> ___| 1182 @Test testLayout5KeyFix4R1()1183 public void testLayout5KeyFix4R1() { 1184 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R1); 1185 assertEquals("5 key fix 4 R1 columns", 4, params.mNumColumns); 1186 assertEquals("5 key fix 4 R1 rows", 2, params.mNumRows); 1187 assertEquals("5 key fix 4 R1 left", 3, params.mLeftKeys); 1188 assertEquals("5 key fix 4 R1 right", 1, params.mRightKeys); 1189 assertEquals("5 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1190 assertEquals("5 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1191 assertEquals("5 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1192 assertEquals("5 key fix 4 R1 [4]", 0, params.getColumnPos(3)); 1193 assertEquals("5 key fix 4 R1 [5]", 0, params.getColumnPos(4)); 1194 assertEquals("5 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1195 assertEquals("5 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1196 } 1197 1198 // [5] ___| 1199 // [1] [2] <3> [4] ___| 1200 @Test testLayout5KeyFix4R2()1201 public void testLayout5KeyFix4R2() { 1202 MoreKeysKeyboardParams params = createParams(5, 4, XPOS_R2); 1203 assertEquals("5 key fix 4 R2 columns", 4, params.mNumColumns); 1204 assertEquals("5 key fix 4 R2 rows", 2, params.mNumRows); 1205 assertEquals("5 key fix 4 R2 left", 2, params.mLeftKeys); 1206 assertEquals("5 key fix 4 R2 right", 2, params.mRightKeys); 1207 assertEquals("5 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1208 assertEquals("5 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1209 assertEquals("5 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1210 assertEquals("5 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1211 assertEquals("5 key fix 4 R2 [5]", 0, params.getColumnPos(4)); 1212 assertEquals("5 key fix 4 R2 adjust", 0, params.mTopRowAdjustment); 1213 assertEquals("5 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1214 } 1215 1216 // [5] [6] 1217 // [1] <2> [3] [4] 1218 @Test testLayout6KeyFix4M0()1219 public void testLayout6KeyFix4M0() { 1220 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_M0); 1221 assertEquals("6 key fix 4 M0 columns", 4, params.mNumColumns); 1222 assertEquals("6 key fix 4 M0 rows", 2, params.mNumRows); 1223 assertEquals("6 key fix 4 M0 left", 1, params.mLeftKeys); 1224 assertEquals("6 key fix 4 M0 right", 3, params.mRightKeys); 1225 assertEquals("6 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1226 assertEquals("6 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1227 assertEquals("6 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1228 assertEquals("6 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1229 assertEquals("6 key fix 4 M0 [5]", 0, params.getColumnPos(4)); 1230 assertEquals("6 key fix 4 M0 [6]", 1, params.getColumnPos(5)); 1231 assertEquals("6 key fix 4 M0 adjust", -1, params.mTopRowAdjustment); 1232 assertEquals("6 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1233 } 1234 1235 // |[5] [6] 1236 // |<1> [2] [3] [4] 1237 @Test testLayout6KeyFix4L0()1238 public void testLayout6KeyFix4L0() { 1239 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L0); 1240 assertEquals("6 key fix 4 L0 columns", 4, params.mNumColumns); 1241 assertEquals("6 key fix 4 L0 rows", 2, params.mNumRows); 1242 assertEquals("6 key fix 4 L0 left", 0, params.mLeftKeys); 1243 assertEquals("6 key fix 4 L0 right", 4, params.mRightKeys); 1244 assertEquals("6 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1245 assertEquals("6 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1246 assertEquals("6 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1247 assertEquals("6 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1248 assertEquals("6 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1249 assertEquals("6 key fix 4 L0 [6]", 1, params.getColumnPos(5)); 1250 assertEquals("6 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1251 assertEquals("6 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1252 } 1253 1254 // |___ [5] [6] 1255 // |___ <1> [2] [3] [4] 1256 @Test testLayout6KeyFix4L1()1257 public void testLayout6KeyFix4L1() { 1258 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L1); 1259 assertEquals("6 key fix 4 L1 columns", 4, params.mNumColumns); 1260 assertEquals("6 key fix 4 L1 rows", 2, params.mNumRows); 1261 assertEquals("6 key fix 4 L1 left", 0, params.mLeftKeys); 1262 assertEquals("6 key fix 4 L1 right", 4, params.mRightKeys); 1263 assertEquals("6 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1264 assertEquals("6 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1265 assertEquals("6 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1266 assertEquals("6 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1267 assertEquals("6 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1268 assertEquals("6 key fix 4 L1 [6]", 1, params.getColumnPos(5)); 1269 assertEquals("6 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1270 assertEquals("6 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1271 } 1272 1273 // |___ [5] [6] 1274 // |___ [1] <2> [3] [4] 1275 @Test testLayout6KeyFix4L2()1276 public void testLayout6KeyFix4L2() { 1277 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_L2); 1278 assertEquals("6 key fix 4 L2 columns", 4, params.mNumColumns); 1279 assertEquals("6 key fix 4 L2 rows", 2, params.mNumRows); 1280 assertEquals("6 key fix 4 L2 left", 1, params.mLeftKeys); 1281 assertEquals("6 key fix 4 L2 right", 3, params.mRightKeys); 1282 assertEquals("6 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1283 assertEquals("6 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1284 assertEquals("6 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1285 assertEquals("6 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1286 assertEquals("6 key fix 4 L2 [5]", 0, params.getColumnPos(4)); 1287 assertEquals("6 key fix 4 L2 [6]", 1, params.getColumnPos(5)); 1288 assertEquals("6 key fix 4 L2 adjust", -1, params.mTopRowAdjustment); 1289 assertEquals("6 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1290 } 1291 1292 // [5] [6]| 1293 // [1] [2] [3] <4>| 1294 @Test testLayout6KeyFix4R0()1295 public void testLayout6KeyFix4R0() { 1296 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R0); 1297 assertEquals("6 key fix 4 R0 columns", 4, params.mNumColumns); 1298 assertEquals("6 key fix 4 R0 rows", 2, params.mNumRows); 1299 assertEquals("6 key fix 4 R0 left", 3, params.mLeftKeys); 1300 assertEquals("6 key fix 4 R0 right", 1, params.mRightKeys); 1301 assertEquals("6 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1302 assertEquals("6 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1303 assertEquals("6 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1304 assertEquals("6 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1305 assertEquals("6 key fix 4 R0 [5]", -1, params.getColumnPos(4)); 1306 assertEquals("6 key fix 4 R0 [6]", 0, params.getColumnPos(5)); 1307 assertEquals("6 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1308 assertEquals("6 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1309 } 1310 1311 // [5] [6] ___| 1312 // [1] [2] [3] <4> ___| 1313 @Test testLayout6KeyFix4R1()1314 public void testLayout6KeyFix4R1() { 1315 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R1); 1316 assertEquals("6 key fix 4 R1 columns", 4, params.mNumColumns); 1317 assertEquals("6 key fix 4 R1 rows", 2, params.mNumRows); 1318 assertEquals("6 key fix 4 R1 left", 3, params.mLeftKeys); 1319 assertEquals("6 key fix 4 R1 right", 1, params.mRightKeys); 1320 assertEquals("6 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1321 assertEquals("6 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1322 assertEquals("6 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1323 assertEquals("6 key fix 4 R1 [4]", 0, params.getColumnPos(3)); 1324 assertEquals("6 key fix 4 R1 [5]", -1, params.getColumnPos(4)); 1325 assertEquals("6 key fix 4 R1 [6]", 0, params.getColumnPos(5)); 1326 assertEquals("6 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1327 assertEquals("6 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1328 } 1329 1330 // [5] [6] ___| 1331 // [1] [2] <3> [4] ___| 1332 @Test testLayout6KeyFix4R2()1333 public void testLayout6KeyFix4R2() { 1334 MoreKeysKeyboardParams params = createParams(6, 4, XPOS_R2); 1335 assertEquals("6 key fix 4 R2 columns", 4, params.mNumColumns); 1336 assertEquals("6 key fix 4 R2 rows", 2, params.mNumRows); 1337 assertEquals("6 key fix 4 R2 left", 2, params.mLeftKeys); 1338 assertEquals("6 key fix 4 R2 right", 2, params.mRightKeys); 1339 assertEquals("6 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1340 assertEquals("6 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1341 assertEquals("6 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1342 assertEquals("6 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1343 assertEquals("6 key fix 4 R2 [5]", 0, params.getColumnPos(4)); 1344 assertEquals("6 key fix 4 R2 [6]", 1, params.getColumnPos(5)); 1345 assertEquals("6 key fix 4 R2 adjust", -1, params.mTopRowAdjustment); 1346 assertEquals("6 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1347 } 1348 1349 // [5] [6] [7] 1350 // [1] <2> [3] [4] 1351 @Test testLayout7KeyFix4M0()1352 public void testLayout7KeyFix4M0() { 1353 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_M0); 1354 assertEquals("7 key fix 4 M0 columns", 4, params.mNumColumns); 1355 assertEquals("7 key fix 4 M0 rows", 2, params.mNumRows); 1356 assertEquals("7 key fix 4 M0 left", 1, params.mLeftKeys); 1357 assertEquals("7 key fix 4 M0 right", 3, params.mRightKeys); 1358 assertEquals("7 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1359 assertEquals("7 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1360 assertEquals("7 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1361 assertEquals("7 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1362 assertEquals("7 key fix 4 M0 [5]", -1, params.getColumnPos(4)); 1363 assertEquals("7 key fix 4 M0 [6]", 0, params.getColumnPos(5)); 1364 assertEquals("7 key fix 4 M0 [7]", 1, params.getColumnPos(6)); 1365 assertEquals("7 key fix 4 M0 adjust", 0, params.mTopRowAdjustment); 1366 assertEquals("7 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1367 } 1368 1369 // |[5] [6] [7] 1370 // |<1> [2] [3] [4] 1371 @Test testLayout7KeyFix4L0()1372 public void testLayout7KeyFix4L0() { 1373 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_L0); 1374 assertEquals("7 key fix 4 L0 columns", 4, params.mNumColumns); 1375 assertEquals("7 key fix 4 L0 rows", 2, params.mNumRows); 1376 assertEquals("7 key fix 4 L0 left", 0, params.mLeftKeys); 1377 assertEquals("7 key fix 4 L0 right", 4, params.mRightKeys); 1378 assertEquals("7 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1379 assertEquals("7 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1380 assertEquals("7 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1381 assertEquals("7 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1382 assertEquals("7 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1383 assertEquals("7 key fix 4 L0 [6]", 1, params.getColumnPos(5)); 1384 assertEquals("7 key fix 4 L0 [7]", 2, params.getColumnPos(6)); 1385 assertEquals("7 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1386 assertEquals("7 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1387 } 1388 1389 // |___ [5] [6] [7] 1390 // |___ <1> [2] [3] [4] 1391 @Test testLayout7KeyFix4L1()1392 public void testLayout7KeyFix4L1() { 1393 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_L1); 1394 assertEquals("7 key fix 4 L1 columns", 4, params.mNumColumns); 1395 assertEquals("7 key fix 4 L1 rows", 2, params.mNumRows); 1396 assertEquals("7 key fix 4 L1 left", 0, params.mLeftKeys); 1397 assertEquals("7 key fix 4 L1 right", 4, params.mRightKeys); 1398 assertEquals("7 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1399 assertEquals("7 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1400 assertEquals("7 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1401 assertEquals("7 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1402 assertEquals("7 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1403 assertEquals("7 key fix 4 L1 [6]", 1, params.getColumnPos(5)); 1404 assertEquals("7 key fix 4 l1 [7]", 2, params.getColumnPos(6)); 1405 assertEquals("7 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1406 assertEquals("7 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1407 } 1408 1409 // |___ [5] [6] [7] 1410 // |___ [1] <2> [3] [4] 1411 @Test testLayout7KeyFix4L2()1412 public void testLayout7KeyFix4L2() { 1413 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_L2); 1414 assertEquals("7 key fix 4 L2 columns", 4, params.mNumColumns); 1415 assertEquals("7 key fix 4 L2 rows", 2, params.mNumRows); 1416 assertEquals("7 key fix 4 L2 left", 1, params.mLeftKeys); 1417 assertEquals("7 key fix 4 L2 right", 3, params.mRightKeys); 1418 assertEquals("7 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1419 assertEquals("7 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1420 assertEquals("7 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1421 assertEquals("7 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1422 assertEquals("7 key fix 4 L2 [5]", -1, params.getColumnPos(4)); 1423 assertEquals("7 key fix 4 L2 [6]", 0, params.getColumnPos(5)); 1424 assertEquals("7 key fix 4 L2 [7]", 1, params.getColumnPos(6)); 1425 assertEquals("7 key fix 4 L2 adjust", 0, params.mTopRowAdjustment); 1426 assertEquals("7 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1427 } 1428 1429 // [5] [6] [7]| 1430 // [1] [2] [3] <4>| 1431 @Test testLayout7KeyFix4R0()1432 public void testLayout7KeyFix4R0() { 1433 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_R0); 1434 assertEquals("7 key fix 4 R0 columns", 4, params.mNumColumns); 1435 assertEquals("7 key fix 4 R0 rows", 2, params.mNumRows); 1436 assertEquals("7 key fix 4 R0 left", 3, params.mLeftKeys); 1437 assertEquals("7 key fix 4 R0 right", 1, params.mRightKeys); 1438 assertEquals("7 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1439 assertEquals("7 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1440 assertEquals("7 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1441 assertEquals("7 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1442 assertEquals("7 key fix 4 R0 [5]", -2, params.getColumnPos(4)); 1443 assertEquals("7 key fix 4 R0 [6]", -1, params.getColumnPos(5)); 1444 assertEquals("7 key fix 4 R0 [7]", 0, params.getColumnPos(6)); 1445 assertEquals("7 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1446 assertEquals("7 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1447 } 1448 1449 // [5] [6] [7] ___| 1450 // [1] [2] [3] <4> ___| 1451 @Test testLayout7KeyFix4R1()1452 public void testLayout7KeyFix4R1() { 1453 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_R1); 1454 assertEquals("7 key fix 4 R1 columns", 4, params.mNumColumns); 1455 assertEquals("7 key fix 4 R1 rows", 2, params.mNumRows); 1456 assertEquals("7 key fix 4 R1 left", 3, params.mLeftKeys); 1457 assertEquals("7 key fix 4 R1 right", 1, params.mRightKeys); 1458 assertEquals("7 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1459 assertEquals("7 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1460 assertEquals("7 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1461 assertEquals("7 key fix 4 R1 <4>", 0, params.getColumnPos(3)); 1462 assertEquals("7 key fix 4 R1 [5]", -2, params.getColumnPos(4)); 1463 assertEquals("7 key fix 4 R1 [6]", -1, params.getColumnPos(5)); 1464 assertEquals("7 key fix 4 R1 [7]", 0, params.getColumnPos(6)); 1465 assertEquals("7 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1466 assertEquals("7 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1467 } 1468 1469 // [5] [6] [7] ___| 1470 // [1] [2] <3> [4] ___| 1471 @Test testLayout7KeyFix4R2()1472 public void testLayout7KeyFix4R2() { 1473 MoreKeysKeyboardParams params = createParams(7, 4, XPOS_R2); 1474 assertEquals("7 key fix 4 R2 columns", 4, params.mNumColumns); 1475 assertEquals("7 key fix 4 R2 rows", 2, params.mNumRows); 1476 assertEquals("7 key fix 4 R2 left", 2, params.mLeftKeys); 1477 assertEquals("7 key fix 4 R2 right", 2, params.mRightKeys); 1478 assertEquals("7 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1479 assertEquals("7 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1480 assertEquals("7 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1481 assertEquals("7 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1482 assertEquals("7 key fix 4 R2 [5]", -1, params.getColumnPos(4)); 1483 assertEquals("7 key fix 4 R2 [6]", 0, params.getColumnPos(5)); 1484 assertEquals("7 key fix 4 R2 [7]", 1, params.getColumnPos(6)); 1485 assertEquals("7 key fix 4 R2 adjust", 0, params.mTopRowAdjustment); 1486 assertEquals("7 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1487 } 1488 1489 // [5] [6] [7] [8] 1490 // [1] <2> [3] [4] 1491 @Test testLayout8KeyFix4M0()1492 public void testLayout8KeyFix4M0() { 1493 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_M0); 1494 assertEquals("8 key fix 4 M0 columns", 4, params.mNumColumns); 1495 assertEquals("8 key fix 4 M0 rows", 2, params.mNumRows); 1496 assertEquals("8 key fix 4 M0 left", 1, params.mLeftKeys); 1497 assertEquals("8 key fix 4 M0 right", 3, params.mRightKeys); 1498 assertEquals("8 key fix 4 M0 [1]", -1, params.getColumnPos(0)); 1499 assertEquals("8 key fix 4 M0 <2>", 0, params.getColumnPos(1)); 1500 assertEquals("8 key fix 4 M0 [3]", 1, params.getColumnPos(2)); 1501 assertEquals("8 key fix 4 M0 [4]", 2, params.getColumnPos(3)); 1502 assertEquals("8 key fix 4 M0 [5]", -1, params.getColumnPos(4)); 1503 assertEquals("8 key fix 4 M0 [6]", 0, params.getColumnPos(5)); 1504 assertEquals("8 key fix 4 M0 [7]", 1, params.getColumnPos(6)); 1505 assertEquals("8 key fix 4 M0 [8]", 2, params.getColumnPos(7)); 1506 assertEquals("8 key fix 4 M0 adjust", 0, params.mTopRowAdjustment); 1507 assertEquals("8 key fix 4 M0 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1508 } 1509 1510 // |[5] [6] [7] [8] 1511 // |<1> [2] [3] [4] 1512 @Test testLayout8KeyFix4L0()1513 public void testLayout8KeyFix4L0() { 1514 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_L0); 1515 assertEquals("8 key fix 4 L0 columns", 4, params.mNumColumns); 1516 assertEquals("8 key fix 4 L0 rows", 2, params.mNumRows); 1517 assertEquals("8 key fix 4 L0 left", 0, params.mLeftKeys); 1518 assertEquals("8 key fix 4 L0 right", 4, params.mRightKeys); 1519 assertEquals("8 key fix 4 L0 <1>", 0, params.getColumnPos(0)); 1520 assertEquals("8 key fix 4 L0 [2]", 1, params.getColumnPos(1)); 1521 assertEquals("8 key fix 4 L0 [3]", 2, params.getColumnPos(2)); 1522 assertEquals("8 key fix 4 L0 [4]", 3, params.getColumnPos(3)); 1523 assertEquals("8 key fix 4 L0 [5]", 0, params.getColumnPos(4)); 1524 assertEquals("8 key fix 4 L0 [6]", 1, params.getColumnPos(5)); 1525 assertEquals("8 key fix 4 L0 [7]", 2, params.getColumnPos(6)); 1526 assertEquals("8 key fix 4 L0 [8]", 3, params.getColumnPos(7)); 1527 assertEquals("8 key fix 4 L0 adjust", 0, params.mTopRowAdjustment); 1528 assertEquals("8 key fix 4 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1529 } 1530 1531 // |___ [5] [6] [7] [8] 1532 // |___ <1> [2] [3] [4] 1533 @Test testLayout8KeyFix4L1()1534 public void testLayout8KeyFix4L1() { 1535 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_L1); 1536 assertEquals("8 key fix 4 L1 columns", 4, params.mNumColumns); 1537 assertEquals("8 key fix 4 L1 rows", 2, params.mNumRows); 1538 assertEquals("8 key fix 4 L1 left", 0, params.mLeftKeys); 1539 assertEquals("8 key fix 4 L1 right", 4, params.mRightKeys); 1540 assertEquals("8 key fix 4 L1 <1>", 0, params.getColumnPos(0)); 1541 assertEquals("8 key fix 4 L1 [2]", 1, params.getColumnPos(1)); 1542 assertEquals("8 key fix 4 L1 [3]", 2, params.getColumnPos(2)); 1543 assertEquals("8 key fix 4 L1 [4]", 3, params.getColumnPos(3)); 1544 assertEquals("8 key fix 4 L1 [5]", 0, params.getColumnPos(4)); 1545 assertEquals("8 key fix 4 L1 [6]", 1, params.getColumnPos(5)); 1546 assertEquals("8 key fix 4 L1 [7]", 2, params.getColumnPos(6)); 1547 assertEquals("8 key fix 4 L1 [8]", 3, params.getColumnPos(7)); 1548 assertEquals("8 key fix 4 L1 adjust", 0, params.mTopRowAdjustment); 1549 assertEquals("8 key fix 4 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1550 } 1551 1552 // |___ [5] [6] [7] [8] 1553 // |___ [1] <2> [3] [4] 1554 @Test testLayout8KeyFix4L2()1555 public void testLayout8KeyFix4L2() { 1556 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_L2); 1557 assertEquals("8 key fix 4 L2 columns", 4, params.mNumColumns); 1558 assertEquals("8 key fix 4 L2 rows", 2, params.mNumRows); 1559 assertEquals("8 key fix 4 L2 left", 1, params.mLeftKeys); 1560 assertEquals("8 key fix 4 L2 right", 3, params.mRightKeys); 1561 assertEquals("8 key fix 4 L2 [1]", -1, params.getColumnPos(0)); 1562 assertEquals("8 key fix 4 L2 <2>", 0, params.getColumnPos(1)); 1563 assertEquals("8 key fix 4 L2 [3]", 1, params.getColumnPos(2)); 1564 assertEquals("8 key fix 4 L2 [4]", 2, params.getColumnPos(3)); 1565 assertEquals("8 key fix 4 L2 [5]", -1, params.getColumnPos(4)); 1566 assertEquals("8 key fix 4 L2 [6]", 0, params.getColumnPos(5)); 1567 assertEquals("8 key fix 4 L2 [7]", 1, params.getColumnPos(6)); 1568 assertEquals("8 key fix 4 L2 [8]", 2, params.getColumnPos(7)); 1569 assertEquals("8 key fix 4 L2 adjust", 0, params.mTopRowAdjustment); 1570 assertEquals("8 key fix 4 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1571 } 1572 1573 // [5] [6] [7] [8]| 1574 // [1] [2] [3] <4>| 1575 @Test testLayout8KeyFix4R0()1576 public void testLayout8KeyFix4R0() { 1577 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_R0); 1578 assertEquals("8 key fix 4 R0 columns", 4, params.mNumColumns); 1579 assertEquals("8 key fix 4 R0 rows", 2, params.mNumRows); 1580 assertEquals("8 key fix 4 R0 left", 3, params.mLeftKeys); 1581 assertEquals("8 key fix 4 R0 right", 1, params.mRightKeys); 1582 assertEquals("8 key fix 4 R0 [1]", -3, params.getColumnPos(0)); 1583 assertEquals("8 key fix 4 R0 [2]", -2, params.getColumnPos(1)); 1584 assertEquals("8 key fix 4 R0 [3]", -1, params.getColumnPos(2)); 1585 assertEquals("8 key fix 4 R0 <4>", 0, params.getColumnPos(3)); 1586 assertEquals("8 key fix 4 R0 [5]", -3, params.getColumnPos(4)); 1587 assertEquals("8 key fix 4 R0 [6]", -2, params.getColumnPos(5)); 1588 assertEquals("8 key fix 4 R0 [7]", -1, params.getColumnPos(6)); 1589 assertEquals("8 key fix 4 R0 [8]", 0, params.getColumnPos(7)); 1590 assertEquals("8 key fix 4 R0 adjust", 0, params.mTopRowAdjustment); 1591 assertEquals("8 key fix 4 R0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1592 } 1593 1594 // [5] [6] [7] [8] ___| 1595 // [1] [2] [3] <4> ___| 1596 @Test testLayout8KeyFix4R1()1597 public void testLayout8KeyFix4R1() { 1598 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_R1); 1599 assertEquals("8 key fix 4 R1 columns", 4, params.mNumColumns); 1600 assertEquals("8 key fix 4 R1 rows", 2, params.mNumRows); 1601 assertEquals("8 key fix 4 R1 left", 3, params.mLeftKeys); 1602 assertEquals("8 key fix 4 R1 right", 1, params.mRightKeys); 1603 assertEquals("8 key fix 4 R1 [1]", -3, params.getColumnPos(0)); 1604 assertEquals("8 key fix 4 R1 [2]", -2, params.getColumnPos(1)); 1605 assertEquals("8 key fix 4 R1 [3]", -1, params.getColumnPos(2)); 1606 assertEquals("8 key fix 4 R1 <4>", 0, params.getColumnPos(3)); 1607 assertEquals("8 key fix 4 R1 [5]", -3, params.getColumnPos(4)); 1608 assertEquals("8 key fix 4 R1 [6]", -2, params.getColumnPos(5)); 1609 assertEquals("8 key fix 4 R1 [7]", -1, params.getColumnPos(6)); 1610 assertEquals("8 key fix 4 R1 [8]", 0, params.getColumnPos(7)); 1611 assertEquals("8 key fix 4 R1 adjust", 0, params.mTopRowAdjustment); 1612 assertEquals("8 key fix 4 R1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1613 } 1614 1615 // [5] [6] [7] [8] ___| 1616 // [1] [2] <3> [4] ___| 1617 @Test testLayout8KeyFix4R2()1618 public void testLayout8KeyFix4R2() { 1619 MoreKeysKeyboardParams params = createParams(8, 4, XPOS_R2); 1620 assertEquals("8 key fix 4 R2 columns", 4, params.mNumColumns); 1621 assertEquals("8 key fix 4 R2 rows", 2, params.mNumRows); 1622 assertEquals("8 key fix 4 R2 left", 2, params.mLeftKeys); 1623 assertEquals("8 key fix 4 R2 right", 2, params.mRightKeys); 1624 assertEquals("8 key fix 4 R2 [1]", -2, params.getColumnPos(0)); 1625 assertEquals("8 key fix 4 R2 [2]", -1, params.getColumnPos(1)); 1626 assertEquals("8 key fix 4 R2 <3>", 0, params.getColumnPos(2)); 1627 assertEquals("8 key fix 4 R2 [4]", 1, params.getColumnPos(3)); 1628 assertEquals("8 key fix 4 R2 [5]", -2, params.getColumnPos(4)); 1629 assertEquals("8 key fix 4 R2 [6]", -1, params.getColumnPos(5)); 1630 assertEquals("8 key fix 4 R2 [7]", 0, params.getColumnPos(6)); 1631 assertEquals("8 key fix 4 R2 [8]", 1, params.getColumnPos(7)); 1632 assertEquals("8 key fix 4 R2 adjust", 0, params.mTopRowAdjustment); 1633 assertEquals("8 key fix 4 R2 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1634 } 1635 1636 // [1] [2] <3> [4] [5] 1637 @Test testLayout5KeyFix5M0()1638 public void testLayout5KeyFix5M0() { 1639 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_M0); 1640 assertEquals("5 key fix 5 columns", 5, params.mNumColumns); 1641 assertEquals("5 key fix 5 rows", 1, params.mNumRows); 1642 assertEquals("5 key fix 5 left", 2, params.mLeftKeys); 1643 assertEquals("5 key fix 5 right", 3, params.mRightKeys); 1644 assertEquals("5 key fix 5 [1]", -2, params.getColumnPos(0)); 1645 assertEquals("5 key fix 5 [2]", -1, params.getColumnPos(1)); 1646 assertEquals("5 key fix 5 <3>", 0, params.getColumnPos(2)); 1647 assertEquals("5 key fix 5 [4]", 1, params.getColumnPos(3)); 1648 assertEquals("5 key fix 5 [5]", 2, params.getColumnPos(4)); 1649 assertEquals("5 key fix 5 adjust", 0, params.mTopRowAdjustment); 1650 assertEquals("5 key fix 5 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1651 } 1652 1653 // |<1> [2] [3] [4] [5] 1654 @Test testLayout5KeyFix5L0()1655 public void testLayout5KeyFix5L0() { 1656 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L0); 1657 assertEquals("5 key fix 5 L0 columns", 5, params.mNumColumns); 1658 assertEquals("5 key fix 5 L0 rows", 1, params.mNumRows); 1659 assertEquals("5 key fix 5 L0 left", 0, params.mLeftKeys); 1660 assertEquals("5 key fix 5 L0 right", 5, params.mRightKeys); 1661 assertEquals("5 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1662 assertEquals("5 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1663 assertEquals("5 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1664 assertEquals("5 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1665 assertEquals("5 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1666 assertEquals("5 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1667 assertEquals("5 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1668 } 1669 1670 // |___ <1> [2] [3] [4] [5] 1671 @Test testLayout5KeyFix5L1()1672 public void testLayout5KeyFix5L1() { 1673 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L1); 1674 assertEquals("5 key fix 5 L1 columns", 5, params.mNumColumns); 1675 assertEquals("5 key fix 5 L1 rows", 1, params.mNumRows); 1676 assertEquals("5 key fix 5 L1 left", 0, params.mLeftKeys); 1677 assertEquals("5 key fix 5 L1 right", 5, params.mRightKeys); 1678 assertEquals("5 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1679 assertEquals("5 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1680 assertEquals("5 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1681 assertEquals("5 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1682 assertEquals("5 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1683 assertEquals("5 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1684 assertEquals("5 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1685 } 1686 1687 // |___ [1] <2> [3] [4] [5] 1688 @Test testLayout5KeyFix5L2()1689 public void testLayout5KeyFix5L2() { 1690 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_L2); 1691 assertEquals("5 key fix 5 L2 columns", 5, params.mNumColumns); 1692 assertEquals("5 key fix 5 L2 rows", 1, params.mNumRows); 1693 assertEquals("5 key fix 5 L2 left", 1, params.mLeftKeys); 1694 assertEquals("5 key fix 5 L2 right", 4, params.mRightKeys); 1695 assertEquals("5 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1696 assertEquals("5 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1697 assertEquals("5 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1698 assertEquals("5 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1699 assertEquals("5 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1700 assertEquals("5 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 1701 assertEquals("5 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1702 } 1703 1704 // [1] [2] [3] [4] <5>| 1705 @Test testLayout5KeyFix5R0()1706 public void testLayout5KeyFix5R0() { 1707 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R0); 1708 assertEquals("5 key fix 5 R0 columns", 5, params.mNumColumns); 1709 assertEquals("5 key fix 5 R0 rows", 1, params.mNumRows); 1710 assertEquals("5 key fix 5 R0 left", 4, params.mLeftKeys); 1711 assertEquals("5 key fix 5 R0 right", 1, params.mRightKeys); 1712 assertEquals("5 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 1713 assertEquals("5 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 1714 assertEquals("5 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 1715 assertEquals("5 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 1716 assertEquals("5 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 1717 assertEquals("5 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1718 assertEquals("5 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1719 } 1720 1721 // [1] [2] [3] [4] <5> ___| 1722 @Test testLayout5KeyFix5R1()1723 public void testLayout5KeyFix5R1() { 1724 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R1); 1725 assertEquals("5 key fix 5 R1 columns", 5, params.mNumColumns); 1726 assertEquals("5 key fix 5 R1 rows", 1, params.mNumRows); 1727 assertEquals("5 key fix 5 R1 left", 4, params.mLeftKeys); 1728 assertEquals("5 key fix 5 R1 right", 1, params.mRightKeys); 1729 assertEquals("5 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 1730 assertEquals("5 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 1731 assertEquals("5 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 1732 assertEquals("5 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 1733 assertEquals("5 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 1734 assertEquals("5 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1735 assertEquals("5 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1736 } 1737 1738 // [1] [2] [3] <4> [5] ___| 1739 @Test testLayout5KeyFix5R2()1740 public void testLayout5KeyFix5R2() { 1741 MoreKeysKeyboardParams params = createParams(5, 5, XPOS_R2); 1742 assertEquals("5 key fix 5 R2 columns", 5, params.mNumColumns); 1743 assertEquals("5 key fix 5 R2 rows", 1, params.mNumRows); 1744 assertEquals("5 key fix 5 R2 left", 3, params.mLeftKeys); 1745 assertEquals("5 key fix 5 R2 right", 2, params.mRightKeys); 1746 assertEquals("5 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 1747 assertEquals("5 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 1748 assertEquals("5 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 1749 assertEquals("5 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 1750 assertEquals("5 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 1751 assertEquals("5 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 1752 assertEquals("5 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1753 } 1754 1755 // [6] 1756 // [1] [2] <3> [4] [5] 1757 @Test testLayout6KeyFix5M0()1758 public void testLayout6KeyFix5M0() { 1759 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_M0); 1760 assertEquals("6 key fix 5 columns", 5, params.mNumColumns); 1761 assertEquals("6 key fix 5 rows", 2, params.mNumRows); 1762 assertEquals("6 key fix 5 left", 2, params.mLeftKeys); 1763 assertEquals("6 key fix 5 right", 3, params.mRightKeys); 1764 assertEquals("6 key fix 5 [1]", -2, params.getColumnPos(0)); 1765 assertEquals("6 key fix 5 [2]", -1, params.getColumnPos(1)); 1766 assertEquals("6 key fix 5 <3>", 0, params.getColumnPos(2)); 1767 assertEquals("6 key fix 5 [4]", 1, params.getColumnPos(3)); 1768 assertEquals("6 key fix 5 [5]", 2, params.getColumnPos(4)); 1769 assertEquals("6 key fix 5 [6]", 0, params.getColumnPos(5)); 1770 assertEquals("6 key fix 5 adjust", 0, params.mTopRowAdjustment); 1771 assertEquals("6 key fix 5 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1772 } 1773 1774 // |[6] 1775 // |<1> [2] [3] [4] [5] 1776 @Test testLayout6KeyFix5L0()1777 public void testLayout6KeyFix5L0() { 1778 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L0); 1779 assertEquals("6 key fix 5 L0 columns", 5, params.mNumColumns); 1780 assertEquals("6 key fix 5 L0 rows", 2, params.mNumRows); 1781 assertEquals("6 key fix 5 L0 left", 0, params.mLeftKeys); 1782 assertEquals("6 key fix 5 L0 right", 5, params.mRightKeys); 1783 assertEquals("6 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1784 assertEquals("6 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1785 assertEquals("6 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1786 assertEquals("6 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1787 assertEquals("6 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1788 assertEquals("6 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 1789 assertEquals("6 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1790 assertEquals("6 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1791 } 1792 1793 // |___ [6] 1794 // |___ <1> [2] [3] [4] [5] 1795 @Test testLayout6KeyFix5L1()1796 public void testLayout6KeyFix5L1() { 1797 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L1); 1798 assertEquals("6 key fix 5 L1 columns", 5, params.mNumColumns); 1799 assertEquals("6 key fix 5 L1 rows", 2, params.mNumRows); 1800 assertEquals("6 key fix 5 L1 left", 0, params.mLeftKeys); 1801 assertEquals("6 key fix 5 L1 right", 5, params.mRightKeys); 1802 assertEquals("6 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1803 assertEquals("6 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1804 assertEquals("6 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1805 assertEquals("6 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1806 assertEquals("6 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1807 assertEquals("6 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 1808 assertEquals("6 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1809 assertEquals("6 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1810 } 1811 1812 // |___ [6] 1813 // |___ [1] <2> [3] [4] [5] 1814 @Test testLayout6KeyFix5L2()1815 public void testLayout6KeyFix5L2() { 1816 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_L2); 1817 assertEquals("6 key fix 5 L2 columns", 5, params.mNumColumns); 1818 assertEquals("6 key fix 5 L2 rows", 2, params.mNumRows); 1819 assertEquals("6 key fix 5 L2 left", 1, params.mLeftKeys); 1820 assertEquals("6 key fix 5 L2 right", 4, params.mRightKeys); 1821 assertEquals("6 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1822 assertEquals("6 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1823 assertEquals("6 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1824 assertEquals("6 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1825 assertEquals("6 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1826 assertEquals("6 key fix 5 L2 [6]", 0, params.getColumnPos(5)); 1827 assertEquals("6 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 1828 assertEquals("6 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1829 } 1830 1831 // [6]| 1832 // [1] [2] [3] [4] <5>| 1833 @Test testLayout6KeyFix5R0()1834 public void testLayout6KeyFix5R0() { 1835 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R0); 1836 assertEquals("6 key fix 5 R0 columns", 5, params.mNumColumns); 1837 assertEquals("6 key fix 5 R0 rows", 2, params.mNumRows); 1838 assertEquals("6 key fix 5 R0 left", 4, params.mLeftKeys); 1839 assertEquals("6 key fix 5 R0 right", 1, params.mRightKeys); 1840 assertEquals("6 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 1841 assertEquals("6 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 1842 assertEquals("6 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 1843 assertEquals("6 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 1844 assertEquals("6 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 1845 assertEquals("6 key fix 5 R0 [6]", 0, params.getColumnPos(5)); 1846 assertEquals("6 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1847 assertEquals("6 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1848 } 1849 1850 // [6] ___| 1851 // [1] [2] [3] [4] <5> ___| 1852 @Test testLayout6KeyFix5R1()1853 public void testLayout6KeyFix5R1() { 1854 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R1); 1855 assertEquals("6 key fix 5 R1 columns", 5, params.mNumColumns); 1856 assertEquals("6 key fix 5 R1 rows", 2, params.mNumRows); 1857 assertEquals("6 key fix 5 R1 left", 4, params.mLeftKeys); 1858 assertEquals("6 key fix 5 R1 right", 1, params.mRightKeys); 1859 assertEquals("6 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 1860 assertEquals("6 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 1861 assertEquals("6 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 1862 assertEquals("6 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 1863 assertEquals("6 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 1864 assertEquals("6 key fix 5 R1 [6]", 0, params.getColumnPos(5)); 1865 assertEquals("6 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 1866 assertEquals("6 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1867 } 1868 1869 // [6] ___| 1870 // [1] [2] [3] <4> [5] ___| 1871 @Test testLayout6KeyFix5R2()1872 public void testLayout6KeyFix5R2() { 1873 MoreKeysKeyboardParams params = createParams(6, 5, XPOS_R2); 1874 assertEquals("6 key fix 5 R2 columns", 5, params.mNumColumns); 1875 assertEquals("6 key fix 5 R2 rows", 2, params.mNumRows); 1876 assertEquals("6 key fix 5 R2 left", 3, params.mLeftKeys); 1877 assertEquals("6 key fix 5 R2 right", 2, params.mRightKeys); 1878 assertEquals("6 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 1879 assertEquals("6 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 1880 assertEquals("6 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 1881 assertEquals("6 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 1882 assertEquals("6 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 1883 assertEquals("6 key fix 5 R2 [6]", 0, params.getColumnPos(5)); 1884 assertEquals("6 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 1885 assertEquals("6 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 1886 } 1887 1888 // [6] [7] 1889 // [1] [2] <3> [4] [5] 1890 @Test testLayout7KeyFix5M0()1891 public void testLayout7KeyFix5M0() { 1892 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_M0); 1893 assertEquals("7 key fix 5 columns", 5, params.mNumColumns); 1894 assertEquals("7 key fix 5 rows", 2, params.mNumRows); 1895 assertEquals("7 key fix 5 left", 2, params.mLeftKeys); 1896 assertEquals("7 key fix 5 right", 3, params.mRightKeys); 1897 assertEquals("7 key fix 5 [1]", -2, params.getColumnPos(0)); 1898 assertEquals("7 key fix 5 [2]", -1, params.getColumnPos(1)); 1899 assertEquals("7 key fix 5 <3>", 0, params.getColumnPos(2)); 1900 assertEquals("7 key fix 5 [4]", 1, params.getColumnPos(3)); 1901 assertEquals("7 key fix 5 [5]", 2, params.getColumnPos(4)); 1902 assertEquals("7 key fix 5 [6]", 0, params.getColumnPos(5)); 1903 assertEquals("7 key fix 5 [7]", 1, params.getColumnPos(6)); 1904 assertEquals("7 key fix 5 adjust", -1, params.mTopRowAdjustment); 1905 assertEquals("7 key fix 5 default", WIDTH * 2, params.getDefaultKeyCoordX()); 1906 } 1907 1908 // |[6] [7] 1909 // |<1> [2] [3] [4] [5] 1910 @Test testLayout7KeyFix5L0()1911 public void testLayout7KeyFix5L0() { 1912 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L0); 1913 assertEquals("7 key fix 5 L0 columns", 5, params.mNumColumns); 1914 assertEquals("7 key fix 5 L0 rows", 2, params.mNumRows); 1915 assertEquals("7 key fix 5 L0 left", 0, params.mLeftKeys); 1916 assertEquals("7 key fix 5 L0 right", 5, params.mRightKeys); 1917 assertEquals("7 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 1918 assertEquals("7 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 1919 assertEquals("7 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 1920 assertEquals("7 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 1921 assertEquals("7 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 1922 assertEquals("7 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 1923 assertEquals("7 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 1924 assertEquals("7 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 1925 assertEquals("7 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1926 } 1927 1928 // |___ [6] [7] 1929 // |___ <1> [2] [3] [4] [5] 1930 @Test testLayout7KeyFix5L1()1931 public void testLayout7KeyFix5L1() { 1932 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L1); 1933 assertEquals("7 key fix 5 L1 columns", 5, params.mNumColumns); 1934 assertEquals("7 key fix 5 L1 rows", 2, params.mNumRows); 1935 assertEquals("7 key fix 5 L1 left", 0, params.mLeftKeys); 1936 assertEquals("7 key fix 5 L1 right", 5, params.mRightKeys); 1937 assertEquals("7 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 1938 assertEquals("7 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 1939 assertEquals("7 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 1940 assertEquals("7 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 1941 assertEquals("7 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 1942 assertEquals("7 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 1943 assertEquals("7 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 1944 assertEquals("7 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 1945 assertEquals("7 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 1946 } 1947 1948 // |___ [6] [7] 1949 // |___ [1] <2> [3] [4] [5] 1950 @Test testLayout7KeyFix5L2()1951 public void testLayout7KeyFix5L2() { 1952 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_L2); 1953 assertEquals("7 key fix 5 L2 columns", 5, params.mNumColumns); 1954 assertEquals("7 key fix 5 L2 rows", 2, params.mNumRows); 1955 assertEquals("7 key fix 5 L2 left", 1, params.mLeftKeys); 1956 assertEquals("7 key fix 5 L2 right", 4, params.mRightKeys); 1957 assertEquals("7 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 1958 assertEquals("7 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 1959 assertEquals("7 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 1960 assertEquals("7 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 1961 assertEquals("7 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 1962 assertEquals("7 key fix 5 L2 [6]", 0, params.getColumnPos(5)); 1963 assertEquals("7 key fix 5 L2 [7]", 1, params.getColumnPos(6)); 1964 assertEquals("7 key fix 5 L2 adjust", -1, params.mTopRowAdjustment); 1965 assertEquals("7 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 1966 } 1967 1968 // [6] [7]| 1969 // [1] [2] [3] [4] <5>| 1970 @Test testLayout7KeyFix5R0()1971 public void testLayout7KeyFix5R0() { 1972 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R0); 1973 assertEquals("7 key fix 5 R0 columns", 5, params.mNumColumns); 1974 assertEquals("7 key fix 5 R0 rows", 2, params.mNumRows); 1975 assertEquals("7 key fix 5 R0 left", 4, params.mLeftKeys); 1976 assertEquals("7 key fix 5 R0 right", 1, params.mRightKeys); 1977 assertEquals("7 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 1978 assertEquals("7 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 1979 assertEquals("7 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 1980 assertEquals("7 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 1981 assertEquals("7 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 1982 assertEquals("7 key fix 5 R0 [6]", -1, params.getColumnPos(5)); 1983 assertEquals("7 key fix 5 R0 [7]", 0, params.getColumnPos(6)); 1984 assertEquals("7 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 1985 assertEquals("7 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 1986 } 1987 1988 // [6] [7] ___| 1989 // [1] [2] [3] [4] <5> ___| 1990 @Test testLayout7KeyFix5R1()1991 public void testLayout7KeyFix5R1() { 1992 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R1); 1993 assertEquals("7 key fix 5 R1 columns", 5, params.mNumColumns); 1994 assertEquals("7 key fix 5 R1 rows", 2, params.mNumRows); 1995 assertEquals("7 key fix 5 R1 left", 4, params.mLeftKeys); 1996 assertEquals("7 key fix 5 R1 right", 1, params.mRightKeys); 1997 assertEquals("7 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 1998 assertEquals("7 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 1999 assertEquals("7 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2000 assertEquals("7 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2001 assertEquals("7 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2002 assertEquals("7 key fix 5 R1 [6]", -1, params.getColumnPos(5)); 2003 assertEquals("7 key fix 5 R1 [7]", 0, params.getColumnPos(6)); 2004 assertEquals("7 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2005 assertEquals("7 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2006 } 2007 2008 // [6] [7] ___| 2009 // [1] [2] [3] <4> [5] ___| 2010 @Test testLayout7KeyFix5R2()2011 public void testLayout7KeyFix5R2() { 2012 MoreKeysKeyboardParams params = createParams(7, 5, XPOS_R2); 2013 assertEquals("7 key fix 5 R2 columns",5, params.mNumColumns); 2014 assertEquals("7 key fix 5 R2 rows", 2, params.mNumRows); 2015 assertEquals("7 key fix 5 R2 left", 3, params.mLeftKeys); 2016 assertEquals("7 key fix 5 R2 right", 2, params.mRightKeys); 2017 assertEquals("7 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2018 assertEquals("7 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2019 assertEquals("7 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2020 assertEquals("7 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2021 assertEquals("7 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2022 assertEquals("7 key fix 5 R2 [6]", 0, params.getColumnPos(5)); 2023 assertEquals("7 key fix 5 R2 [7]", 1, params.getColumnPos(6)); 2024 assertEquals("7 key fix 5 R2 adjust", -1, params.mTopRowAdjustment); 2025 assertEquals("7 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2026 } 2027 2028 // [6] [7] [8] 2029 // [1] [2] <3> [4] [5] 2030 @Test testLayout8KeyFix5M0()2031 public void testLayout8KeyFix5M0() { 2032 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_M0); 2033 assertEquals("8 key fix 5 M0 columns", 5, params.mNumColumns); 2034 assertEquals("8 key fix 5 M0 rows", 2, params.mNumRows); 2035 assertEquals("8 key fix 5 M0 left", 2, params.mLeftKeys); 2036 assertEquals("8 key fix 5 M0 right", 3, params.mRightKeys); 2037 assertEquals("8 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2038 assertEquals("8 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2039 assertEquals("8 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2040 assertEquals("8 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2041 assertEquals("8 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2042 assertEquals("8 key fix 5 M0 [6]", -1, params.getColumnPos(5)); 2043 assertEquals("8 key fix 5 M0 [7]", 0, params.getColumnPos(6)); 2044 assertEquals("8 key fix 5 M0 [8]", 1, params.getColumnPos(7)); 2045 assertEquals("8 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2046 assertEquals("8 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2047 } 2048 2049 // |[6] [7] [8] 2050 // |<1> [2] [3] [4] [5] 2051 @Test testLayout8KeyFix5L0()2052 public void testLayout8KeyFix5L0() { 2053 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L0); 2054 assertEquals("8 key fix 5 L0 columns", 5, params.mNumColumns); 2055 assertEquals("8 key fix 5 L0 rows", 2, params.mNumRows); 2056 assertEquals("8 key fix 5 L0 left", 0, params.mLeftKeys); 2057 assertEquals("8 key fix 5 L0 right", 5, params.mRightKeys); 2058 assertEquals("8 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 2059 assertEquals("8 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 2060 assertEquals("8 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 2061 assertEquals("8 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 2062 assertEquals("8 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 2063 assertEquals("8 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 2064 assertEquals("8 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 2065 assertEquals("8 key fix 5 L0 [8]", 2, params.getColumnPos(7)); 2066 assertEquals("8 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 2067 assertEquals("8 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2068 } 2069 2070 // |___ [6] [7] [8] 2071 // |___ <1> [2] [3] [4] [5] 2072 @Test testLayout8KeyFix5L1()2073 public void testLayout8KeyFix5L1() { 2074 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L1); 2075 assertEquals("8 key fix 5 L1 columns", 5, params.mNumColumns); 2076 assertEquals("8 key fix 5 L1 rows", 2, params.mNumRows); 2077 assertEquals("8 key fix 5 L1 left", 0, params.mLeftKeys); 2078 assertEquals("8 key fix 5 L1 right", 5, params.mRightKeys); 2079 assertEquals("8 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 2080 assertEquals("8 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 2081 assertEquals("8 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 2082 assertEquals("8 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 2083 assertEquals("8 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 2084 assertEquals("8 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 2085 assertEquals("8 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 2086 assertEquals("8 key fix 5 L1 [8]", 2, params.getColumnPos(7)); 2087 assertEquals("8 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 2088 assertEquals("8 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2089 } 2090 2091 // |___ [6] [7] [8] 2092 // |___ [1] <2> [3] [4] [5] 2093 @Test testLayout8KeyFix5L2()2094 public void testLayout8KeyFix5L2() { 2095 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_L2); 2096 assertEquals("8 key fix 5 L2 columns", 5, params.mNumColumns); 2097 assertEquals("8 key fix 5 L2 rows", 2, params.mNumRows); 2098 assertEquals("8 key fix 5 L2 left", 1, params.mLeftKeys); 2099 assertEquals("8 key fix 5 L2 right", 4, params.mRightKeys); 2100 assertEquals("8 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 2101 assertEquals("8 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 2102 assertEquals("8 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 2103 assertEquals("8 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 2104 assertEquals("8 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 2105 assertEquals("8 key fix 5 L2 [6]", -1, params.getColumnPos(5)); 2106 assertEquals("8 key fix 5 L2 [7]", 0, params.getColumnPos(6)); 2107 assertEquals("8 key fix 5 L2 [8]", 1, params.getColumnPos(7)); 2108 assertEquals("8 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 2109 assertEquals("8 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2110 } 2111 2112 // [6] [7] [8]| 2113 // [1] [2] [3] [4] <5>| 2114 @Test testLayout8KeyFix5R0()2115 public void testLayout8KeyFix5R0() { 2116 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R0); 2117 assertEquals("8 key fix 5 R0 columns", 5, params.mNumColumns); 2118 assertEquals("8 key fix 5 R0 rows", 2, params.mNumRows); 2119 assertEquals("8 key fix 5 R0 left", 4, params.mLeftKeys); 2120 assertEquals("8 key fix 5 R0 right", 1, params.mRightKeys); 2121 assertEquals("8 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 2122 assertEquals("8 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 2123 assertEquals("8 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 2124 assertEquals("8 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 2125 assertEquals("8 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 2126 assertEquals("8 key fix 5 R0 [6]", -2, params.getColumnPos(5)); 2127 assertEquals("8 key fix 5 R0 [7]", -1, params.getColumnPos(6)); 2128 assertEquals("8 key fix 5 R0 [8]", 0, params.getColumnPos(7)); 2129 assertEquals("8 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 2130 assertEquals("8 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2131 } 2132 2133 // [6] [7] [8] ___| 2134 // [1] [2] [3] [4] <5> ___| 2135 @Test testLayout8KeyFix5R1()2136 public void testLayout8KeyFix5R1() { 2137 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R1); 2138 assertEquals("8 key fix 5 R1 columns", 5, params.mNumColumns); 2139 assertEquals("8 key fix 5 R1 rows", 2, params.mNumRows); 2140 assertEquals("8 key fix 5 R1 left", 4, params.mLeftKeys); 2141 assertEquals("8 key fix 5 R1 right", 1, params.mRightKeys); 2142 assertEquals("8 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 2143 assertEquals("8 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 2144 assertEquals("8 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2145 assertEquals("8 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2146 assertEquals("8 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2147 assertEquals("8 key fix 5 R1 [6]", -2, params.getColumnPos(5)); 2148 assertEquals("8 key fix 5 R1 [7]", -1, params.getColumnPos(6)); 2149 assertEquals("8 key fix 5 R1 [8]", 0, params.getColumnPos(7)); 2150 assertEquals("8 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2151 assertEquals("8 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2152 } 2153 2154 // [6] [7] [8] ___| 2155 // [1] [2] [3] <4> [5] ___| 2156 @Test testLayout8KeyFix5R2()2157 public void testLayout8KeyFix5R2() { 2158 MoreKeysKeyboardParams params = createParams(8, 5, XPOS_R2); 2159 assertEquals("8 key fix 5 R2 columns", 5, params.mNumColumns); 2160 assertEquals("8 key fix 5 R2 rows", 2, params.mNumRows); 2161 assertEquals("8 key fix 5 R2 left", 3, params.mLeftKeys); 2162 assertEquals("8 key fix 5 R2 right", 2, params.mRightKeys); 2163 assertEquals("8 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2164 assertEquals("8 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2165 assertEquals("8 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2166 assertEquals("8 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2167 assertEquals("8 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2168 assertEquals("8 key fix 5 R2 [6]", -1, params.getColumnPos(5)); 2169 assertEquals("8 key fix 5 R2 [7]", 0, params.getColumnPos(6)); 2170 assertEquals("8 key fix 5 R2 [8]", 1, params.getColumnPos(7)); 2171 assertEquals("8 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 2172 assertEquals("8 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2173 } 2174 2175 // [6] [7] [8] [9] 2176 // [1] [2] <3> [4] [5] 2177 @Test testLayout9KeyFix5M0()2178 public void testLayout9KeyFix5M0() { 2179 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_M0); 2180 assertEquals("9 key fix 5 M0 columns", 5, params.mNumColumns); 2181 assertEquals("9 key fix 5 M0 rows", 2, params.mNumRows); 2182 assertEquals("9 key fix 5 M0 left", 2, params.mLeftKeys); 2183 assertEquals("9 key fix 5 M0 right", 3, params.mRightKeys); 2184 assertEquals("9 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2185 assertEquals("9 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2186 assertEquals("9 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2187 assertEquals("9 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2188 assertEquals("9 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2189 assertEquals("9 key fix 5 M0 [6]", -1, params.getColumnPos(5)); 2190 assertEquals("9 key fix 5 M0 [7]", 0, params.getColumnPos(6)); 2191 assertEquals("9 key fix 5 M0 [8]", 1, params.getColumnPos(7)); 2192 assertEquals("9 key fix 5 M0 [9]", 2, params.getColumnPos(8)); 2193 assertEquals("9 key fix 5 M0 adjust", -1, params.mTopRowAdjustment); 2194 assertEquals("9 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2195 } 2196 2197 // |[6] [7] [8] [9] 2198 // |<1> [2] [3] [4] [5] 2199 @Test testLayout9KeyFix5L0()2200 public void testLayout9KeyFix5L0() { 2201 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L0); 2202 assertEquals("9 key fix 5 L0 columns", 5, params.mNumColumns); 2203 assertEquals("9 key fix 5 L0 rows", 2, params.mNumRows); 2204 assertEquals("9 key fix 5 L0 left", 0, params.mLeftKeys); 2205 assertEquals("9 key fix 5 L0 right", 5, params.mRightKeys); 2206 assertEquals("9 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 2207 assertEquals("9 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 2208 assertEquals("9 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 2209 assertEquals("9 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 2210 assertEquals("9 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 2211 assertEquals("9 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 2212 assertEquals("9 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 2213 assertEquals("9 key fix 5 L0 [8]", 2, params.getColumnPos(7)); 2214 assertEquals("9 key fix 5 L0 [9]", 3, params.getColumnPos(8)); 2215 assertEquals("9 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 2216 assertEquals("9 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2217 } 2218 2219 // |___ [6] [7] [8] [9] 2220 // |___ <1> [2] [3] [4] [5] 2221 @Test testLayout9KeyFix5L1()2222 public void testLayout9KeyFix5L1() { 2223 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L1); 2224 assertEquals("9 key fix 5 L1 columns", 5, params.mNumColumns); 2225 assertEquals("9 key fix 5 L1 rows", 2, params.mNumRows); 2226 assertEquals("9 key fix 5 L1 left", 0, params.mLeftKeys); 2227 assertEquals("9 key fix 5 L1 right", 5, params.mRightKeys); 2228 assertEquals("9 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 2229 assertEquals("9 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 2230 assertEquals("9 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 2231 assertEquals("9 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 2232 assertEquals("9 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 2233 assertEquals("9 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 2234 assertEquals("9 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 2235 assertEquals("9 key fix 5 L1 [8]", 2, params.getColumnPos(7)); 2236 assertEquals("9 key fix 5 L1 [9]", 3, params.getColumnPos(8)); 2237 assertEquals("9 key fix 5 L1 adjust",0, params.mTopRowAdjustment); 2238 assertEquals("9 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2239 } 2240 2241 // |___ [6] [7] [8] [9] 2242 // |___ [1] <2> [3] [4] [5] 2243 @Test testLayout9KeyFix5L2()2244 public void testLayout9KeyFix5L2() { 2245 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_L2); 2246 assertEquals("9 key fix 5 L2 columns", 5, params.mNumColumns); 2247 assertEquals("9 key fix 5 L2 rows", 2, params.mNumRows); 2248 assertEquals("9 key fix 5 L2 left", 1, params.mLeftKeys); 2249 assertEquals("9 key fix 5 L2 right", 4, params.mRightKeys); 2250 assertEquals("9 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 2251 assertEquals("9 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 2252 assertEquals("9 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 2253 assertEquals("9 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 2254 assertEquals("9 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 2255 assertEquals("9 key fix 5 L2 [6]", 0, params.getColumnPos(5)); 2256 assertEquals("9 key fix 5 L2 [7]", 1, params.getColumnPos(6)); 2257 assertEquals("9 key fix 5 L2 [8]", 2, params.getColumnPos(7)); 2258 assertEquals("9 key fix 5 L2 [9]", 3, params.getColumnPos(8)); 2259 assertEquals("9 key fix 5 L2 adjust", -1, params.mTopRowAdjustment); 2260 assertEquals("9 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2261 } 2262 2263 // [6] [7] [8] [9]| 2264 // [1] [2] [3] [4] <5>| 2265 @Test testLayout9KeyFix5R0()2266 public void testLayout9KeyFix5R0() { 2267 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R0); 2268 assertEquals("9 key fix 5 R0 columns", 5, params.mNumColumns); 2269 assertEquals("9 key fix 5 R0 rows", 2, params.mNumRows); 2270 assertEquals("9 key fix 5 R0 left", 4, params.mLeftKeys); 2271 assertEquals("9 key fix 5 R0 right", 1, params.mRightKeys); 2272 assertEquals("9 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 2273 assertEquals("9 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 2274 assertEquals("9 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 2275 assertEquals("9 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 2276 assertEquals("9 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 2277 assertEquals("9 key fix 5 R0 [6]", -3, params.getColumnPos(5)); 2278 assertEquals("9 key fix 5 R0 [7]", -2, params.getColumnPos(6)); 2279 assertEquals("9 key fix 5 R0 [8]", -1, params.getColumnPos(7)); 2280 assertEquals("9 key fix 5 R0 [9]", 0, params.getColumnPos(8)); 2281 assertEquals("9 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 2282 assertEquals("9 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2283 } 2284 2285 // [6] [7] [8] [9] ___| 2286 // [1] [2] [3] [4] <5> ___| 2287 @Test testLayout9KeyFix5R1()2288 public void testLayout9KeyFix5R1() { 2289 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R1); 2290 assertEquals("9 key fix 5 R1 columns", 5, params.mNumColumns); 2291 assertEquals("9 key fix 5 R1 rows", 2, params.mNumRows); 2292 assertEquals("9 key fix 5 R1 left", 4, params.mLeftKeys); 2293 assertEquals("9 key fix 5 R1 right", 1, params.mRightKeys); 2294 assertEquals("9 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 2295 assertEquals("9 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 2296 assertEquals("9 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2297 assertEquals("9 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2298 assertEquals("9 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2299 assertEquals("9 key fix 5 R1 [6]", -3, params.getColumnPos(5)); 2300 assertEquals("9 key fix 5 R1 [7]", -2, params.getColumnPos(6)); 2301 assertEquals("9 key fix 5 R1 [8]", -1, params.getColumnPos(7)); 2302 assertEquals("9 key fix 5 R1 [9]", 0, params.getColumnPos(8)); 2303 assertEquals("9 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2304 assertEquals("9 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2305 } 2306 2307 // [6] [7] [8] [9] ___| 2308 // [1] [2] [3] <4> [5] ___| 2309 @Test testLayout9KeyFix5R2()2310 public void testLayout9KeyFix5R2() { 2311 MoreKeysKeyboardParams params = createParams(9, 5, XPOS_R2); 2312 assertEquals("9 key fix 5 R2 columns", 5, params.mNumColumns); 2313 assertEquals("9 key fix 5 R2 rows", 2, params.mNumRows); 2314 assertEquals("9 key fix 5 R2 left", 3, params.mLeftKeys); 2315 assertEquals("9 key fix 5 R2 right", 2, params.mRightKeys); 2316 assertEquals("9 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2317 assertEquals("9 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2318 assertEquals("9 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2319 assertEquals("9 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2320 assertEquals("9 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2321 assertEquals("9 key fix 5 R2 [6]", -2, params.getColumnPos(5)); 2322 assertEquals("9 key fix 5 R2 [7]", -1, params.getColumnPos(6)); 2323 assertEquals("9 key fix 5 R2 [8]", 0, params.getColumnPos(7)); 2324 assertEquals("9 key fix 5 R2 [9]", 1, params.getColumnPos(8)); 2325 assertEquals("9 key fix 5 R2 adjust", -1, params.mTopRowAdjustment); 2326 assertEquals("9 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2327 } 2328 2329 // [6] [7] [8] [9] [A] 2330 // [1] [2] <3> [4] [5] 2331 @Test testLayout10KeyFix5M0()2332 public void testLayout10KeyFix5M0() { 2333 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_M0); 2334 assertEquals("10 key fix 5 M0 columns", 5, params.mNumColumns); 2335 assertEquals("10 key fix 5 M0 rows", 2, params.mNumRows); 2336 assertEquals("10 key fix 5 M0 left", 2, params.mLeftKeys); 2337 assertEquals("10 key fix 5 M0 right", 3, params.mRightKeys); 2338 assertEquals("10 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2339 assertEquals("10 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2340 assertEquals("10 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2341 assertEquals("10 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2342 assertEquals("10 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2343 assertEquals("10 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2344 assertEquals("10 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2345 assertEquals("10 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2346 assertEquals("10 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2347 assertEquals("10 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2348 assertEquals("10 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2349 assertEquals("10 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2350 } 2351 2352 // |[6] [7] [8] [9] [A] 2353 // |<1> [2] [3] [4] [5] 2354 @Test testLayout10KeyFix5L0()2355 public void testLayout10KeyFix5L0() { 2356 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L0); 2357 assertEquals("10 key fix 5 L0 columns", 5, params.mNumColumns); 2358 assertEquals("10 key fix 5 L0 rows", 2, params.mNumRows); 2359 assertEquals("10 key fix 5 L0 left", 0, params.mLeftKeys); 2360 assertEquals("10 key fix 5 L0 right", 5, params.mRightKeys); 2361 assertEquals("10 key fix 5 L0 <1>", 0, params.getColumnPos(0)); 2362 assertEquals("10 key fix 5 L0 [2]", 1, params.getColumnPos(1)); 2363 assertEquals("10 key fix 5 L0 [3]", 2, params.getColumnPos(2)); 2364 assertEquals("10 key fix 5 L0 [4]", 3, params.getColumnPos(3)); 2365 assertEquals("10 key fix 5 L0 [5]", 4, params.getColumnPos(4)); 2366 assertEquals("10 key fix 5 L0 [6]", 0, params.getColumnPos(5)); 2367 assertEquals("10 key fix 5 L0 [7]", 1, params.getColumnPos(6)); 2368 assertEquals("10 key fix 5 L0 [8]", 2, params.getColumnPos(7)); 2369 assertEquals("10 key fix 5 L0 [9]", 3, params.getColumnPos(8)); 2370 assertEquals("10 key fix 5 L0 [A]", 4, params.getColumnPos(9)); 2371 assertEquals("10 key fix 5 L0 adjust", 0, params.mTopRowAdjustment); 2372 assertEquals("10 key fix 5 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2373 } 2374 2375 // |___ [6] [7] [8] [9] [A] 2376 // |___ <1> [2] [3] [4] [5] 2377 @Test testLayout10KeyFix5L1()2378 public void testLayout10KeyFix5L1() { 2379 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L1); 2380 assertEquals("10 key fix 5 L1 columns", 5, params.mNumColumns); 2381 assertEquals("10 key fix 5 L1 rows", 2, params.mNumRows); 2382 assertEquals("10 key fix 5 L1 left", 0, params.mLeftKeys); 2383 assertEquals("10 key fix 5 L1 right", 5, params.mRightKeys); 2384 assertEquals("10 key fix 5 L1 <1>", 0, params.getColumnPos(0)); 2385 assertEquals("10 key fix 5 L1 [2]", 1, params.getColumnPos(1)); 2386 assertEquals("10 key fix 5 L1 [3]", 2, params.getColumnPos(2)); 2387 assertEquals("10 key fix 5 L1 [4]", 3, params.getColumnPos(3)); 2388 assertEquals("10 key fix 5 L1 [5]", 4, params.getColumnPos(4)); 2389 assertEquals("10 key fix 5 L1 [6]", 0, params.getColumnPos(5)); 2390 assertEquals("10 key fix 5 L1 [7]", 1, params.getColumnPos(6)); 2391 assertEquals("10 key fix 5 L1 [8]", 2, params.getColumnPos(7)); 2392 assertEquals("10 key fix 5 L1 [9]", 3, params.getColumnPos(8)); 2393 assertEquals("10 key fix 5 L1 [A]", 4, params.getColumnPos(9)); 2394 assertEquals("10 key fix 5 L1 adjust", 0, params.mTopRowAdjustment); 2395 assertEquals("10 key fix 5 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2396 } 2397 2398 // |___ [6] [7] [8] [9] [A] 2399 // |___ [1] <2> [3] [4] [5] 2400 @Test testLayout10KeyFix5L2()2401 public void testLayout10KeyFix5L2() { 2402 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_L2); 2403 assertEquals("10 key fix 5 L2 columns", 5, params.mNumColumns); 2404 assertEquals("10 key fix 5 L2 rows", 2, params.mNumRows); 2405 assertEquals("10 key fix 5 L2 left", 1, params.mLeftKeys); 2406 assertEquals("10 key fix 5 L2 right", 4, params.mRightKeys); 2407 assertEquals("10 key fix 5 L2 [1]", -1, params.getColumnPos(0)); 2408 assertEquals("10 key fix 5 L2 <2>", 0, params.getColumnPos(1)); 2409 assertEquals("10 key fix 5 L2 [3]", 1, params.getColumnPos(2)); 2410 assertEquals("10 key fix 5 L2 [4]", 2, params.getColumnPos(3)); 2411 assertEquals("10 key fix 5 L2 [5]", 3, params.getColumnPos(4)); 2412 assertEquals("10 key fix 5 L2 [6]", -1, params.getColumnPos(5)); 2413 assertEquals("10 key fix 5 L2 [7]", 0, params.getColumnPos(6)); 2414 assertEquals("10 key fix 5 L2 [8]", 1, params.getColumnPos(7)); 2415 assertEquals("10 key fix 5 L2 [9]", 2, params.getColumnPos(8)); 2416 assertEquals("10 key fix 5 L2 [A]", 3, params.getColumnPos(9)); 2417 assertEquals("10 key fix 5 L2 adjust", 0, params.mTopRowAdjustment); 2418 assertEquals("10 key fix 5 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2419 } 2420 2421 // [6] [7] [8] [9] [A]| 2422 // [1] [2] [3] [4] <5>| 2423 @Test testLayout10KeyFix5R0()2424 public void testLayout10KeyFix5R0() { 2425 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R0); 2426 assertEquals("10 key fix 5 R0 columns", 5, params.mNumColumns); 2427 assertEquals("10 key fix 5 R0 rows", 2, params.mNumRows); 2428 assertEquals("10 key fix 5 R0 left", 4, params.mLeftKeys); 2429 assertEquals("10 key fix 5 R0 right", 1, params.mRightKeys); 2430 assertEquals("10 key fix 5 R0 [1]", -4, params.getColumnPos(0)); 2431 assertEquals("10 key fix 5 R0 [2]", -3, params.getColumnPos(1)); 2432 assertEquals("10 key fix 5 R0 [3]", -2, params.getColumnPos(2)); 2433 assertEquals("10 key fix 5 R0 [4]", -1, params.getColumnPos(3)); 2434 assertEquals("10 key fix 5 R0 <5>", 0, params.getColumnPos(4)); 2435 assertEquals("10 key fix 5 R0 [6]", -4, params.getColumnPos(5)); 2436 assertEquals("10 key fix 5 R0 [7]", -3, params.getColumnPos(6)); 2437 assertEquals("10 key fix 5 R0 [8]", -2, params.getColumnPos(7)); 2438 assertEquals("10 key fix 5 R0 [9]", -1, params.getColumnPos(8)); 2439 assertEquals("10 key fix 5 R0 [A]", 0, params.getColumnPos(9)); 2440 assertEquals("10 key fix 5 R0 adjust", 0, params.mTopRowAdjustment); 2441 assertEquals("10 key fix 5 R0 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2442 } 2443 2444 // [6] [7] [8] [9] [A] ___| 2445 // [1] [2] [3] [4] <5> ___| 2446 @Test testLayout10KeyFix5R1()2447 public void testLayout10KeyFix5R1() { 2448 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R1); 2449 assertEquals("10 key fix 5 R1 columns", 5, params.mNumColumns); 2450 assertEquals("10 key fix 5 R1 rows", 2, params.mNumRows); 2451 assertEquals("10 key fix 5 R1 left", 4, params.mLeftKeys); 2452 assertEquals("10 key fix 5 R1 right", 1, params.mRightKeys); 2453 assertEquals("10 key fix 5 R1 [1]", -4, params.getColumnPos(0)); 2454 assertEquals("10 key fix 5 R1 [2]", -3, params.getColumnPos(1)); 2455 assertEquals("10 key fix 5 R1 [3]", -2, params.getColumnPos(2)); 2456 assertEquals("10 key fix 5 R1 [4]", -1, params.getColumnPos(3)); 2457 assertEquals("10 key fix 5 R1 <5>", 0, params.getColumnPos(4)); 2458 assertEquals("10 key fix 5 R1 [6]", -4, params.getColumnPos(5)); 2459 assertEquals("10 key fix 5 R1 [7]", -3, params.getColumnPos(6)); 2460 assertEquals("10 key fix 5 R1 [8]", -2, params.getColumnPos(7)); 2461 assertEquals("10 key fix 5 R1 [9]", -1, params.getColumnPos(8)); 2462 assertEquals("10 key fix 5 R1 [A]", 0, params.getColumnPos(9)); 2463 assertEquals("10 key fix 5 R1 adjust", 0, params.mTopRowAdjustment); 2464 assertEquals("10 key fix 5 R1 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2465 } 2466 2467 // [6] [7] [8] [9] [A] ___| 2468 // [1] [2] [3] <4> [5] ___| 2469 @Test testLayout10KeyFix5R2()2470 public void testLayout10KeyFix5R2() { 2471 MoreKeysKeyboardParams params = createParams(10, 5, XPOS_R2); 2472 assertEquals("10 key fix 5 R2 columns", 5, params.mNumColumns); 2473 assertEquals("10 key fix 5 R2 rows", 2, params.mNumRows); 2474 assertEquals("10 key fix 5 R2 left", 3, params.mLeftKeys); 2475 assertEquals("10 key fix 5 R2 right", 2, params.mRightKeys); 2476 assertEquals("10 key fix 5 R2 [1]", -3, params.getColumnPos(0)); 2477 assertEquals("10 key fix 5 R2 [2]", -2, params.getColumnPos(1)); 2478 assertEquals("10 key fix 5 R2 [3]", -1, params.getColumnPos(2)); 2479 assertEquals("10 key fix 5 R2 <4>", 0, params.getColumnPos(3)); 2480 assertEquals("10 key fix 5 R2 [5]", 1, params.getColumnPos(4)); 2481 assertEquals("10 key fix 5 R2 [6]", -3, params.getColumnPos(5)); 2482 assertEquals("10 key fix 5 R2 [7]", -2, params.getColumnPos(6)); 2483 assertEquals("10 key fix 5 R2 [8]", -1, params.getColumnPos(7)); 2484 assertEquals("10 key fix 5 R2 [9]", 0, params.getColumnPos(8)); 2485 assertEquals("10 key fix 5 R2 [A]", 1, params.getColumnPos(9)); 2486 assertEquals("10 key fix 5 R2 adjust", 0, params.mTopRowAdjustment); 2487 assertEquals("10 key fix 5 R2 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2488 } 2489 2490 // [B] 2491 // [6] [7] [8] [9] [A] 2492 // [1] [2] <3> [4] [5] 2493 @Test testLayout11KeyFix5M0()2494 public void testLayout11KeyFix5M0() { 2495 MoreKeysKeyboardParams params = createParams(11, 5, XPOS_M0); 2496 assertEquals("11 key fix 5 M0 columns", 5, params.mNumColumns); 2497 assertEquals("11 key fix 5 M0 rows", 3, params.mNumRows); 2498 assertEquals("11 key fix 5 M0 left", 2, params.mLeftKeys); 2499 assertEquals("11 key fix 5 M0 right", 3, params.mRightKeys); 2500 assertEquals("11 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2501 assertEquals("11 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2502 assertEquals("11 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2503 assertEquals("11 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2504 assertEquals("11 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2505 assertEquals("11 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2506 assertEquals("11 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2507 assertEquals("11 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2508 assertEquals("11 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2509 assertEquals("11 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2510 assertEquals("11 key fix 5 M0 [B]", 0, params.getColumnPos(10)); 2511 assertEquals("11 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2512 assertEquals("11 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2513 } 2514 2515 // [B] [C] 2516 // [6] [7] [8] [9] [A] 2517 // [1] [2] <3> [4] [5] 2518 @Test testLayout12KeyFix5M0()2519 public void testLayout12KeyFix5M0() { 2520 MoreKeysKeyboardParams params = createParams(12, 5, XPOS_M0); 2521 assertEquals("12 key fix 5 M0 columns", 5, params.mNumColumns); 2522 assertEquals("12 key fix 5 M0 rows", 3, params.mNumRows); 2523 assertEquals("12 key fix 5 M0 left", 2, params.mLeftKeys); 2524 assertEquals("12 key fix 5 M0 right", 3, params.mRightKeys); 2525 assertEquals("12 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2526 assertEquals("12 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2527 assertEquals("12 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2528 assertEquals("12 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2529 assertEquals("12 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2530 assertEquals("12 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2531 assertEquals("12 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2532 assertEquals("12 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2533 assertEquals("12 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2534 assertEquals("12 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2535 assertEquals("12 key fix 5 M0 [B]", 0, params.getColumnPos(10)); 2536 assertEquals("12 key fix 5 M0 [C]", 1, params.getColumnPos(11)); 2537 assertEquals("12 key fix 5 M0 adjust", -1, params.mTopRowAdjustment); 2538 assertEquals("12 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2539 } 2540 2541 // [B] [C] [D] 2542 // [6] [7] [8] [9] [A] 2543 // [1] [2] <3> [4] [5] 2544 @Test testLayout13KeyFix5M0()2545 public void testLayout13KeyFix5M0() { 2546 MoreKeysKeyboardParams params = createParams(13, 5, XPOS_M0); 2547 assertEquals("13 key fix 5 M0 columns", 5, params.mNumColumns); 2548 assertEquals("13 key fix 5 M0 rows", 3, params.mNumRows); 2549 assertEquals("13 key fix 5 M0 left", 2, params.mLeftKeys); 2550 assertEquals("13 key fix 5 M0 right", 3, params.mRightKeys); 2551 assertEquals("13 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2552 assertEquals("13 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2553 assertEquals("13 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2554 assertEquals("13 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2555 assertEquals("13 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2556 assertEquals("13 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2557 assertEquals("13 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2558 assertEquals("13 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2559 assertEquals("13 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2560 assertEquals("13 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2561 assertEquals("13 key fix 5 M0 [B]", -1, params.getColumnPos(10)); 2562 assertEquals("13 key fix 5 M0 [C]", 0, params.getColumnPos(11)); 2563 assertEquals("13 key fix 5 M0 [D]", 1, params.getColumnPos(12)); 2564 assertEquals("13 key fix 5 M0 adjust", 0, params.mTopRowAdjustment); 2565 assertEquals("13 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2566 } 2567 2568 // [B] [C] [D] [E] 2569 // [6] [7] [8] [9] [A] 2570 // [1] [2] <3> [4] [5] 2571 @Test testLayout14KeyFix5M0()2572 public void testLayout14KeyFix5M0() { 2573 MoreKeysKeyboardParams params = createParams(14, 5, XPOS_M0); 2574 assertEquals("14 key fix 5 M0 columns", 5, params.mNumColumns); 2575 assertEquals("14 key fix 5 M0 rows", 3, params.mNumRows); 2576 assertEquals("14 key fix 5 M0 left", 2, params.mLeftKeys); 2577 assertEquals("14 key fix 5 M0 right", 3, params.mRightKeys); 2578 assertEquals("14 key fix 5 M0 [1]", -2, params.getColumnPos(0)); 2579 assertEquals("14 key fix 5 M0 [2]", -1, params.getColumnPos(1)); 2580 assertEquals("14 key fix 5 M0 <3>", 0, params.getColumnPos(2)); 2581 assertEquals("14 key fix 5 M0 [4]", 1, params.getColumnPos(3)); 2582 assertEquals("14 key fix 5 M0 [5]", 2, params.getColumnPos(4)); 2583 assertEquals("14 key fix 5 M0 [6]", -2, params.getColumnPos(5)); 2584 assertEquals("14 key fix 5 M0 [7]", -1, params.getColumnPos(6)); 2585 assertEquals("14 key fix 5 M0 [8]", 0, params.getColumnPos(7)); 2586 assertEquals("14 key fix 5 M0 [9]", 1, params.getColumnPos(8)); 2587 assertEquals("14 key fix 5 M0 [A]", 2, params.getColumnPos(9)); 2588 assertEquals("14 key fix 5 M0 [B]", -1, params.getColumnPos(10)); 2589 assertEquals("14 key fix 5 M0 [C]", 0, params.getColumnPos(11)); 2590 assertEquals("14 key fix 5 M0 [D]", 1, params.getColumnPos(12)); 2591 assertEquals("14 key fix 5 M0 [E]", 2, params.getColumnPos(13)); 2592 assertEquals("14 key fix 5 M0 adjust", -1, params.mTopRowAdjustment); 2593 assertEquals("14 key fix 5 M0 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2594 } 2595 2596 // |<1> [2] [3] [4] [5] [6] [7] 2597 @Test testLayout7KeyFix7L0()2598 public void testLayout7KeyFix7L0() { 2599 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L0); 2600 assertEquals("7 key fix 7 L0 columns", 7, params.mNumColumns); 2601 assertEquals("7 key fix 7 L0 rows", 1, params.mNumRows); 2602 assertEquals("7 key fix 7 L0 left", 0, params.mLeftKeys); 2603 assertEquals("7 key fix 7 L0 right", 7, params.mRightKeys); 2604 assertEquals("7 key fix 7 L0 <1>", 0, params.getColumnPos(0)); 2605 assertEquals("7 key fix 7 L0 [2]", 1, params.getColumnPos(1)); 2606 assertEquals("7 key fix 7 L0 [3]", 2, params.getColumnPos(2)); 2607 assertEquals("7 key fix 7 L0 [4]", 3, params.getColumnPos(3)); 2608 assertEquals("7 key fix 7 L0 [5]", 4, params.getColumnPos(4)); 2609 assertEquals("7 key fix 7 L0 [6]", 5, params.getColumnPos(5)); 2610 assertEquals("7 key fix 7 L0 [7]", 6, params.getColumnPos(6)); 2611 assertEquals("7 key fix 7 L0 adjust", 0, params.mTopRowAdjustment); 2612 assertEquals("7 key fix 7 L0 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2613 } 2614 2615 // |___ <1> [2] [3] [4] [5] [6] [7] 2616 @Test testLayout7KeyFix7L1()2617 public void testLayout7KeyFix7L1() { 2618 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L1); 2619 assertEquals("7 key fix 7 L1 columns", 7, params.mNumColumns); 2620 assertEquals("7 key fix 7 L1 rows", 1, params.mNumRows); 2621 assertEquals("7 key fix 7 L1 left", 0, params.mLeftKeys); 2622 assertEquals("7 key fix 7 L1 right", 7, params.mRightKeys); 2623 assertEquals("7 key fix 7 L1 <1>", 0, params.getColumnPos(0)); 2624 assertEquals("7 key fix 7 L1 [2]", 1, params.getColumnPos(1)); 2625 assertEquals("7 key fix 7 L1 [3]", 2, params.getColumnPos(2)); 2626 assertEquals("7 key fix 7 L1 [4]", 3, params.getColumnPos(3)); 2627 assertEquals("7 key fix 7 L1 [5]", 4, params.getColumnPos(4)); 2628 assertEquals("7 key fix 7 L1 [6]", 5, params.getColumnPos(5)); 2629 assertEquals("7 key fix 7 L1 [7]", 6, params.getColumnPos(6)); 2630 assertEquals("7 key fix 7 L1 adjust", 0, params.mTopRowAdjustment); 2631 assertEquals("7 key fix 7 L1 default", WIDTH * 0, params.getDefaultKeyCoordX()); 2632 } 2633 2634 // |___ [1] <2> [3] [4] [5] [6] [7] 2635 @Test testLayout7KeyFix7L2()2636 public void testLayout7KeyFix7L2() { 2637 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L2); 2638 assertEquals("7 key fix 7 L2 columns", 7, params.mNumColumns); 2639 assertEquals("7 key fix 7 L2 rows", 1, params.mNumRows); 2640 assertEquals("7 key fix 7 L2 left", 1, params.mLeftKeys); 2641 assertEquals("7 key fix 7 L2 right", 6, params.mRightKeys); 2642 assertEquals("7 key fix 7 L2 [1]", -1, params.getColumnPos(0)); 2643 assertEquals("7 key fix 7 L2 <2>", 0, params.getColumnPos(1)); 2644 assertEquals("7 key fix 7 L2 [3]", 1, params.getColumnPos(2)); 2645 assertEquals("7 key fix 7 L2 [4]", 2, params.getColumnPos(3)); 2646 assertEquals("7 key fix 7 L2 [5]", 3, params.getColumnPos(4)); 2647 assertEquals("7 key fix 7 L2 [6]", 4, params.getColumnPos(5)); 2648 assertEquals("7 key fix 7 L2 [7]", 5, params.getColumnPos(6)); 2649 assertEquals("7 key fix 7 L2 adjust", 0, params.mTopRowAdjustment); 2650 assertEquals("7 key fix 7 L2 default", WIDTH * 1, params.getDefaultKeyCoordX()); 2651 } 2652 2653 // |___ [1] [2] <3> [4] [5] [6] [7] 2654 @Test testLayout7KeyFix7L3()2655 public void testLayout7KeyFix7L3() { 2656 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_L3); 2657 assertEquals("7 key fix 7 L3 columns", 7, params.mNumColumns); 2658 assertEquals("7 key fix 7 L3 rows", 1, params.mNumRows); 2659 assertEquals("7 key fix 7 L3 left", 2, params.mLeftKeys); 2660 assertEquals("7 key fix 7 L3 right", 5, params.mRightKeys); 2661 assertEquals("7 key fix 7 L3 [1]", -2, params.getColumnPos(0)); 2662 assertEquals("7 key fix 7 L3 [2]", -1, params.getColumnPos(1)); 2663 assertEquals("7 key fix 7 L3 <3>", 0, params.getColumnPos(2)); 2664 assertEquals("7 key fix 7 L3 [4]", 1, params.getColumnPos(3)); 2665 assertEquals("7 key fix 7 L3 [5]", 2, params.getColumnPos(4)); 2666 assertEquals("7 key fix 7 L3 [6]", 3, params.getColumnPos(5)); 2667 assertEquals("7 key fix 7 L3 [7]", 4, params.getColumnPos(6)); 2668 assertEquals("7 key fix 7 L3 adjust", 0, params.mTopRowAdjustment); 2669 assertEquals("7 key fix 7 L3 default", WIDTH * 2, params.getDefaultKeyCoordX()); 2670 } 2671 2672 // |___ [1] [2] [3] <4> [5] [6] [7] ___ ___| 2673 @Test testLayout7KeyFix7M0()2674 public void testLayout7KeyFix7M0() { 2675 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_M0); 2676 assertEquals("7 key fix 7 M0 columns", 7, params.mNumColumns); 2677 assertEquals("7 key fix 7 M0 rows", 1, params.mNumRows); 2678 assertEquals("7 key fix 7 M0 left", 3, params.mLeftKeys); 2679 assertEquals("7 key fix 7 M0 right", 4, params.mRightKeys); 2680 assertEquals("7 key fix 7 M0 [1]", -3, params.getColumnPos(0)); 2681 assertEquals("7 key fix 7 M0 [2]", -2, params.getColumnPos(1)); 2682 assertEquals("7 key fix 7 M0 [3]", -1, params.getColumnPos(2)); 2683 assertEquals("7 key fix 7 M0 <4>", 0, params.getColumnPos(3)); 2684 assertEquals("7 key fix 7 M0 [5]", 1, params.getColumnPos(4)); 2685 assertEquals("7 key fix 7 M0 [6]", 2, params.getColumnPos(5)); 2686 assertEquals("7 key fix 7 M0 [7]", 3, params.getColumnPos(6)); 2687 assertEquals("7 key fix 7 M0 adjust", 0, params.mTopRowAdjustment); 2688 assertEquals("7 key fix 7 M0 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2689 } 2690 2691 // |___ ___ [1] [2] [3] <4> [5] [6] [7] ___| 2692 @Test testLayout7KeyFix7M1()2693 public void testLayout7KeyFix7M1() { 2694 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_M1); 2695 assertEquals("7 key fix 7 M1 columns", 7, params.mNumColumns); 2696 assertEquals("7 key fix 7 M1 rows", 1, params.mNumRows); 2697 assertEquals("7 key fix 7 M1 left", 3, params.mLeftKeys); 2698 assertEquals("7 key fix 7 M1 right", 4, params.mRightKeys); 2699 assertEquals("7 key fix 7 M1 [1]", -3, params.getColumnPos(0)); 2700 assertEquals("7 key fix 7 M1 [2]", -2, params.getColumnPos(1)); 2701 assertEquals("7 key fix 7 M1 [3]", -1, params.getColumnPos(2)); 2702 assertEquals("7 key fix 7 M1 <4>", 0, params.getColumnPos(3)); 2703 assertEquals("7 key fix 7 M1 [5]", 1, params.getColumnPos(4)); 2704 assertEquals("7 key fix 7 M1 [6]", 2, params.getColumnPos(5)); 2705 assertEquals("7 key fix 7 M1 [7]", 3, params.getColumnPos(6)); 2706 assertEquals("7 key fix 7 M1 adjust", 0, params.mTopRowAdjustment); 2707 assertEquals("7 key fix 7 M1 default", WIDTH * 3, params.getDefaultKeyCoordX()); 2708 } 2709 2710 // [1] [2] [3] [4] <5> [6] [7] ___| 2711 @Test testLayout7KeyFix7R3()2712 public void testLayout7KeyFix7R3() { 2713 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R3); 2714 assertEquals("7 key fix 7 R3 columns", 7, params.mNumColumns); 2715 assertEquals("7 key fix 7 R3 rows", 1, params.mNumRows); 2716 assertEquals("7 key fix 7 R3 left", 4, params.mLeftKeys); 2717 assertEquals("7 key fix 7 R3 right", 3, params.mRightKeys); 2718 assertEquals("7 key fix 7 R3 [1]", -4, params.getColumnPos(0)); 2719 assertEquals("7 key fix 7 R3 [2]", -3, params.getColumnPos(1)); 2720 assertEquals("7 key fix 7 R3 [3]", -2, params.getColumnPos(2)); 2721 assertEquals("7 key fix 7 R3 [4]", -1, params.getColumnPos(3)); 2722 assertEquals("7 key fix 7 R3 <5>", 0, params.getColumnPos(4)); 2723 assertEquals("7 key fix 7 R3 [6]", 1, params.getColumnPos(5)); 2724 assertEquals("7 key fix 7 R3 [7]", 2, params.getColumnPos(6)); 2725 assertEquals("7 key fix 7 R3 adjust", 0, params.mTopRowAdjustment); 2726 assertEquals("7 key fix 7 R3 default", WIDTH * 4, params.getDefaultKeyCoordX()); 2727 } 2728 2729 // [1] [2] [3] [4] [5] <6> [7] ___| 2730 @Test testLayout7KeyFix7R2()2731 public void testLayout7KeyFix7R2() { 2732 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R2); 2733 assertEquals("7 key fix 7 R2 columns", 7, params.mNumColumns); 2734 assertEquals("7 key fix 7 R2 rows", 1, params.mNumRows); 2735 assertEquals("7 key fix 7 R2 left", 5, params.mLeftKeys); 2736 assertEquals("7 key fix 7 R2 right", 2, params.mRightKeys); 2737 assertEquals("7 key fix 7 R2 [1]", -5, params.getColumnPos(0)); 2738 assertEquals("7 key fix 7 R2 [2]", -4, params.getColumnPos(1)); 2739 assertEquals("7 key fix 7 R2 [3]", -3, params.getColumnPos(2)); 2740 assertEquals("7 key fix 7 R2 [4]", -2, params.getColumnPos(3)); 2741 assertEquals("7 key fix 7 R2 [5]", -1, params.getColumnPos(4)); 2742 assertEquals("7 key fix 7 R2 <6>", 0, params.getColumnPos(5)); 2743 assertEquals("7 key fix 7 R2 [7]", 1, params.getColumnPos(6)); 2744 assertEquals("7 key fix 7 R2 adjust", 0, params.mTopRowAdjustment); 2745 assertEquals("7 key fix 7 R2 default", WIDTH * 5, params.getDefaultKeyCoordX()); 2746 } 2747 2748 // [1] [2] [3] [4] [5] [6] <7> ___| 2749 @Test testLayout7KeyFix7R1()2750 public void testLayout7KeyFix7R1() { 2751 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R1); 2752 assertEquals("7 key fix 7 R1 columns", 7, params.mNumColumns); 2753 assertEquals("7 key fix 7 R1 rows", 1, params.mNumRows); 2754 assertEquals("7 key fix 7 R1 left", 6, params.mLeftKeys); 2755 assertEquals("7 key fix 7 R1 right", 1, params.mRightKeys); 2756 assertEquals("7 key fix 7 R1 [1]", -6, params.getColumnPos(0)); 2757 assertEquals("7 key fix 7 R1 [2]", -5, params.getColumnPos(1)); 2758 assertEquals("7 key fix 7 R1 [3]", -4, params.getColumnPos(2)); 2759 assertEquals("7 key fix 7 R1 [4]", -3, params.getColumnPos(3)); 2760 assertEquals("7 key fix 7 R1 [5]", -2, params.getColumnPos(4)); 2761 assertEquals("7 key fix 7 R1 [6]", -1, params.getColumnPos(5)); 2762 assertEquals("7 key fix 7 R1 <7>", 0, params.getColumnPos(6)); 2763 assertEquals("7 key fix 7 R1 adjust", 0, params.mTopRowAdjustment); 2764 assertEquals("7 key fix 7 R1 default", WIDTH * 6, params.getDefaultKeyCoordX()); 2765 } 2766 2767 // [1] [2] [3] [4] [5] [6] <7>| 2768 @Test testLayout7KeyFix7R0()2769 public void testLayout7KeyFix7R0() { 2770 MoreKeysKeyboardParams params = createParams(7, 7, XPOS_R0); 2771 assertEquals("7 key fix 7 R0 columns", 7, params.mNumColumns); 2772 assertEquals("7 key fix 7 R0 rows", 1, params.mNumRows); 2773 assertEquals("7 key fix 7 R0 left", 6, params.mLeftKeys); 2774 assertEquals("7 key fix 7 R0 right", 1, params.mRightKeys); 2775 assertEquals("7 key fix 7 R0 [1]", -6, params.getColumnPos(0)); 2776 assertEquals("7 key fix 7 R0 [2]", -5, params.getColumnPos(1)); 2777 assertEquals("7 key fix 7 R0 [3]", -4, params.getColumnPos(2)); 2778 assertEquals("7 key fix 7 R0 [4]", -3, params.getColumnPos(3)); 2779 assertEquals("7 key fix 7 R0 [5]", -2, params.getColumnPos(4)); 2780 assertEquals("7 key fix 7 R0 [6]", -1, params.getColumnPos(5)); 2781 assertEquals("7 key fix 7 R0 <7>", 0, params.getColumnPos(6)); 2782 assertEquals("7 key fix 7 R0 adjust", 0, params.mTopRowAdjustment); 2783 assertEquals("7 key fix 7 R0 default", WIDTH * 6, params.getDefaultKeyCoordX()); 2784 } 2785 } 2786