Home
last modified time | relevance | path

Searched refs:Arrays (Results 1 – 25 of 767) sorted by relevance

12345678910>>...31

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DArrays2Test.java21 import java.util.Arrays;
44 int result = Arrays.binarySearch(specials, specials[i]); in test_binarySearch$DD()
49 -4, Arrays.binarySearch(specials, -1d)); in test_binarySearch$DD()
51 -8, Arrays.binarySearch(specials, 1d)); in test_binarySearch$DD()
64 int result = Arrays.binarySearch(specials, specials[i]); in test_binarySearch$FF()
69 -4, Arrays.binarySearch(specials, -1f)); in test_binarySearch$FF()
71 -8, Arrays.binarySearch(specials, 1f)); in test_binarySearch$FF()
80 Arrays.fill(d, Double.MAX_VALUE); in test_equals$D$D()
81 Arrays.fill(x, Double.MIN_VALUE); in test_equals$D$D()
83 assertTrue("Assert 0: Inequal arrays returned true", !Arrays.equals(d, x)); in test_equals$D$D()
[all …]
DArraysTest.java23 import java.util.Arrays;
85 List convertedList = Arrays.asList(objectArray); in test_asList$Ljava_lang_Object()
100 convertedList = Arrays.asList(myArray); in test_asList$Ljava_lang_Object()
108 Arrays.asList((Object[]) null); in test_asList$Ljava_lang_Object()
122 Arrays.binarySearch(byteArray, counter) == counter); in test_binarySearch$BB()
124 -1, Arrays.binarySearch(intArray, (byte) -1)); in test_binarySearch$BB()
127 Arrays.binarySearch(intArray, (byte) arraySize) == -(arraySize + 1)); in test_binarySearch$BB()
133 Arrays.binarySearch(byteArray, (byte) (counter - 50)) == counter); in test_binarySearch$BB()
144 Arrays.binarySearch(charArray, (char) (counter + 1)) == counter); in test_binarySearch$CC()
146 -1, Arrays.binarySearch(charArray, '\u0000')); in test_binarySearch$CC()
[all …]
/libcore/ojluni/src/test/java/util/Arrays/
DStreamAndSpliterator.java31 package test.java.util.Arrays;
35 import java.util.Arrays;
45 assertThrowsNPE(() -> Arrays.stream((int[]) null, 0, 0)); in testStreamNPEs()
46 assertThrowsNPE(() -> Arrays.stream((long[]) null, 0, 0)); in testStreamNPEs()
47 assertThrowsNPE(() -> Arrays.stream((double[]) null, 0, 0)); in testStreamNPEs()
48 assertThrowsNPE(() -> Arrays.stream((String[]) null, 0, 0)); in testStreamNPEs()
54 assertThrowsAIOOB(() -> Arrays.stream(new int[]{}, 1, 0)); in testStreamAIOBEs()
55 assertThrowsAIOOB(() -> Arrays.stream(new long[]{}, 1, 0)); in testStreamAIOBEs()
56 assertThrowsAIOOB(() -> Arrays.stream(new double[]{}, 1, 0)); in testStreamAIOBEs()
57 assertThrowsAIOOB(() -> Arrays.stream(new String[]{}, 1, 0)); in testStreamAIOBEs()
[all …]
DSetAllTest.java31 package test.java.util.Arrays;
36 import java.util.Arrays;
113 Arrays.setAll(result, generator); in testSetAllString()
118 Arrays.parallelSetAll(result, generator); in testSetAllString()
125 Arrays.setAll(result, generator); in testSetAllInt()
130 Arrays.parallelSetAll(result, generator); in testSetAllInt()
137 Arrays.setAll(result, generator); in testSetAllLong()
142 Arrays.parallelSetAll(result, generator); in testSetAllLong()
159 Arrays.setAll(result, generator); in testSetAllDouble()
164 Arrays.parallelSetAll(result, generator); in testSetAllDouble()
[all …]
DArrayObjectMethods.java32 package test.java.util.Arrays;
41 equal(Arrays.deepToString(null), "null"); in test()
42 equal(Arrays.deepToString(new Object[]{}), "[]"); in test()
43 equal(Arrays.deepToString(new Object[]{null}), "[null]"); in test()
44 equal(Arrays.deepToString(new Object[]{null, 1}), "[null, 1]"); in test()
45 equal(Arrays.deepToString(new Object[]{1, null}), "[1, null]"); in test()
46 equal(Arrays.deepToString(new Object[]{new Object[]{}, null}), "[[], null]"); in test()
51 equal(Arrays.deepToString(a), "[1, [...]]"); in test()
53 equal(Arrays.deepToString(a), "[[...], [...]]"); in test()
55 equal(Arrays.deepToString(a), "[[1, null, [...]], [1, null, [...]]]"); in test()
[all …]
DSortingHelper.java26 package test.java.util.Arrays;
437 Arrays.sort((int[]) a); in sort()
439 Arrays.sort((long[]) a); in sort()
441 Arrays.sort((byte[]) a); in sort()
443 Arrays.sort((char[]) a); in sort()
445 Arrays.sort((short[]) a); in sort()
447 Arrays.sort((float[]) a); in sort()
449 Arrays.sort((double[]) a); in sort()
458 Arrays.sort((int[]) a, low, high); in sort()
460 Arrays.sort((long[]) a, low, high); in sort()
[all …]
DFloatDoubleOrder.java36 package test.java.util.Arrays;
60 Arrays.sort(unsortedDbl); in test()
61 check(Arrays.equals(unsortedDbl, sortedDbl)); in test()
65 equal(Arrays.binarySearch(sortedDbl, sortedDbl[i]), i); in test()
67 equal(Arrays.binarySearch(sortedDbl, negNan), i); in test()
87 Arrays.sort(unsortedFlt); in test()
88 check(Arrays.equals(unsortedFlt, sortedFlt)); in test()
92 equal(Arrays.binarySearch(sortedFlt, sortedFlt[i]), i); in test()
94 equal(Arrays.binarySearch(sortedFlt, negNaN), i); in test()
101 Arrays.sort(da, 1, 4); in test()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DArraysTest.java32 import java.util.Arrays;
55 Arrays.setAll(list, x -> x + 1); in setAll$I()
61 Arrays.setAll(list, null); in setAll$I()
67 Arrays.setAll((int[]) null, (x -> x + 1)); in setAll$I()
83 Arrays.parallelSetAll(list, x -> x + 1); in parallelSetAll$I()
89 Arrays.parallelSetAll(list, null); in parallelSetAll$I()
95 Arrays.parallelSetAll((int[]) null, (x -> x + 1)); in parallelSetAll$I()
111 Arrays.setAll(list, x -> x + 1); in setAll$L()
117 Arrays.setAll(list, null); in setAll$L()
123 Arrays.setAll((long[]) null, (x -> x + 1)); in setAll$L()
[all …]
DLocaleLanguageRangeTest.java22 import java.util.Arrays;
161 Collections.singletonMap("en-US", Arrays.asList("en-US", "en-AU", "en-UK")))); in testMapEquivalents_emptyList()
165 List<LanguageRange> inputRanges = Collections.unmodifiableList(Arrays.asList( in testMapEquivalents_emptyMap_createsModifiableCopy()
182 map.put("zh", Collections.unmodifiableList(Arrays.asList("zh", "zh-Hans"))); in testMapEquivalents_exampleFromDocumentation()
186 List<LanguageRange> inputPriorityList = Arrays.asList( in testMapEquivalents_exampleFromDocumentation()
193 List<LanguageRange> expectedOutput = Arrays.asList( in testMapEquivalents_exampleFromDocumentation()
221 List<LanguageRange> priorityList = Collections.unmodifiableList(Arrays.asList( in testMapEquivalents_nullMap()
230 List<LanguageRange> expected = Arrays.asList( in testMapEquivalents()
236 map.put("fr", Arrays.asList("de-DE")); in testMapEquivalents()
237 map.put("en", Arrays.asList("en-US", "en-AU")); in testMapEquivalents()
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DProxySelectorTest.java24 import java.util.Arrays;
66 assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(ftpUri)); in testNoProxySystemProperty()
67 assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(httpUri)); in testNoProxySystemProperty()
68 assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(httpsUri)); in testNoProxySystemProperty()
69 assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(socketUri)); in testNoProxySystemProperty()
70 assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(otherUri)); in testNoProxySystemProperty()
79 assertEquals(Arrays.asList(new Proxy(Proxy.Type.HTTP, createUnresolved("a", 80))), in testProxyHostOnly()
81 assertEquals(Arrays.asList(new Proxy(Proxy.Type.HTTP, createUnresolved("b", 80))), in testProxyHostOnly()
83 assertEquals(Arrays.asList(new Proxy(Proxy.Type.HTTP, createUnresolved("c", 443))), in testProxyHostOnly()
85 assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(otherUri)); in testProxyHostOnly()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/reflect/
DGenericExceptionsTest.java24 import java.util.Arrays;
32 assertEquals(Arrays.<Type>asList(IOException.class), in testGenericExceptionsOfMethodsWithTypeParameters()
33 Arrays.asList(method.getGenericExceptionTypes())); in testGenericExceptionsOfMethodsWithTypeParameters()
38 assertEquals(Arrays.<Type>asList(IOException.class), in testGenericExceptionsOfMethodsWithGenericParameters()
39 Arrays.asList(method.getGenericExceptionTypes())); in testGenericExceptionsOfMethodsWithGenericParameters()
44 assertEquals(Arrays.<Type>asList(IOException.class), in testGenericExceptionsOfConstructorsWithTypeParameters()
45 Arrays.asList(constructor.getGenericExceptionTypes())); in testGenericExceptionsOfConstructorsWithTypeParameters()
50 assertEquals(Arrays.<Type>asList(IOException.class), in testGenericExceptionsOfConstructorsWithGenericParameters()
51 Arrays.asList(constructor.getGenericExceptionTypes())); in testGenericExceptionsOfConstructorsWithGenericParameters()
59 assertEquals(Arrays.<Type>asList(Throwable.class), Arrays.asList(typeVariable.getBounds())); in testConstructorThrowingTypeVariable()
[all …]
/libcore/ojluni/src/main/java/java/text/
DDateFormatSymbols.java47 import java.util.Arrays;
462 return Arrays.copyOf(eras, eras.length); in getEras()
470 eras = Arrays.copyOf(newEras, newEras.length); in setEras()
498 return Arrays.copyOf(months, months.length); in getMonths()
508 months = Arrays.copyOf(newMonths, newMonths.length); in setMonths()
536 return Arrays.copyOf(shortMonths, shortMonths.length); in getShortMonths()
546 shortMonths = Arrays.copyOf(newShortMonths, newShortMonths.length); in setShortMonths()
558 return Arrays.copyOf(weekdays, weekdays.length); in getWeekdays()
568 weekdays = Arrays.copyOf(newWeekdays, newWeekdays.length); in setWeekdays()
580 return Arrays.copyOf(shortWeekdays, shortWeekdays.length); in getShortWeekdays()
[all …]
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DCopyOnWriteArrayListTest.java20 import java.util.Arrays;
38 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testIteratorAndNonStructuralChanges()
55 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testSubListAndNonStructuralChanges()
67 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testSubListAndStructuralChanges()
79 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testSubListAndSizePreservingStructuralChanges()
82 list.addAll(Arrays.asList("A", "B", "C", "D", "E")); in testSubListAndSizePreservingStructuralChanges()
92 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testRemoveAll()
94 list.removeAll(Arrays.asList()); in testRemoveAll()
95 assertEquals(Arrays.asList("a", "b", "c", "d", "e"), list); in testRemoveAll()
97 list.removeAll(Arrays.asList("e")); in testRemoveAll()
[all …]
/libcore/luni/src/main/java/libcore/util/
DObjects.java21 import java.util.Arrays;
53 sb.append(Arrays.toString((boolean[]) value)); in toString()
55 sb.append(Arrays.toString((byte[]) value)); in toString()
57 sb.append(Arrays.toString((char[]) value)); in toString()
59 sb.append(Arrays.toString((double[]) value)); in toString()
61 sb.append(Arrays.toString((float[]) value)); in toString()
63 sb.append(Arrays.toString((int[]) value)); in toString()
65 sb.append(Arrays.toString((long[]) value)); in toString()
67 sb.append(Arrays.toString((short[]) value)); in toString()
69 sb.append(Arrays.toString((Object[]) value)); in toString()
/libcore/jsr166-tests/src/test/java/jsr166/
DCopyOnWriteArraySetTest.java12 import java.util.Arrays;
69 CopyOnWriteArraySet a = new CopyOnWriteArraySet(Arrays.asList(ints)); in testConstructor3()
79 assertTrue(full.addAll(Arrays.asList(three, four, five))); in testAddAll()
81 assertFalse(full.addAll(Arrays.asList(three, four, five))); in testAddAll()
91 assertTrue(full.addAll(Arrays.asList(three, four, one))); in testAddAll2()
93 assertFalse(full.addAll(Arrays.asList(three, four, one))); in testAddAll2()
173 CopyOnWriteArraySet empty1 = new CopyOnWriteArraySet(Arrays.asList()); in testEquals()
174 CopyOnWriteArraySet empty2 = new CopyOnWriteArraySet(Arrays.asList()); in testEquals()
190 assertTrue(full.containsAll(Arrays.asList())); in testContainsAll()
191 assertTrue(full.containsAll(Arrays.asList(one))); in testContainsAll()
[all …]
/libcore/luni/src/main/java/libcore/reflect/
DAnnotationMember.java28 import java.util.Arrays;
224 return Arrays.equals((Object[])value, (Object[])otherValue); in equalArrayValue()
231 return Arrays.equals((int[])value, (int[])otherValue); in equalArrayValue()
233 return Arrays.equals((byte[])value, (byte[])otherValue); in equalArrayValue()
235 return Arrays.equals((short[])value, (short[])otherValue); in equalArrayValue()
237 return Arrays.equals((long[])value, (long[])otherValue); in equalArrayValue()
239 return Arrays.equals((char[])value, (char[])otherValue); in equalArrayValue()
241 return Arrays.equals((boolean[])value, (boolean[])otherValue); in equalArrayValue()
243 return Arrays.equals((float[])value, (float[])otherValue); in equalArrayValue()
245 return Arrays.equals((double[])value, (double[])otherValue); in equalArrayValue()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/
DGCMParameterSpecTest.java19 import java.util.Arrays;
80 assertEquals(Arrays.toString(TEST_IV), Arrays.toString(actual)); in testGetIV_Success()
88 Arrays.equals(spec.getIV(), actual)); in testGetIV_Success()
89 assertEquals(Arrays.toString(TEST_IV), Arrays.toString(spec.getIV())); in testGetIV_Success()
94 assertEquals(Arrays.toString(Arrays.copyOfRange(TEST_IV, 2, 6)), in testGetIV_Subarray_Success()
95 Arrays.toString(spec.getIV())); in testGetIV_Subarray_Success()
/libcore/ojluni/src/test/java/util/concurrent/tck/
DCopyOnWriteArraySetTest.java38 import java.util.Arrays;
91 CopyOnWriteArraySet a = new CopyOnWriteArraySet(Arrays.asList(ints)); in testConstructor3()
101 assertTrue(full.addAll(Arrays.asList(three, four, five))); in testAddAll()
103 assertFalse(full.addAll(Arrays.asList(three, four, five))); in testAddAll()
113 assertTrue(full.addAll(Arrays.asList(three, four, one))); in testAddAll2()
115 assertFalse(full.addAll(Arrays.asList(three, four, one))); in testAddAll2()
195 CopyOnWriteArraySet empty1 = new CopyOnWriteArraySet(Arrays.asList()); in testEquals()
196 CopyOnWriteArraySet empty2 = new CopyOnWriteArraySet(Arrays.asList()); in testEquals()
212 assertTrue(full.containsAll(Arrays.asList())); in testContainsAll()
213 assertTrue(full.containsAll(Arrays.asList(one))); in testContainsAll()
[all …]
/libcore/ojluni/src/test/java/io/InputStream/
DReadNBytes.java29 import java.util.Arrays;
76 check(Arrays.equals((tmp = Arrays.copyOf(inputBytes, nread)), readBytes), in test()
85 check(Arrays.equals((tmp = Arrays.copyOfRange(inputBytes, readBytes.length, length)), in test()
86 Arrays.copyOf(readBytes, nread)), in test()
124 check(Arrays.equals(Arrays.copyOfRange(inputBytes, off, off + len), readBytes), in test()
125 "Expected[" + Arrays.copyOfRange(inputBytes, off, off + len) + in test()
132 check(Arrays.equals(Arrays.copyOfRange(inputBytes, off + len, max), in test()
134 "Expected[" + Arrays.copyOfRange(inputBytes, off + len, max) + in test()
/libcore/luni/src/test/java/libcore/javax/crypto/spec/
DAlgorithmParametersTestPBES2.java20 import java.util.Arrays;
173 Arrays.toString(GET_ENCODED_KNOWN_ANSWERS[i]), in testGetEncoded_knownAnswers()
174 Arrays.toString(ap.getEncoded())); in testGetEncoded_knownAnswers()
188 assertEquals(Arrays.toString(TEST_PBE_PARAMETER_SPEC.getSalt()), in test_encodeAndDecode()
189 Arrays.toString(encodedSpec.getSalt())); in test_encodeAndDecode()
193 Arrays.toString( in test_encodeAndDecode()
195 Arrays.toString(((IvParameterSpec) encodedSpec.getParameterSpec()).getIV())); in test_encodeAndDecode()
215 Arrays.toString(ENCRYPT_KNOWN_ANSWERS[i]), in test_encryptWithAlgorithmParameters()
216 Arrays.toString(encrypted)); in test_encryptWithAlgorithmParameters()
220 Arrays.toString(plaintext), in test_encryptWithAlgorithmParameters()
[all …]
/libcore/ojluni/src/test/java/io/ByteArrayOutputStream/
DWrite.java36 import java.util.Arrays;
114 assertEquals(b1, Arrays.copyOfRange(b, off1, off1 + len1), in writeTest()
120 assertEquals(Arrays.copyOfRange(b2, 0, len1), in writeTest()
121 Arrays.copyOfRange(b, off1, off1 + len1), in writeTest()
123 assertEquals(Arrays.copyOfRange(b2, len1, len1 + len2), in writeTest()
124 Arrays.copyOfRange(b, off2, off2 + len2), in writeTest()
134 assertEquals(Arrays.copyOfRange(b3, 0, len1), in writeTest()
135 Arrays.copyOfRange(b, off1, off1 + len1), in writeTest()
137 assertEquals(Arrays.copyOfRange(b3, len1, len1 + len2), in writeTest()
138 Arrays.copyOfRange(b, off2, off2 + len2), in writeTest()
[all …]
/libcore/ojluni/src/test/java/util/zip/
DDeInflate.java48 Arrays.fill(out1, (byte)0); in checkStream()
49 Arrays.fill(out2, (byte)0); in checkStream()
64 !Arrays.equals(Arrays.copyOf(in, len), Arrays.copyOf(out2, len)) || in checkStream()
67 m, n, len, Arrays.equals(in, out2)); in checkStream()
94 !Arrays.equals(Arrays.copyOf(expected, len), Arrays.copyOf(result, len)) || in checkByteBuffer()
166 !Arrays.equals(in, 0, len, out2, 0, len) || in check()
169 m, n, len, Arrays.equals(in, out2)); in check()
175 Arrays.fill(out1, (byte)0); in check()
176 Arrays.fill(out2, (byte)0); in check()
184 Arrays.fill(out1, (byte)0); in check()
[all …]
/libcore/ojluni/src/test/java/lang/invoke/
DVarargsArrayTest.java33 import java.util.Arrays;
159 assertEquals(Arrays.toString(args), resString); in testTypedVarargsArray()
169 assertEquals(Arrays.toString(args), res2String); in testTypedVarargsArray()
175 assertEquals(Arrays.toString(args), res3String); in testTypedVarargsArray()
184 assertEquals(Arrays.toString(args), res3String); in testTypedVarargsArray()
223 case INT: return Arrays.toString((int[])a); in toArrayString()
224 case BYTE: return Arrays.toString((byte[])a); in toArrayString()
225 case BOOLEAN: return Arrays.toString((boolean[])a); in toArrayString()
226 case SHORT: return Arrays.toString((short[])a); in toArrayString()
227 case CHAR: return Arrays.toString((char[])a); in toArrayString()
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DDoublePrimitiveOpsTests.java28 import java.util.Arrays;
49 …double sum = Arrays.asList(1.0, 2.0, 3.0, 4.0, 5.0).stream().mapToDouble(i -> i).reduce(0.0, Doubl… in testUnBox()
77 Arrays.sort(sortedContent); in testSort()
80 double[] array = Arrays.stream(content).sorted().toArray(); in testSort()
85 double[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
111 Arrays.sort(sortedContent); in testSortSort()
114 double[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort()
119 double[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort()
129 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
134 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
/libcore/ojluni/src/test/java/io/ByteArrayInputStream/
DReadAllReadNTransferTo.java28 import java.util.Arrays;
64 if (!Arrays.equals(Arrays.copyOfRange(bN, off, off+len), in testRead()
65 Arrays.copyOfRange(buf, position, position+len))) { in testRead()
74 if (!Arrays.equals(bAll, in testRead()
75 Arrays.copyOfRange( buf, position + len, position + len + bAll.length))) { in testRead()
85 if (!Arrays.equals(buf, baos.toByteArray())) { in testRead()

12345678910>>...31