diff options
author | 2018-07-06 10:10:54 -0700 | |
---|---|---|
committer | 2018-07-06 10:10:54 -0700 | |
commit | d3b93cc95061ada6a162d7989e313f818e6d4e15 (patch) | |
tree | a4e3eaee6b84d20817d82b2a263e0e47bcc98753 /tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java | |
parent | a497886dda70bbd401652560d11d8f4010985e96 (diff) | |
download | latinime-d3b93cc95061ada6a162d7989e313f818e6d4e15.tar.gz latinime-d3b93cc95061ada6a162d7989e313f818e6d4e15.tar.xz latinime-d3b93cc95061ada6a162d7989e313f818e6d4e15.zip |
Migrate to Android Testing Support Lib (part 5/N)
This CL converts 19 test classes under com.android.inputmethod.latin
to Android Testing Support Library.
Bug: 110805255
Test: verified as follows. No new test failures.
tapas adb LatinIME LatinIMETests arm64 userdebug && \
DISABLE_PROGUARD=true make -j LatinIME && \
adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \
atest LatinIMETests:com.android.inputmethod.latin
Change-Id: I878fcae0126f57c43a644af341e5a0a8ac8f5cc9
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java b/tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java index bd1629faf..d9b6bad75 100644 --- a/tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java +++ b/tests/src/com/android/inputmethod/latin/common/ResizableIntArrayTests.java @@ -16,15 +16,27 @@ package com.android.inputmethod.latin.common; -import android.test.AndroidTestCase; -import android.test.suitebuilder.annotation.SmallTest; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import android.support.test.filters.SmallTest; +import android.support.test.runner.AndroidJUnit4; import java.util.Arrays; +import org.junit.Test; +import org.junit.runner.RunWith; + @SmallTest -public class ResizableIntArrayTests extends AndroidTestCase { +@RunWith(AndroidJUnit4.class) +public class ResizableIntArrayTests { private static final int DEFAULT_CAPACITY = 48; + @Test public void testNewInstance() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int[] array = src.getPrimitiveArray(); @@ -33,6 +45,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { assertEquals("new instance array length", DEFAULT_CAPACITY, array.length); } + @Test public void testAdd() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int[] array = src.getPrimitiveArray(); @@ -62,6 +75,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { } } + @Test public void testAddAt() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int limit = DEFAULT_CAPACITY * 10, step = DEFAULT_CAPACITY * 2; @@ -76,6 +90,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { } } + @Test public void testGet() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); try { @@ -105,6 +120,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { } } + @Test public void testReset() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int[] array = src.getPrimitiveArray(); @@ -136,6 +152,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { } } + @Test public void testSetLength() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int[] array = src.getPrimitiveArray(); @@ -172,6 +189,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { } } + @Test public void testSet() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int limit = DEFAULT_CAPACITY * 2 + 10; @@ -186,6 +204,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { assertSame("array after set", dst.getPrimitiveArray(), src.getPrimitiveArray()); } + @Test public void testCopy() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); for (int i = 0; i < DEFAULT_CAPACITY; i++) { @@ -214,6 +233,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { dst.getPrimitiveArray(), 0, src.getPrimitiveArray(), 0, dst.getLength()); } + @Test public void testAppend() { final int srcLength = DEFAULT_CAPACITY; final ResizableIntArray src = new ResizableIntArray(srcLength); @@ -264,6 +284,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { srcLength); } + @Test public void testFill() { final int srcLength = DEFAULT_CAPACITY; final ResizableIntArray src = new ResizableIntArray(srcLength); @@ -359,6 +380,7 @@ public class ResizableIntArrayTests extends AndroidTestCase { } } + @Test public void testShift() { final ResizableIntArray src = new ResizableIntArray(DEFAULT_CAPACITY); final int limit = DEFAULT_CAPACITY * 10; |