/libcore/luni/src/test/java/libcore/java/util/concurrent/ |
D | AtomicIntegerArrayTest.java | 32 for (int i = 0; i < expected.length; ++i) { in checkArrayAsExpected() 33 assertEquals(expected[i], actual.get(i)); in checkArrayAsExpected() 41 for (int i = arr.length() - 1; i >= 0; --i) { in testCompareAndExchange() 42 assertEquals(expectedArray[i], arr.compareAndExchange(i, 0, i+1)); in testCompareAndExchange() 45 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], i+1)); in testCompareAndExchange() 46 assertEquals(i+1, arr.get(i)); in testCompareAndExchange() 47 expectedArray[i] = i+1; in testCompareAndExchange() 50 assertEquals(i+1, arr.compareAndExchange(i, i+1, -1)); in testCompareAndExchange() 51 assertEquals(-1, arr.get(i)); in testCompareAndExchange() 52 expectedArray[i] = -1; in testCompareAndExchange() [all …]
|
D | AtomicLongArrayTest.java | 32 for (int i = 0; i < expected.length; ++i) { in checkArrayAsExpected() 33 assertEquals(expected[i], actual.get(i)); in checkArrayAsExpected() 41 for (int i = 0; i < arr.length(); ++i) { in testCompareAndExchange() 42 assertEquals(expectedArray[i], arr.compareAndExchange(i, 0, i+1)); in testCompareAndExchange() 45 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], i+1)); in testCompareAndExchange() 46 assertEquals(i+1, arr.get(i)); in testCompareAndExchange() 47 expectedArray[i] = i+1; in testCompareAndExchange() 50 assertEquals(i+1, arr.compareAndExchange(i, i+1, -1)); in testCompareAndExchange() 51 assertEquals(-1, arr.get(i)); in testCompareAndExchange() 52 expectedArray[i] = -1; in testCompareAndExchange() [all …]
|
D | AtomicReferenceArrayTest.java | 33 for (int i = 0; i < expected.length; ++i) { in checkArrayAsExpected() 34 assertSame(expected[i], actual.get(i)); in checkArrayAsExpected() 47 for (int i = 0; i < arr.length(); ++i) { in testCompareAndExchange() 48 Integer val = Integer.valueOf(i+1); in testCompareAndExchange() 49 assertEquals(expectedArray[i], arr.compareAndExchange(i, Integer.valueOf(0), val)); in testCompareAndExchange() 52 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], val)); in testCompareAndExchange() 53 assertSame(val, arr.get(i)); in testCompareAndExchange() 54 assertEquals(i+1, arr.get(i).intValue()); in testCompareAndExchange() 55 expectedArray[i] = val; in testCompareAndExchange() 59 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], val)); in testCompareAndExchange() [all …]
|
/libcore/benchmarks/src/benchmarks/ |
D | InvokeInterface.java | 28 for (int i = 0; i < nreps; i++) { in timeCall0Concrete() 35 for (int i = 0; i < nreps; i++) { in timeCall0Interface() 42 for (int i = 0; i < nreps; i++) { in timeCall1Interface() 49 for (int i = 0; i < nreps; i++) { in timeCall2Interface() 56 for (int i = 0; i < nreps; i++) { in timeCall3Interface() 63 for (int i = 0; i < nreps; i++) { in timeCall4Interface() 70 for (int i = 0; i < nreps; i++) { in timeCall5Interface() 77 for (int i = 0; i < nreps; i++) { in timeCall6Interface() 84 for (int i = 0; i < nreps; i++) { in timeCall7Interface() 91 for (int i = 0; i < nreps; i++) { in timeCall8Interface() [all …]
|
D | DeepArrayOpsBenchmark.java | 35 for (int i = 0; i < arrayLength; i += 14) { in setUp() 36 array[i] = new IntWrapper(i); in setUp() 37 array2[i] = new IntWrapper(i); in setUp() 39 array[i + 1] = new16ElementObjectarray(); in setUp() 40 array2[i + 1] = new16ElementObjectarray(); in setUp() 42 array[i + 2] = new boolean[16]; in setUp() 43 array2[i + 2] = new boolean[16]; in setUp() 45 array[i + 3] = new byte[16]; in setUp() 46 array2[i + 3] = new byte[16]; in setUp() 48 array[i + 4] = new char[16]; in setUp() [all …]
|
/libcore/ojluni/src/test/java/util/Arrays/ |
D | SortingNearlySortedPrimitive.java | 106 for (int i : l) { in arrayToString() 107 sj.add(Integer.toString(i)); in arrayToString() 110 for (int i : r) { in arrayToString() 111 sj.add(Integer.toString(i)); in arrayToString() 161 for (int i = 0; i < result.length; i++) { in floatCopyFromInt() 162 result[i] = src[i]; in floatCopyFromInt() 169 for (int i = 0; i < result.length; i++) { in doubleCopyFromInt() 170 result[i] = src[i]; in doubleCopyFromInt() 177 for (int i = 0; i < result.length; i++) { in longCopyFromInt() 178 result[i] = src[i]; in longCopyFromInt() [all …]
|
D | Sorting.java | 321 for (int i = 0; i < test.length; i++) { in testSubArray() 323 ", m = " + m + ", " + getType(i)); in testSubArray() 324 sortingHelper.sort(test[i], fromIndex, toIndex); in testSubArray() 325 checkSubArray(test[i], fromIndex, toIndex); in testSubArray() 336 for (int i = 1; i <= length; i++) { in testRange() 337 ((int[]) gold[0])[i - 1] = i % m + m % i; in testRange() 341 for (int i = 0; i < test.length; i++) { in testRange() 343 ", m = " + m + ", " + getType(i)); in testRange() 344 checkRange(test[i], m); in testRange() 351 for (int i = 0; i < a.length - 1; i++) { in checkSorted() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/xml/sax/ |
D | InputSourceTest.java | 31 InputSource i = new InputSource(); in testInputSource() local 33 assertNull(i.getByteStream()); in testInputSource() 34 assertNull(i.getCharacterStream()); in testInputSource() 35 assertNull(i.getEncoding()); in testInputSource() 36 assertNull(i.getPublicId()); in testInputSource() 37 assertNull(i.getSystemId()); in testInputSource() 41 InputSource i = new InputSource("Foo"); in testInputSourceString() local 43 assertNull(i.getByteStream()); in testInputSourceString() 44 assertNull(i.getCharacterStream()); in testInputSourceString() 45 assertNull(i.getEncoding()); in testInputSourceString() [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | AtomicIntegerArrayTest.java | 57 for (int i = 0; i < SIZE; i++) in testConstructor() 58 assertEquals(0, aa.get(i)); in testConstructor() 79 for (int i = 0; i < a.length; i++) in testConstructor2() 80 assertEquals(a[i], aa.get(i)); in testConstructor2() 125 for (int i = 0; i < SIZE; i++) { in testGetSet() 126 aa.set(i, 1); in testGetSet() 127 assertEquals(1, aa.get(i)); in testGetSet() 128 aa.set(i, 2); in testGetSet() 129 assertEquals(2, aa.get(i)); in testGetSet() 130 aa.set(i, -3); in testGetSet() [all …]
|
D | AtomicLongArrayTest.java | 56 for (int i = 0; i < SIZE; i++) in testConstructor() 57 assertEquals(0, aa.get(i)); in testConstructor() 78 for (int i = 0; i < a.length; i++) in testConstructor2() 79 assertEquals(a[i], aa.get(i)); in testConstructor2() 124 for (int i = 0; i < SIZE; i++) { in testGetSet() 125 aa.set(i, 1); in testGetSet() 126 assertEquals(1, aa.get(i)); in testGetSet() 127 aa.set(i, 2); in testGetSet() 128 assertEquals(2, aa.get(i)); in testGetSet() 129 aa.set(i, -3); in testGetSet() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | AtomicLongArrayTest.java | 33 for (int i = 0; i < SIZE; i++) in testConstructor() 34 assertEquals(0, aa.get(i)); in testConstructor() 55 for (int i = 0; i < a.length; i++) in testConstructor2() 56 assertEquals(a[i], aa.get(i)); in testConstructor2() 101 for (int i = 0; i < SIZE; i++) { in testGetSet() 102 aa.set(i, 1); in testGetSet() 103 assertEquals(1, aa.get(i)); in testGetSet() 104 aa.set(i, 2); in testGetSet() 105 assertEquals(2, aa.get(i)); in testGetSet() 106 aa.set(i, -3); in testGetSet() [all …]
|
D | AtomicIntegerArrayTest.java | 34 for (int i = 0; i < SIZE; i++) in testConstructor() 35 assertEquals(0, aa.get(i)); in testConstructor() 56 for (int i = 0; i < a.length; i++) in testConstructor2() 57 assertEquals(a[i], aa.get(i)); in testConstructor2() 102 for (int i = 0; i < SIZE; i++) { in testGetSet() 103 aa.set(i, 1); in testGetSet() 104 assertEquals(1, aa.get(i)); in testGetSet() 105 aa.set(i, 2); in testGetSet() 106 assertEquals(2, aa.get(i)); in testGetSet() 107 aa.set(i, -3); in testGetSet() [all …]
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | CharacterBenchmark.java | 51 for (int i = 0; i < 65536; ++i) { in CharacterSet() 52 chars[i] = (char) (i % size); in CharacterSet() 61 for (int i = 0; i < reps; ++i) { in timeIsSpace() 67 for (int i = 0; i < reps; ++i) { in timeIsSpace() 78 for (int i = 0; i < reps; ++i) { in timeDigit() 84 for (int i = 0; i < reps; ++i) { in timeDigit() 94 for (int i = 0; i < reps; ++i) { in timeGetNumericValue() 100 for (int i = 0; i < reps; ++i) { in timeGetNumericValue() 110 for (int i = 0; i < reps; ++i) { in timeIsDigit() 116 for (int i = 0; i < reps; ++i) { in timeIsDigit() [all …]
|
D | AnnotatedElementBenchmark.java | 42 for (int i = 0; i < reps; i++) { in timeGetTypeAnnotations() 48 for (int i = 0; i < reps; i++) { in timeGetFieldAnnotations() 54 for (int i = 0; i < reps; i++) { in timeGetMethodAnnotations() 60 for (int i = 0; i < reps; i++) { in timeGetParameterAnnotations() 66 for (int i = 0; i < reps; i++) { in timeGetTypeAnnotation() 72 for (int i = 0; i < reps; i++) { in timeGetFieldAnnotation() 78 for (int i = 0; i < reps; i++) { in timeGetMethodAnnotation() 84 for (int i = 0; i < reps; i++) { in timeIsTypeAnnotationPresent() 90 for (int i = 0; i < reps; i++) { in timeIsFieldAnnotationPresent() 96 for (int i = 0; i < reps; i++) { in timeIsMethodAnnotationPresent() [all …]
|
D | IntegerBenchmark.java | 22 for (int i = 0; i < reps; ++i) { in timeLongSignumBranch() 23 t += signum1(-i); in timeLongSignumBranch() 25 t += signum1(i); in timeLongSignumBranch() 32 for (int i = 0; i < reps; ++i) { in timeLongSignumBranchFree() 33 t += signum2(-i); in timeLongSignumBranchFree() 35 t += signum2(i); in timeLongSignumBranchFree() 50 for (int i = 0; i < reps; ++i) { in timeLongBitCount_BitSet() 51 t += pop((long) i); in timeLongBitCount_BitSet() 76 for (int i = 0; i < reps; ++i) { in timeLongBitCount_2Int() 77 t += pop2((long) i); in timeLongBitCount_2Int() [all …]
|
D | ExpensiveObjectsBenchmark.java | 33 for (int i = 0; i < reps; ++i) { in timeNewDateFormatTimeInstance() 41 for (int i = 0; i < reps; ++i) { in timeClonedDateFormatTimeInstance() 48 for (int i = 0; i < reps; ++i) { in timeReusedDateFormatTimeInstance() 56 for (int i = 0; i < reps; ++i) { in timeNewCollator() 63 for (int i = 0; i < reps; ++i) { in timeClonedCollator() 69 for (int i = 0; i < reps; ++i) { in timeNewDateFormatSymbols() 76 for (int i = 0; i < reps; ++i) { in timeClonedDateFormatSymbols() 82 for (int i = 0; i < reps; ++i) { in timeNewDecimalFormatSymbols() 89 for (int i = 0; i < reps; ++i) { in timeClonedDecimalFormatSymbols() 95 for (int i = 0; i < reps; ++i) { in timeNewNumberFormat() [all …]
|
/libcore/luni/src/test/java/libcore/dalvik/system/ |
D | JniTest.java | 98 for(int i = 0; i < 16; i++) { in testPassingObjectReferences() 99 a[i] = literal; in testPassingObjectReferences() 101 for(int i = 0; i < 16; i++) { in testPassingObjectReferences() 102 assertEquals(a[i], returnObjectArgFrom16(i, a[0], a[1], a[2], a[3], a[4], in testPassingObjectReferences() 109 for(int i = 0; i < 16; i++) { in testPassingObjectReferences() 110 a[i] = literals[(i + j) % literals.length]; in testPassingObjectReferences() 112 for(int i = 0; i < 16; i++) { in testPassingObjectReferences() 113 assertEquals(a[i], returnObjectArgFrom16(i, a[0], a[1], a[2], a[3], a[4], in testPassingObjectReferences() 126 for(int i = 0; i < 16; i++) { in testPassingBooleans() 127 a[i] = literal; in testPassingBooleans() [all …]
|
/libcore/ojluni/src/main/java/jdk/internal/util/ |
D | ArraysSupport.java | 215 for (int i = fromIndex; i < end; i++) { in signedHashCode() 216 result = 31 * result + (a[i] & 0xff); in signedHashCode() 223 for (int i = fromIndex; i < end; i++) { in hashCode() 224 result = 31 * result + a[i]; in hashCode() 231 for (int i = fromIndex; i < end; i++) { in hashCode() 232 result = 31 * result + a[i]; in hashCode() 239 for (int i = fromIndex; i < end; i++) { in hashCode() 240 result = 31 * result + a[i]; in hashCode() 247 for (int i = fromIndex; i < end; i++) { in hashCode() 248 result = 31 * result + a[i]; in hashCode() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/atomic/ |
D | AtomicLongArray.java | 94 public final long get(int i) { in get() argument 95 return (long)AA.getVolatile(array, i); in get() 105 public final void set(int i, long newValue) { in set() argument 106 AA.setVolatile(array, i, newValue); in set() 117 public final void lazySet(int i, long newValue) { in lazySet() argument 118 AA.setRelease(array, i, newValue); in lazySet() 130 public final long getAndSet(int i, long newValue) { in getAndSet() argument 131 return (long)AA.getAndSet(array, i, newValue); in getAndSet() 145 public final boolean compareAndSet(int i, long expectedValue, long newValue) { in compareAndSet() argument 146 return AA.compareAndSet(array, i, expectedValue, newValue); in compareAndSet() [all …]
|
D | AtomicIntegerArray.java | 94 public final int get(int i) { in get() argument 95 return (int)AA.getVolatile(array, i); in get() 105 public final void set(int i, int newValue) { in set() argument 106 AA.setVolatile(array, i, newValue); in set() 117 public final void lazySet(int i, int newValue) { in lazySet() argument 118 AA.setRelease(array, i, newValue); in lazySet() 130 public final int getAndSet(int i, int newValue) { in getAndSet() argument 131 return (int)AA.getAndSet(array, i, newValue); in getAndSet() 145 public final boolean compareAndSet(int i, int expectedValue, int newValue) { in compareAndSet() argument 146 return AA.compareAndSet(array, i, expectedValue, newValue); in compareAndSet() [all …]
|
/libcore/ojluni/src/test/java/lang/String/concat/ |
D | ImplicitStringConcatArgCount.java | 102 static int i = 7; field in ImplicitStringConcatArgCount 108 test("foo7", s + s1 + s2 + i); in testImplicitStringConcatArgCount() 109 test("foo77", s + s1 + s2 + i + i); in testImplicitStringConcatArgCount() 110 test("foo777", s + s1 + s2 + i + i + i); in testImplicitStringConcatArgCount() 111 test("foo7777", s + s1 + s2 + i + i + i + i); in testImplicitStringConcatArgCount() 112 test("foo77777", s + s1 + s2 + i + i + i + i + i); in testImplicitStringConcatArgCount() 113 test("foo777777", s + s1 + s2 + i + i + i + i + i + i); in testImplicitStringConcatArgCount() 114 test("foo7777777", s + s1 + s2 + i + i + i + i + i + i + i); in testImplicitStringConcatArgCount() 115 test("foo77777777", s + s1 + s2 + i + i + i + i + i + i + i + i); in testImplicitStringConcatArgCount()
|
/libcore/ojluni/src/test/java/util/BitSet/ |
D | PreviousBits.java | 40 for (int i = words.length; --i >= 0; ) in testHashCode() 41 h ^= words[i] * (i + 1); in testHashCode() 64 for (int i = -1; i < 93;) { in test() 65 equal(-1, s.previousSetBit(i)); in test() 66 equal( i, s.previousClearBit(i)); in test() 67 i++; in test() 68 equal(-1, s.nextSetBit(i)); in test() 69 equal( i, s.nextClearBit(i)); in test() 79 for (int i = -1; i < j; i++) { in test() 80 equal(-1, s.previousSetBit(i)); in test() [all …]
|
/libcore/ojluni/src/main/java/java/lang/ |
D | Integer.java | 156 public static String toString(int i, int radix) { in toString() argument 162 return toString(i); in toString() 170 boolean negative = (i < 0); in toString() 174 i = -i; in toString() 177 while (i <= -radix) { in toString() 178 buf[charPos--] = (byte)digits[-(i % radix)]; in toString() 179 i = i / radix; in toString() 181 buf[charPos] = (byte)digits[-i]; in toString() 245 public static String toUnsignedString(int i, int radix) { in toUnsignedString() argument 246 return Long.toUnsignedString(toUnsignedLong(i), radix); in toUnsignedString() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | BitSetTest.java | 92 for (int i = 0; i < 8; i++) { in test_clear() 93 assertTrue("Clear didn't clear bit " + i, !eightbs.get(i)); in test_clear() 112 for (int i = 0; i < 7; i++) { in test_clearI() 113 assertTrue("Clear cleared incorrect bits", eightbs.get(i)); in test_clearI() 165 for (int i = 0; i < 20; i++) { in test_clearII() 166 bitset.set(i); in test_clearII() 178 for (int i = 0; i < 7; i++) { in test_clearII() 179 if (i == 5) { in test_clearII() 180 assertFalse("Shouldn't have flipped bit " + i, bs.get(i)); in test_clearII() 182 assertTrue("Shouldn't have cleared bit " + i, bs.get(i)); in test_clearII() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
D | BigIntegerConstructorsTest.java | 56 for(int i = 0; i < resBytes.length; i++) { in testConstructorBytesPositive1() 57 assertTrue(resBytes[i] == rBytes[i]); in testConstructorBytesPositive1() 72 for(int i = 0; i < resBytes.length; i++) { in testConstructorBytesPositive2() 73 assertTrue(resBytes[i] == rBytes[i]); in testConstructorBytesPositive2() 88 for(int i = 0; i < resBytes.length; i++) { in testConstructorBytesPositive3() 89 assertTrue(resBytes[i] == rBytes[i]); in testConstructorBytesPositive3() 104 for(int i = 0; i < resBytes.length; i++) { in testConstructorBytesPositive() 105 assertTrue(resBytes[i] == rBytes[i]); in testConstructorBytesPositive() 120 for(int i = 0; i < resBytes.length; i++) { in testConstructorBytesNegative1() 121 assertTrue(resBytes[i] == rBytes[i]); in testConstructorBytesNegative1() [all …]
|