Home
last modified time | relevance | path

Searched refs:arr (Results 1 – 25 of 41) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/util/concurrent/
DAtomicIntegerArrayTest.java40 AtomicIntegerArray arr = new AtomicIntegerArray(expectedArray); in testCompareAndExchange() local
41 for (int i = arr.length() - 1; i >= 0; --i) { in testCompareAndExchange()
42 assertEquals(expectedArray[i], arr.compareAndExchange(i, 0, i+1)); in testCompareAndExchange()
43 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
45 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], i+1)); in testCompareAndExchange()
46 assertEquals(i+1, arr.get(i)); in testCompareAndExchange()
48 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
50 assertEquals(i+1, arr.compareAndExchange(i, i+1, -1)); in testCompareAndExchange()
51 assertEquals(-1, arr.get(i)); in testCompareAndExchange()
53 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
[all …]
DAtomicLongArrayTest.java40 AtomicLongArray arr = new AtomicLongArray(expectedArray); in testCompareAndExchange() local
41 for (int i = 0; i < arr.length(); ++i) { in testCompareAndExchange()
42 assertEquals(expectedArray[i], arr.compareAndExchange(i, 0, i+1)); in testCompareAndExchange()
43 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
45 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], i+1)); in testCompareAndExchange()
46 assertEquals(i+1, arr.get(i)); in testCompareAndExchange()
48 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
50 assertEquals(i+1, arr.compareAndExchange(i, i+1, -1)); in testCompareAndExchange()
51 assertEquals(-1, arr.get(i)); in testCompareAndExchange()
53 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
[all …]
DAtomicReferenceArrayTest.java46 AtomicReferenceArray<Integer> arr = new AtomicReferenceArray(expectedArray); in testCompareAndExchange() local
47 for (int i = 0; i < arr.length(); ++i) { in testCompareAndExchange()
49 assertEquals(expectedArray[i], arr.compareAndExchange(i, Integer.valueOf(0), val)); in testCompareAndExchange()
50 checkArrayAsExpected(expectedArray, arr); 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()
56 checkArrayAsExpected(expectedArray, arr); in testCompareAndExchange()
59 assertEquals(expectedArray[i], arr.compareAndExchange(i, expectedArray[i], val)); in testCompareAndExchange()
60 assertSame(val, arr.get(i)); in testCompareAndExchange()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/charset/
DCharsetDecoderTest.java42 byte[] arr = encode("UTF-16", "Android"); in test_ByteArray_decode_no_offset()
43 ByteBuffer inBuffer = ByteBuffer.wrap(arr, 0, arr.length).slice(); in test_ByteArray_decode_no_offset()
44 CharBuffer outBuffer = CharBuffer.allocate(arr.length); in test_ByteArray_decode_no_offset()
56 byte[] arr = encode("UTF-16", "Android"); in test_ByteArray_decode_with_offset()
57 arr = prependByteToByteArray(arr, Integer.valueOf(1).byteValue()); in test_ByteArray_decode_with_offset()
59 ByteBuffer inBuffer = ByteBuffer.wrap(arr, offset, arr.length - offset).slice(); in test_ByteArray_decode_with_offset()
60 CharBuffer outBuffer = CharBuffer.allocate(arr.length - offset); in test_ByteArray_decode_with_offset()
72 byte[] arr = encode("UTF-16", "Android"); in test_ByteArray_decode_with_offset_using_facade_method()
73 arr = prependByteToByteArray(arr, Integer.valueOf(1).byteValue()); in test_ByteArray_decode_with_offset_using_facade_method()
75 CharBuffer outBuffer = decoder.decode(ByteBuffer.wrap(arr, offset, arr.length - offset)); in test_ByteArray_decode_with_offset_using_facade_method()
[all …]
/libcore/ojluni/src/test/java/lang/String/
DLiteralReplace.java236 Object[] arr = {null, "", "a", "b", "string", "str", "ababstrstr"}; in sourceTargetReplacementWithNull() local
237 for (int i = 0; i < arr.length; ++i) { in sourceTargetReplacementWithNull()
238 for (int j = 0; j < arr.length; ++j) { in sourceTargetReplacementWithNull()
239 for (int k = 0; k < arr.length; ++k) { in sourceTargetReplacementWithNull()
240 if (arr[i] != null && (arr[j] == null || arr[k] == null)) { in sourceTargetReplacementWithNull()
241 list.add(makeArray(arr[i], arr[j], arr[k])); in sourceTargetReplacementWithNull()
/libcore/ojluni/src/test/java/lang/String/concat/
DImplicitStringConcatAssignLHS.java111 Object[] arr = new Object[ARR_SIZE]; in testImplicitStringConcatAssignLHS() local
112 arr[x++] += "foo"; in testImplicitStringConcatAssignLHS()
130 String[] arr = new String[ARR_SIZE]; in testImplicitStringConcatAssignLHS() local
131 arr[x++] += "foo"; in testImplicitStringConcatAssignLHS()
149 CharSequence[] arr = new CharSequence[ARR_SIZE]; in testImplicitStringConcatAssignLHS() local
150 arr[x++] += "foo"; in testImplicitStringConcatAssignLHS()
/libcore/luni/src/test/java/libcore/java/text/
DCollatorTest.java74 byte [] arr = mColl.getCollationKey(sixteen).toByteArray(); in test_collationKeySize()
75 int len = arr.length; in test_collationKeySize()
76 assertTrue("Collation key not 0 terminated", arr[arr.length - 1] == 0); in test_collationKeySize()
78 String foo = new String(arr, 0, len, "iso8859-1"); in test_collationKeySize()
80 arr = mColl.getCollationKey(sixteen).toByteArray(); in test_collationKeySize()
81 len = arr.length; in test_collationKeySize()
82 assertTrue("Collation key not 0 terminated", arr[arr.length - 1] == 0); in test_collationKeySize()
84 String bar = new String(arr, 0, len, "iso8859-1"); in test_collationKeySize()
/libcore/ojluni/src/test/java/io/PrintStream/
DWriteBytes.java65 byte[] arr = baos.toByteArray(); in testWriteBytes()
66 assertEquals(arr.length, 2*buf.length, "Array length " + arr.length + in testWriteBytes()
68 assertTrue(Arrays.equals(buf, 0, buf.length, arr, 0, buf.length), in testWriteBytes()
70 assertTrue(Arrays.equals(buf, 0, buf.length, arr, buf.length, in testWriteBytes()
/libcore/ojluni/src/main/native/
DLinuxWatchService.c63 jint arr[5]; in Java_sun_nio_fs_LinuxWatchService_eventOffsets() local
64 arr[0] = (jint)offsetof(struct inotify_event, wd); in Java_sun_nio_fs_LinuxWatchService_eventOffsets()
65 arr[1] = (jint)offsetof(struct inotify_event, mask); in Java_sun_nio_fs_LinuxWatchService_eventOffsets()
66 arr[2] = (jint)offsetof(struct inotify_event, cookie); in Java_sun_nio_fs_LinuxWatchService_eventOffsets()
67 arr[3] = (jint)offsetof(struct inotify_event, len); in Java_sun_nio_fs_LinuxWatchService_eventOffsets()
68 arr[4] = (jint)offsetof(struct inotify_event, name); in Java_sun_nio_fs_LinuxWatchService_eventOffsets()
69 (*env)->SetIntArrayRegion(env, result, 0, 5, arr); in Java_sun_nio_fs_LinuxWatchService_eventOffsets()
/libcore/ojluni/src/test/java/nio/channels/Channels/
DTinyBuffers.java46 char [] arr = new char[100]; in test() local
47 System.out.println(r.read(arr, 0, arr.length)); in test()
/libcore/ojluni/src/main/java/java/util/prefs/
DBase64.java245 byte[] arr = new byte[j]; in main()
247 arr[k] = (byte)rnd.nextInt(); in main()
249 String s = byteArrayToBase64(arr); in main()
251 if (!java.util.Arrays.equals(arr, b)) in main()
254 s = byteArrayToAltBase64(arr); in main()
256 if (!java.util.Arrays.equals(arr, b)) in main()
/libcore/luni/src/test/java/libcore/java/util/zip/
DZipFileTest.java120 byte[] arr = new byte[1024]; in readResource()
122 while ((read = is.read(arr)) >= 0) { in readResource()
123 fos.write(arr, 0, read); in readResource()
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DDoubleStreamTestDataProvider.java52 for (double[] arr : arrays) {
53 for (int i = 0; i < arr.length; i++) {
54 arr[i] = i;
DIntStreamTestDataProvider.java51 for (int[] arr : arrays) {
52 for (int i = 0; i < arr.length; i++) {
53 arr[i] = i;
DLongStreamTestDataProvider.java51 for (long[] arr : arrays) {
52 for (int i = 0; i < arr.length; i++) {
53 arr[i] = i;
DStreamTestDataProvider.java59 for (Integer[] arr : arrays) {
60 for (int i = 0; i < arr.length; i++) {
61 arr[i] = i;
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DDoubleStreamTestDataProvider.java48 for (double[] arr : arrays) {
49 for (int i = 0; i < arr.length; i++) {
50 arr[i] = i;
DLongStreamTestDataProvider.java48 for (long[] arr : arrays) {
49 for (int i = 0; i < arr.length; i++) {
50 arr[i] = i;
DIntStreamTestDataProvider.java48 for (int[] arr : arrays) {
49 for (int i = 0; i < arr.length; i++) {
50 arr[i] = i;
DStreamTestDataProvider.java54 for (Integer[] arr : arrays) {
55 for (int i = 0; i < arr.length; i++) {
56 arr[i] = i;
/libcore/ojluni/src/main/java/java/net/
DInetAddress.java662 InetAddress[] arr = nameService.lookupAllHostAddr(host, NETID_UNSET); in getHostFromNameService() local
665 if (arr != null) { in getHostFromNameService()
666 for(int i = 0; !ok && i < arr.length; i++) { in getHostFromNameService()
667 ok = addr.equals(arr[i]); in getHostFromNameService()
/libcore/luni/src/test/java/tests/security/cert/
DCertificateFactory1Test.java440 byte[] arr = os.toByteArray(); in testCertificateFactory11()
443 is = new ByteArrayInputStream(arr); in testCertificateFactory11()
449 is = new ByteArrayInputStream(arr); in testCertificateFactory11()
457 is = new ByteArrayInputStream(arr); in testCertificateFactory11()
463 is = new ByteArrayInputStream(arr); in testCertificateFactory11()
546 byte[] arr = os.toByteArray(); in testCertificateFactory13()
547 ByteArrayInputStream is = new ByteArrayInputStream(arr); in testCertificateFactory13()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLEngineResultTest.java206 private boolean findEl(Object[] arr, Object el) { in findEl() argument
208 for (int i = 0; i < arr.length; i++) { in findEl()
209 if (arr[i].equals(el)) { in findEl()
/libcore/luni/src/test/java/tests/com/android/org/bouncycastle/jce/provider/
DCertBlocklistTest.java154 Set<byte[]> arr = bl.pubkeyBlocklist; in getPubkeyBlocklist() local
157 for (byte[] value: arr) { in getPubkeyBlocklist()
167 Set<BigInteger> arr = bl.serialBlocklist; in getSerialBlocklist() local
170 for (BigInteger value: arr) { in getSerialBlocklist()
/libcore/luni/src/main/native/
Dlibcore_math_NativeBN.cpp91 static void NativeBN_litEndInts2bn(JNIEnv* env, jclass, jintArray arr, int len, jboolean neg, jlong… in NativeBN_litEndInts2bn() argument
94 ScopedIntArrayRO scopedArray(env, arr); in NativeBN_litEndInts2bn()

12