aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-03-13 17:50:04 -0700
committerMohammadinamul Sheik <inamul@google.com>2015-03-13 17:50:04 -0700
commit54bf24f64b9bbd4c5e4b6d4c3c6144c047d6ddc6 (patch)
tree23b9077021facc413cb0d4676b8c9296d9971122 /common/src/com/android/inputmethod/latin
parent93d2ab38577fb3d7c919bc4fd19a769f5c93e654 (diff)
downloadlatinime-54bf24f64b9bbd4c5e4b6d4c3c6144c047d6ddc6.tar.gz
latinime-54bf24f64b9bbd4c5e4b6d4c3c6144c047d6ddc6.tar.xz
latinime-54bf24f64b9bbd4c5e4b6d4c3c6144c047d6ddc6.zip
Fix a couple of unit tests.
Change-Id: I4ade90fbfdb10cd5cd4980638946871e473e4d20
Diffstat (limited to 'common/src/com/android/inputmethod/latin')
-rw-r--r--common/src/com/android/inputmethod/latin/common/CollectionUtils.java3
-rw-r--r--common/src/com/android/inputmethod/latin/common/InputPointers.java1
-rw-r--r--common/src/com/android/inputmethod/latin/common/ResizableIntArray.java3
3 files changed, 7 insertions, 0 deletions
diff --git a/common/src/com/android/inputmethod/latin/common/CollectionUtils.java b/common/src/com/android/inputmethod/latin/common/CollectionUtils.java
index f7ba693af..48df413fd 100644
--- a/common/src/com/android/inputmethod/latin/common/CollectionUtils.java
+++ b/common/src/com/android/inputmethod/latin/common/CollectionUtils.java
@@ -16,6 +16,8 @@
package com.android.inputmethod.latin.common;
+import com.android.inputmethod.annotations.UsedForTesting;
+
import java.util.ArrayList;
import java.util.Collection;
@@ -57,6 +59,7 @@ public final class CollectionUtils {
* @param c Collection to test.
* @return Whether c contains no elements.
*/
+ @UsedForTesting
public static boolean isNullOrEmpty(@Nullable final Collection<?> c) {
return c == null || c.isEmpty();
}
diff --git a/common/src/com/android/inputmethod/latin/common/InputPointers.java b/common/src/com/android/inputmethod/latin/common/InputPointers.java
index 7beee1536..4b2ae7e76 100644
--- a/common/src/com/android/inputmethod/latin/common/InputPointers.java
+++ b/common/src/com/android/inputmethod/latin/common/InputPointers.java
@@ -112,6 +112,7 @@ public final class InputPointers {
* Shift to the left by elementCount, discarding elementCount pointers at the start.
* @param elementCount how many elements to shift.
*/
+ @UsedForTesting
public void shift(final int elementCount) {
mXCoordinates.shift(elementCount);
mYCoordinates.shift(elementCount);
diff --git a/common/src/com/android/inputmethod/latin/common/ResizableIntArray.java b/common/src/com/android/inputmethod/latin/common/ResizableIntArray.java
index 340abb23e..77f5c4cd5 100644
--- a/common/src/com/android/inputmethod/latin/common/ResizableIntArray.java
+++ b/common/src/com/android/inputmethod/latin/common/ResizableIntArray.java
@@ -16,6 +16,8 @@
package com.android.inputmethod.latin.common;
+import com.android.inputmethod.annotations.UsedForTesting;
+
import java.util.Arrays;
import javax.annotation.Nonnull;
@@ -140,6 +142,7 @@ public final class ResizableIntArray {
* Shift to the left by elementCount, discarding elementCount pointers at the start.
* @param elementCount how many elements to shift.
*/
+ @UsedForTesting
public void shift(final int elementCount) {
System.arraycopy(mArray, elementCount, mArray, 0, mLength - elementCount);
mLength -= elementCount;