Home
last modified time | relevance | path

Searched refs:sparseArray (Results 1 – 8 of 8) sorted by relevance

/cts/tests/tests/util/src/android/util/cts/
DSparseLongArrayTest.java34 SparseLongArray sparseArray = new SparseLongArray(); in testSparseArrayWithDefaultCapacity() local
35 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
40 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
41 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
45 assertEquals(i, sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
49 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
56 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
57 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
58 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
59 assertEquals(newValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
[all …]
DLongSparseArrayTest.java34 LongSparseArray<Integer> sparseArray = new LongSparseArray<Integer>(); in testSparseArrayWithDefaultCapacity() local
35 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
40 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
41 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
45 assertEquals(new Integer(i), sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
49 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
56 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
57 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
58 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
59 assertEquals(newValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
[all …]
DSparseArrayTest.java30 SparseArray<Integer> sparseArray = new SparseArray<Integer>(); in testSparseArrayWithDefaultCapacity() local
31 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
36 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
37 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
41 assertEquals(new Integer(i), sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
45 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
52 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
53 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
54 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
55 assertEquals(newValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
[all …]
DSparseBooleanArrayTest.java147 SparseBooleanArray sparseArray = new SparseBooleanArray(); in testIterationOrder() local
149 sparseArray.put(1, true); in testIterationOrder()
150 sparseArray.put(10, false); in testIterationOrder()
151 sparseArray.put(5, true); in testIterationOrder()
152 sparseArray.put(Integer.MAX_VALUE, false); in testIterationOrder()
154 assertEquals(1, sparseArray.keyAt(0)); in testIterationOrder()
155 assertEquals(5, sparseArray.keyAt(1)); in testIterationOrder()
156 assertEquals(10, sparseArray.keyAt(2)); in testIterationOrder()
157 assertEquals(Integer.MAX_VALUE, sparseArray.keyAt(3)); in testIterationOrder()
159 assertEquals(true, sparseArray.valueAt(0)); in testIterationOrder()
[all …]
DSparseIntArrayTest.java175 SparseIntArray sparseArray = new SparseIntArray(); in testIterationOrder() local
177 sparseArray.put(1, 2); in testIterationOrder()
178 sparseArray.put(10, 20); in testIterationOrder()
179 sparseArray.put(5, 40); in testIterationOrder()
180 sparseArray.put(Integer.MAX_VALUE, Integer.MIN_VALUE); in testIterationOrder()
182 assertEquals(1, sparseArray.keyAt(0)); in testIterationOrder()
183 assertEquals(5, sparseArray.keyAt(1)); in testIterationOrder()
184 assertEquals(10, sparseArray.keyAt(2)); in testIterationOrder()
185 assertEquals(Integer.MAX_VALUE, sparseArray.keyAt(3)); in testIterationOrder()
187 assertEquals(2, sparseArray.valueAt(0)); in testIterationOrder()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DParcelTest.java374 SparseArray<Object> sparseArray = new SparseArray<Object>(); in testReadValue() local
375 sparseArray.put(3, "String"); in testReadValue()
376 sparseArray.put(2, Long.MAX_VALUE); in testReadValue()
377 sparseArray.put(4, Float.MAX_VALUE); in testReadValue()
378 sparseArray.put(0, Integer.MAX_VALUE); in testReadValue()
379 sparseArray.put(1, true); in testReadValue()
380 sparseArray.put(10, true); in testReadValue()
383 p.writeValue(sparseArray); in testReadValue()
387 assertEquals(sparseArray.size(), sparseArray2.size()); in testReadValue()
388 assertEquals(sparseArray.get(0), sparseArray2.get(0)); in testReadValue()
[all …]
DBundleTest.java593 final SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testGetSparseParcelableArray() local
596 sparseArray.put(1006, bundle); in testGetSparseParcelableArray()
597 sparseArray.put(1007, intent); in testGetSparseParcelableArray()
598 mBundle.putSparseParcelableArray(KEY, sparseArray); in testGetSparseParcelableArray()
740 SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testHasFileDescriptorsOnNullValuedCollection() local
741 sparseArray.put(0, null); in testHasFileDescriptorsOnNullValuedCollection()
742 mBundle.putSparseParcelableArray("bar", sparseArray); in testHasFileDescriptorsOnNullValuedCollection()
/cts/tests/tests/widget/src/android/widget/cts/
DAdapterViewTest.java407 SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testDispatchRestoreInstanceState() local
408 adapterView.dispatchRestoreInstanceState(sparseArray); in testDispatchRestoreInstanceState()