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.java50 SparseArray<Integer> sparseArray = new SparseArray<>(); in testSparseArrayWithDefaultCapacity() local
51 assertEquals(0, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
56 sparseArray.put(KEYS[i], VALUES[i]); in testSparseArrayWithDefaultCapacity()
57 assertEquals(i + 1, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
61 assertEquals(new Integer(i), sparseArray.get(KEYS[i])); in testSparseArrayWithDefaultCapacity()
65 assertEquals(sparseArray.indexOfValue(VALUES[i]), sparseArray.indexOfKey(KEYS[i])); in testSparseArrayWithDefaultCapacity()
72 assertEquals(oldValue, sparseArray.get(existKey)); in testSparseArrayWithDefaultCapacity()
73 assertEquals(LENGTH, sparseArray.size()); in testSparseArrayWithDefaultCapacity()
74 sparseArray.put(existKey, newValue); in testSparseArrayWithDefaultCapacity()
75 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.java542 SparseArray<Object> sparseArray = new SparseArray<Object>(); in testReadValue() local
543 sparseArray.put(3, "String"); in testReadValue()
544 sparseArray.put(2, Long.MAX_VALUE); in testReadValue()
545 sparseArray.put(4, Float.MAX_VALUE); in testReadValue()
546 sparseArray.put(0, Integer.MAX_VALUE); in testReadValue()
547 sparseArray.put(1, true); in testReadValue()
548 sparseArray.put(10, true); in testReadValue()
551 p.writeValue(sparseArray); in testReadValue()
555 assertEquals(sparseArray.size(), sparseArray2.size()); in testReadValue()
556 assertEquals(sparseArray.get(0), sparseArray2.get(0)); in testReadValue()
[all …]
DBundleTest.java806 final SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testGetSparseParcelableArray() local
809 sparseArray.put(1006, bundle); in testGetSparseParcelableArray()
810 sparseArray.put(1007, custom); in testGetSparseParcelableArray()
811 mBundle.putSparseParcelableArray(KEY1, sparseArray); in testGetSparseParcelableArray()
1105 SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testHasFileDescriptorsOnNullValuedCollection() local
1106 sparseArray.put(0, null); in testHasFileDescriptorsOnNullValuedCollection()
1107 mBundle.putSparseParcelableArray("bar", sparseArray); in testHasFileDescriptorsOnNullValuedCollection()
/cts/tests/tests/widget/src/android/widget/cts/
DAdapterViewTest.java456 SparseArray<Parcelable> sparseArray = new SparseArray<Parcelable>(); in testDispatchRestoreInstanceState() local
457 adapterView.dispatchRestoreInstanceState(sparseArray); in testDispatchRestoreInstanceState()