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.java44 SparseLongArray sparseArray = new SparseLongArray(); in testSparseArrayWithDefaultCapacity() local
45 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
50 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
51 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
55 assertEquals(i, sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
59 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
66 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
67 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
68 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
69 assertEquals(newValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
[all …]
DLongSparseArrayTest.java46 LongSparseArray<Integer> sparseArray = new LongSparseArray<>(); in testSparseArrayWithDefaultCapacity() local
47 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
52 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
53 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
57 assertEquals(new Integer(i), sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
61 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
68 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
69 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
70 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
71 assertEquals(newValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
[all …]
DSparseArrayTest.java43 SparseArray<Integer> sparseArray = new SparseArray<>(); in testSparseArrayWithDefaultCapacity() local
44 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
49 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
50 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
54 assertEquals(new Integer(i), sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
58 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
65 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
66 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
67 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
68 assertEquals(newValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
[all …]
DSparseBooleanArrayTest.java155 SparseBooleanArray sparseArray = new SparseBooleanArray(); in testIterationOrder() local
157 sparseArray.put(1, true); in testIterationOrder()
158 sparseArray.put(10, false); in testIterationOrder()
159 sparseArray.put(5, true); in testIterationOrder()
160 sparseArray.put(Integer.MAX_VALUE, false); in testIterationOrder()
162 assertEquals(1, sparseArray.keyAt(0)); in testIterationOrder()
163 assertEquals(5, sparseArray.keyAt(1)); in testIterationOrder()
164 assertEquals(10, sparseArray.keyAt(2)); in testIterationOrder()
165 assertEquals(Integer.MAX_VALUE, sparseArray.keyAt(3)); in testIterationOrder()
167 assertEquals(true, sparseArray.valueAt(0)); in testIterationOrder()
[all …]
DSparseIntArrayTest.java181 SparseIntArray sparseArray = new SparseIntArray(); in testIterationOrder() local
183 sparseArray.put(1, 2); in testIterationOrder()
184 sparseArray.put(10, 20); in testIterationOrder()
185 sparseArray.put(5, 40); in testIterationOrder()
186 sparseArray.put(Integer.MAX_VALUE, Integer.MIN_VALUE); in testIterationOrder()
188 assertEquals(1, sparseArray.keyAt(0)); in testIterationOrder()
189 assertEquals(5, sparseArray.keyAt(1)); in testIterationOrder()
190 assertEquals(10, sparseArray.keyAt(2)); in testIterationOrder()
191 assertEquals(Integer.MAX_VALUE, sparseArray.keyAt(3)); in testIterationOrder()
193 assertEquals(2, sparseArray.valueAt(0)); in testIterationOrder()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DParcelTest.java388 SparseArray<Object> sparseArray = new SparseArray<Object>(); in testReadValue() local
389 sparseArray.put(3, "String"); in testReadValue()
390 sparseArray.put(2, Long.MAX_VALUE); in testReadValue()
391 sparseArray.put(4, Float.MAX_VALUE); in testReadValue()
392 sparseArray.put(0, Integer.MAX_VALUE); in testReadValue()
393 sparseArray.put(1, true); in testReadValue()
394 sparseArray.put(10, true); in testReadValue()
397 p.writeValue(sparseArray); in testReadValue()
401 assertEquals(sparseArray.size(), sparseArray2.size()); in testReadValue()
402 assertEquals(sparseArray.get(0), sparseArray2.get(0)); in testReadValue()
[all …]
DBundleTest.java596 final SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testGetSparseParcelableArray() local
599 sparseArray.put(1006, bundle); in testGetSparseParcelableArray()
600 sparseArray.put(1007, intent); in testGetSparseParcelableArray()
601 mBundle.putSparseParcelableArray(KEY, sparseArray); in testGetSparseParcelableArray()
743 SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testHasFileDescriptorsOnNullValuedCollection() local
744 sparseArray.put(0, null); in testHasFileDescriptorsOnNullValuedCollection()
745 mBundle.putSparseParcelableArray("bar", sparseArray); in testHasFileDescriptorsOnNullValuedCollection()
/cts/tests/tests/widget/src/android/widget/cts/
DAdapterViewTest.java435 SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testDispatchRestoreInstanceState() local
436 adapterView.dispatchRestoreInstanceState(sparseArray); in testDispatchRestoreInstanceState()