Home
last modified time | relevance | path

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

12345678910>>...21

/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/luni/src/test/java/libcore/java/util/
DArraysTest.java19 import java.util.Arrays;
33 Arrays.setAll(list, x -> x + 1); in test_setAll$I()
39 Arrays.setAll(list, null); in test_setAll$I()
45 Arrays.setAll((int[]) null, (x -> x + 1)); in test_setAll$I()
60 Arrays.parallelSetAll(list, x -> x + 1); in test_parallelSetAll$I()
66 Arrays.parallelSetAll(list, null); in test_parallelSetAll$I()
72 Arrays.parallelSetAll((int[]) null, (x -> x + 1)); in test_parallelSetAll$I()
87 Arrays.setAll(list, x -> x + 1); in test_setAll$L()
93 Arrays.setAll(list, null); in test_setAll$L()
99 Arrays.setAll((long[]) null, (x -> x + 1)); in test_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;
444 return Arrays.copyOf(eras, eras.length); in getEras()
452 eras = Arrays.copyOf(newEras, newEras.length); in setEras()
461 return Arrays.copyOf(months, months.length); in getMonths()
469 months = Arrays.copyOf(newMonths, newMonths.length); in setMonths()
478 return Arrays.copyOf(shortMonths, shortMonths.length); in getShortMonths()
486 shortMonths = Arrays.copyOf(newShortMonths, newShortMonths.length); in setShortMonths()
496 return Arrays.copyOf(weekdays, weekdays.length); in getWeekdays()
506 weekdays = Arrays.copyOf(newWeekdays, newWeekdays.length); in setWeekdays()
516 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/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/luni/src/main/java/libcore/util/
DObjects.java21 import java.util.Arrays;
64 sb.append(Arrays.toString((boolean[]) value)); in toString()
66 sb.append(Arrays.toString((byte[]) value)); in toString()
68 sb.append(Arrays.toString((char[]) value)); in toString()
70 sb.append(Arrays.toString((double[]) value)); in toString()
72 sb.append(Arrays.toString((float[]) value)); in toString()
74 sb.append(Arrays.toString((int[]) value)); in toString()
76 sb.append(Arrays.toString((long[]) value)); in toString()
78 sb.append(Arrays.toString((short[]) value)); in toString()
80 sb.append(Arrays.toString((Object[]) value)); in toString()
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DDoublePrimitiveOpsTests.java28 import java.util.Arrays;
41 …double sum = Arrays.asList(1.0, 2.0, 3.0, 4.0, 5.0).stream().mapToDouble(i -> i).reduce(0.0, Doubl… in testUnBox()
62 Arrays.sort(sortedContent); in testSort()
65 double[] array = Arrays.stream(content).sorted().toArray(); in testSort()
70 double[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
80 Arrays.sort(sortedContent); in testSortSort()
83 double[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort()
88 double[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort()
98 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
103 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
DIntPrimitiveOpsTests.java28 import java.util.Arrays;
84 long sum = Arrays.asList(1, 2, 3, 4, 5).stream().mapToInt(i -> (int) i).sum(); in testUnBox()
105 Arrays.sort(sortedContent); in testSort()
108 int[] array = Arrays.stream(content).sorted().toArray(); in testSort()
113 int[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
123 Arrays.sort(sortedContent); in testSortSort()
126 int[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort()
131 int[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort()
174 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
179 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
DLongPrimitiveOpsTests.java28 import java.util.Arrays;
84 long sum = Arrays.asList(1L, 2L, 3L, 4L, 5L).stream().mapToLong(i -> (long) i).sum(); in testUnBox()
105 Arrays.sort(sortedContent); in testSort()
108 long[] array = Arrays.stream(content).sorted().toArray(); in testSort()
113 long[] array = Arrays.stream(content).parallel().sorted().toArray(); in testSort()
123 Arrays.sort(sortedContent); in testSortSort()
126 long[] array = Arrays.stream(content).sorted().sorted().toArray(); in testSortSort()
131 long[] array = Arrays.stream(content).parallel().sorted().sorted().toArray(); in testSortSort()
174 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
179 Assert.assertTrue(Arrays.equals(expected, actual)); in testLimit()
DStreamCloseTest.java27 import java.util.Arrays;
57 Arrays.fill(holder, false); in testOneCloseHandler()
63 Arrays.fill(holder, false); in testOneCloseHandler()
69 Arrays.fill(holder, false); in testOneCloseHandler()
87 Arrays.fill(holder, false); in testTwoCloseHandlers()
93 Arrays.fill(holder, false); in testTwoCloseHandlers()
99 Arrays.fill(holder, false); in testTwoCloseHandlers()
124 Arrays.fill(holder, false); in testCascadedExceptions()
137 Arrays.fill(holder, false); in testCascadedExceptions()
149 Arrays.fill(holder, false); in testCascadedExceptions()
DFindFirstOpTest.java51 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(pEven).findFirst().get()}).st… in testFindFirst()
52 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.findFirst().get()}).stream(), Arrays in testFindFirst()
53 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 499).findFirst().ge… in testFindFirst()
54 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 999).findFirst().ge… in testFindFirst()
55 …exerciseOps(countTo(0), s -> Arrays.asList(new Integer[]{s.findFirst().orElse(-1)}).stream(), Arra… in testFindFirst()
56 …rciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 1499).findFirst().orEl… in testFindFirst()
/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 …]
DWildcardTypeImpl.java22 import java.util.Arrays;
49 return Arrays.equals(getLowerBounds(), that.getLowerBounds()) && in equals()
50 Arrays.equals(getUpperBounds(), that.getUpperBounds()); in equals()
55 return 31 * Arrays.hashCode(getLowerBounds()) + in hashCode()
56 Arrays.hashCode(getUpperBounds()); in hashCode()
/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 …]
DCopyOnWriteArrayListTest.java12 import java.util.Arrays;
84 CopyOnWriteArrayList a = new CopyOnWriteArrayList(Arrays.asList(ints)); in testConstructor3()
94 assertTrue(full.addAll(Arrays.asList(three, four, five))); in testAddAll()
96 assertTrue(full.addAll(Arrays.asList(three, four, five))); in testAddAll()
107 assertEquals(2, full.addAllAbsent(Arrays.asList(three, four, one))); in testAddAllAbsent()
109 assertEquals(0, full.addAllAbsent(Arrays.asList(three, four, one))); in testAddAllAbsent()
207 assertTrue(full.containsAll(Arrays.asList())); in testContainsAll()
208 assertTrue(full.containsAll(Arrays.asList(one))); in testContainsAll()
209 assertTrue(full.containsAll(Arrays.asList(one, two))); in testContainsAll()
210 assertFalse(full.containsAll(Arrays.asList(one, two, six))); in testContainsAll()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DStringTest.java27 import java.util.Arrays;
127 assertEquals("[97, 63, 98]", Arrays.toString("a\u0666b".getBytes("US-ASCII"))); in test_getBytes_bad()
128 … assertEquals("[97, 63, 98]", Arrays.toString("a\u0666b".getBytes(Charset.forName("US-ASCII")))); in test_getBytes_bad()
136 assertEquals("[]", Arrays.toString("".getBytes(cs))); in test_getBytes_UTF_8()
139 assertEquals("[0]", Arrays.toString("\u0000".getBytes(cs))); in test_getBytes_UTF_8()
140 assertEquals("[127]", Arrays.toString("\u007f".getBytes(cs))); in test_getBytes_UTF_8()
141 assertEquals("[104, 105]", Arrays.toString("hi".getBytes(cs))); in test_getBytes_UTF_8()
144 assertEquals("[-62, -128]", Arrays.toString("\u0080".getBytes(cs))); in test_getBytes_UTF_8()
145 assertEquals("[-39, -90]", Arrays.toString("\u0666".getBytes(cs))); in test_getBytes_UTF_8()
146 assertEquals("[-33, -65]", Arrays.toString("\u07ff".getBytes(cs))); in test_getBytes_UTF_8()
[all …]
/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/luni/src/test/java/libcore/java/nio/charset/
DModifiedUtf8Test.java25 import java.util.Arrays;
246 assertTrue(Arrays.equals(new byte[]{0, 1, 'A'}, ModifiedUtf8.encode("A"))); in test_encode()
247 assertTrue(Arrays.equals(new byte[] { 0, 3, 'A', 'B', 'C' }, ModifiedUtf8.encode("ABC"))); in test_encode()
248 assertTrue(Arrays.equals(new byte[] { 0, 3, 'A', (byte) 0xc2, (byte) 0xa0 }, in test_encode()
250 assertTrue(Arrays.equals(new byte[] { 0, 4, 'A', (byte) 0xe0, (byte) 0xa0, (byte) 0xb0 }, in test_encode()
252 assertTrue(Arrays.equals(new byte[] { 0, 3, 'A', (byte) 0xc2, (byte) 0xa6 }, in test_encode()
254 assertTrue(Arrays.equals(new byte[] { 0, 3, 'A', (byte) 0xc2, (byte) 0xbf }, in test_encode()
256 assertTrue(Arrays.equals(new byte[] { 0, 3, 'A', (byte) 0xd8, (byte) 0x86 }, in test_encode()
258 assertTrue(Arrays.equals(new byte[] { 0, 3, 'A', (byte) 0xdf, (byte) 0xbf }, in test_encode()
260 assertTrue(Arrays.equals(new byte[] { 0, 4, 'A', (byte) 0xe0, (byte) 0xa0, (byte) 0x80 }, in test_encode()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
DNullCipherTest.java26 import java.util.Arrays;
61 assertTrue("Incorrect IV", Arrays.equals(c.getIV(), new byte[8])); in testGetIV()
104 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArray()
114 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArrayintint()
130 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArrayintintbyteArray()
140 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArrayintintbyteArrayint()
166 assertTrue("different content", Arrays.equals(b, r)); in testDoFinalbyteArray()
177 assertTrue("different content", Arrays.equals(b, r)); in testDoFinalbyteArrayintint()
205 assertTrue("different content", Arrays.equals(b, r)); in testDoFinalbyteArrayintintbyteArray()
240 assertTrue("different content", Arrays.equals(b, r)); in testDoFinalbyteArrayintintbyteArrayint()
/libcore/luni/src/test/java/tests/security/cert/
DPolicyQualifierInfoTest.java28 import java.util.Arrays;
131 assertTrue(Arrays.equals(encoding, encodingRet)); in testPolicyQualifierInfo04()
138 assertTrue(Arrays.equals(encoding, encodingRet1)); in testPolicyQualifierInfo04()
156 assertTrue(Arrays.equals(encoding, encodingRet)); in testGetEncoded01()
179 assertTrue(Arrays.equals(encoding, encodingRet1)); in testGetEncoded02()
200 assertTrue(Arrays.equals(pqEncoding, pqEncodingRet)); in testGetPolicyQualifier01()
227 assertTrue(Arrays.equals(pqEncoding, pqEncodingRet1)); in testGetPolicyQualifier02()
/libcore/luni/src/test/java/libcore/java/util/zip/
DZipOutputStreamTest.java24 import java.util.Arrays;
42 … assertEquals(Arrays.toString(data), Arrays.toString(ZipInputStreamTest.unzip("short", zipped))); in testShortMessage()
49 assertEquals(Arrays.toString(data), Arrays.toString(ZipInputStreamTest.unzip("z", zipped))); in test3181430()
55 assertTrue(Arrays.equals(data, ZipInputStreamTest.unzip("r", zip("r", data)))); in testLongMessage()

12345678910>>...21