Home
last modified time | relevance | path

Searched refs:array (Results 1 – 25 of 19474) sorted by relevance

12345678910>>...779

/aosp_15_r20/external/apache-commons-lang/src/main/java/org/apache/commons/lang3/
H A DArrayUtils.java211 public static boolean[] add(final boolean[] array, final boolean element) { in add() argument
212 final boolean[] newArray = (boolean[]) copyArrayGrow1(array, Boolean.TYPE); in add()
248 public static boolean[] add(final boolean[] array, final int index, final boolean element) { in add() argument
249 return (boolean[]) add(array, index, Boolean.valueOf(element), Boolean.TYPE); in add()
274 public static byte[] add(final byte[] array, final byte element) { in add() argument
275 final byte[] newArray = (byte[]) copyArrayGrow1(array, Byte.TYPE); in add()
312 public static byte[] add(final byte[] array, final int index, final byte element) { in add() argument
313 return (byte[]) add(array, index, Byte.valueOf(element), Byte.TYPE); in add()
338 public static char[] add(final char[] array, final char element) { in add() argument
339 final char[] newArray = (char[]) copyArrayGrow1(array, Character.TYPE); in add()
[all …]
/aosp_15_r20/external/apache-commons-lang/src/test/java/org/apache/commons/lang3/
H A DArrayUtilsRemoveMultipleTest.java35 boolean[] array; in testRemoveAllBooleanArray()
37 array = ArrayUtils.removeAll(new boolean[] { true }, 0); in testRemoveAllBooleanArray()
38 assertArrayEquals(ArrayUtils.EMPTY_BOOLEAN_ARRAY, array); in testRemoveAllBooleanArray()
39 assertEquals(Boolean.TYPE, array.getClass().getComponentType()); in testRemoveAllBooleanArray()
41 array = ArrayUtils.removeAll(new boolean[] { true, false }, 0); in testRemoveAllBooleanArray()
42 assertArrayEquals(new boolean[]{false}, array); in testRemoveAllBooleanArray()
43 assertEquals(Boolean.TYPE, array.getClass().getComponentType()); in testRemoveAllBooleanArray()
45 array = ArrayUtils.removeAll(new boolean[] { true, false }, 1); in testRemoveAllBooleanArray()
46 assertArrayEquals(new boolean[]{true}, array); in testRemoveAllBooleanArray()
47 assertEquals(Boolean.TYPE, array.getClass().getComponentType()); in testRemoveAllBooleanArray()
[all …]
H A DArrayUtilsTest.java77 final String[] array = ArrayUtils.toArray("foo", "bar"); in testArrayCreation() local
78 assertEquals(2, array.length); in testArrayCreation()
79 assertEquals("foo", array[0]); in testArrayCreation()
80 assertEquals("bar", array[1]); in testArrayCreation()
87 … final Number[] array = ArrayUtils.<Number>toArray(Integer.valueOf(42), Double.valueOf(Math.PI)); in testArrayCreationWithDifferentTypes() local
88 assertEquals(2, array.length); in testArrayCreationWithDifferentTypes()
89 assertEquals(Integer.valueOf(42), array[0]); in testArrayCreationWithDifferentTypes()
90 assertEquals(Double.valueOf(Math.PI), array[1]); in testArrayCreationWithDifferentTypes() local
204 final Object[] array = {"0", "1", "2", "3", null, "0"}; in testContains() local
207 assertTrue(ArrayUtils.contains(array, "0")); in testContains()
[all …]
H A DArrayUtilsInsertTest.java34 final boolean[] array = {true, false, true}; in testInsertBooleans()
37 final boolean[] result = ArrayUtils.insert(42, array, null); in testInsertBooleans()
38 assertArrayEquals(array, result); in testInsertBooleans()
39 assertNotSame(array, result); in testInsertBooleans()
41 assertNull(ArrayUtils.insert(42, null, array)); in testInsertBooleans()
45 assertThrows(IndexOutOfBoundsException.class, () -> ArrayUtils.insert(-1, array, array)); in testInsertBooleans()
46 …rtThrows(IndexOutOfBoundsException.class, () -> ArrayUtils.insert(array.length + 1, array, array)); in testInsertBooleans()
48 … assertArrayEquals(new boolean[]{false, true, false, true}, ArrayUtils.insert(0, array, false)); in testInsertBooleans()
49 … assertArrayEquals(new boolean[]{true, false, false, true}, ArrayUtils.insert(1, array, false)); in testInsertBooleans()
50 …rrayEquals(new boolean[]{true, false, true, false}, ArrayUtils.insert(array.length, array, false)); in testInsertBooleans()
[all …]
H A DArrayUtilsRemoveTest.java412 boolean[] array; in testRemoveBooleanArray()
413 array = ArrayUtils.remove(new boolean[] {true}, 0); in testRemoveBooleanArray()
414 assertArrayEquals(ArrayUtils.EMPTY_BOOLEAN_ARRAY, array); in testRemoveBooleanArray()
415 assertEquals(Boolean.TYPE, array.getClass().getComponentType()); in testRemoveBooleanArray()
416 array = ArrayUtils.remove(new boolean[] {true, false}, 0); in testRemoveBooleanArray()
417 assertArrayEquals(new boolean[]{false}, array); in testRemoveBooleanArray()
418 assertEquals(Boolean.TYPE, array.getClass().getComponentType()); in testRemoveBooleanArray()
419 array = ArrayUtils.remove(new boolean[] {true, false}, 1); in testRemoveBooleanArray()
420 assertArrayEquals(new boolean[]{true}, array); in testRemoveBooleanArray()
421 assertEquals(Boolean.TYPE, array.getClass().getComponentType()); in testRemoveBooleanArray()
[all …]
/aosp_15_r20/out/soong/.intermediates/libcore/core_oj_api_files/gen/gensrcs/libcore/ojluni/src/main/java/java/lang/reflect/
DArray.java138 public static int getLength(Object array) in getLength() argument
140 if (array instanceof Object[]) { in getLength()
141 return ((Object[]) array).length; in getLength()
142 } else if (array instanceof boolean[]) { in getLength()
143 return ((boolean[]) array).length; in getLength()
144 } else if (array instanceof byte[]) { in getLength()
145 return ((byte[]) array).length; in getLength()
146 } else if (array instanceof char[]) { in getLength()
147 return ((char[]) array).length; in getLength()
148 } else if (array instanceof double[]) { in getLength()
[all …]
/aosp_15_r20/libcore/ojluni/src/main/java/java/lang/reflect/
H A DArray.java138 public static int getLength(Object array) in getLength() argument
140 if (array instanceof Object[]) { in getLength()
141 return ((Object[]) array).length; in getLength()
142 } else if (array instanceof boolean[]) { in getLength()
143 return ((boolean[]) array).length; in getLength()
144 } else if (array instanceof byte[]) { in getLength()
145 return ((byte[]) array).length; in getLength()
146 } else if (array instanceof char[]) { in getLength()
147 return ((char[]) array).length; in getLength()
148 } else if (array instanceof double[]) { in getLength()
[all …]
/aosp_15_r20/out/soong/.intermediates/libcore/core_oj_api_files/gen/3/libcore/ojluni/src/main/java/java/lang/reflect/
DArray.java138 public static int getLength(Object array) in getLength() argument
140 if (array instanceof Object[]) { in getLength()
141 return ((Object[]) array).length; in getLength()
142 } else if (array instanceof boolean[]) { in getLength()
143 return ((boolean[]) array).length; in getLength()
144 } else if (array instanceof byte[]) { in getLength()
145 return ((byte[]) array).length; in getLength()
146 } else if (array instanceof char[]) { in getLength()
147 return ((char[]) array).length; in getLength()
148 } else if (array instanceof double[]) { in getLength()
[all …]
/aosp_15_r20/external/protobuf/objectivec/Tests/
H A DGPBArrayTests.m101 //% GPB##NAME##Array *array = [[GPB##NAME##Array alloc] init];
102 //% XCTAssertNotNil(array);
103 //% XCTAssertEqual(array.count, 0U);
104 //% XCTAssertThrowsSpecificNamed([array valueAtIndex:0], NSException, NSRangeException);
105 //% [array enumerateValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) {
109 //% [array enumerateValuesWithOptions:NSEnumerationReverse
114 //% [array release];
118 //% GPB##NAME##Array *array = [GPB##NAME##Array arrayWithValue:VAL1];
119 //% XCTAssertNotNil(array);
120 //% XCTAssertEqual(array.count, 1U);
[all …]
/aosp_15_r20/external/cronet/third_party/protobuf/objectivec/Tests/
H A DGPBArrayTests.m101 //% GPB##NAME##Array *array = [[GPB##NAME##Array alloc] init];
102 //% XCTAssertNotNil(array);
103 //% XCTAssertEqual(array.count, 0U);
104 //% XCTAssertThrowsSpecificNamed([array valueAtIndex:0], NSException, NSRangeException);
105 //% [array enumerateValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) {
109 //% [array enumerateValuesWithOptions:NSEnumerationReverse
114 //% [array release];
118 //% GPB##NAME##Array *array = [GPB##NAME##Array arrayWithValue:VAL1];
119 //% XCTAssertNotNil(array);
120 //% XCTAssertEqual(array.count, 1U);
[all …]
/aosp_15_r20/external/liblc3/test/
H A Dappendix_c.py24 NBYTES = (32e3 * np.array([ 7.5e-3, 10e-3 ]) / 8).astype(int)
29 X_PCM_10M = np.array([
75 X_PCM_7M5 = np.array([
116 X_10M = np.array([
202 X_7M5 = np.array([
273 X_TILDE_12K8D_10M = np.array([
345 X_TILDE_12K8D_7M5 = np.array([
406 T_CURR_10M = np.array([ 25, 26 ])
407 T_CURR_7M5 = np.array([ 22, 25 ])
410 NORMCORR_10M = np.array([ 0.677220, 0.992748 ])
[all …]
/aosp_15_r20/external/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/
H A Dstable_partition.pass.cpp42 P array[] = in test() local
55 const unsigned size = sizeof(array)/sizeof(array[0]); in test()
56 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); in test()
57 assert(base(r) == array + 4); in test()
58 assert(array[0] == P(1, 1)); in test()
59 assert(array[1] == P(1, 2)); in test()
60 assert(array[2] == P(3, 1)); in test()
61 assert(array[3] == P(3, 2)); in test()
62 assert(array[4] == P(0, 1)); in test()
63 assert(array[5] == P(0, 2)); in test()
[all …]
/aosp_15_r20/external/python/cpython2/Lib/test/
Dtest_array.py9 import array, cStringIO
13 class ArraySubclass(array.array):
16 class ArraySubclassWithKwargs(array.array):
18 array.array.__init__(self, typecode)
28 self.assertRaises(TypeError, array.array)
29 self.assertRaises(TypeError, array.array, spam=42)
30 self.assertRaises(TypeError, array.array, 'xx')
31 self.assertRaises(TypeError, array.array, '')
32 self.assertRaises(TypeError, array.array, 1)
33 self.assertRaises(ValueError, array.array, 'x')
[all …]
/aosp_15_r20/external/llvm-libc/test/src/stdlib/
H A DSortingTest.h32 int array[25] = {10, 23, 33, 35, 55, 70, 71, 100, 110, in test_sorted_array() local
35 constexpr size_t ARRAY_SIZE = sizeof(array) / sizeof(int); in test_sorted_array()
37 auto arr = Array(reinterpret_cast<uint8_t *>(array), ARRAY_SIZE, in test_sorted_array()
42 ASSERT_LE(array[0], 10); in test_sorted_array()
43 ASSERT_LE(array[1], 23); in test_sorted_array()
44 ASSERT_LE(array[2], 33); in test_sorted_array()
45 ASSERT_LE(array[3], 35); in test_sorted_array()
46 ASSERT_LE(array[4], 55); in test_sorted_array()
47 ASSERT_LE(array[5], 70); in test_sorted_array()
48 ASSERT_LE(array[6], 71); in test_sorted_array()
[all …]
/aosp_15_r20/external/cronet/third_party/libc++/src/test/std/algorithms/alg.modifying.operations/alg.partitions/
H A Dstable_partition.pass.cpp43 P array[] = in test() local
56 const unsigned size = sizeof(array)/sizeof(array[0]); in test()
57 Iter r = std::stable_partition(Iter(array), Iter(array+size), odd_first()); in test()
58 assert(base(r) == array + 4); in test()
59 assert(array[0] == P(1, 1)); in test()
60 assert(array[1] == P(1, 2)); in test()
61 assert(array[2] == P(3, 1)); in test()
62 assert(array[3] == P(3, 2)); in test()
63 assert(array[4] == P(0, 1)); in test()
64 assert(array[5] == P(0, 2)); in test()
[all …]
/aosp_15_r20/libcore/json/src/test/java/libcore/org/json/
H A DJSONArrayTest.java36 JSONArray array = new JSONArray(); in testEmptyArray() local
37 assertEquals(0, array.length()); in testEmptyArray()
38 assertEquals("", array.join(" AND ")); in testEmptyArray()
40 array.get(0); in testEmptyArray()
45 array.getBoolean(0); in testEmptyArray()
50 assertEquals("[]", array.toString()); in testEmptyArray()
51 assertEquals("[]", array.toString(4)); in testEmptyArray()
54 assertTrue(array.isNull(0)); in testEmptyArray()
55 assertNull(array.opt(0)); in testEmptyArray()
56 assertFalse(array.optBoolean(0)); in testEmptyArray()
[all …]
/aosp_15_r20/external/angle/third_party/glslang/src/Test/baseResults/
H A D430AofA.frag.out2 ERROR: 0:6: '[]' : only outermost dimension of an array of arrays can be implicitly sized
3 ERROR: 0:14: 'constructor' : constructing non-array constituent from array argument
4 ERROR: 0:15: 'constructor' : array constructor argument not correct type to construct array element
5 ERROR: 0:28: '[' : array index out of range '4'
6 …t convert parameter 2 from ' const 3-element array of 4-component vector of float' to ' temp 2-ele…
7 …t convert parameter 2 from ' const 2-element array of 4-component vector of float' to ' temp 3-ele…
8 …rt from ' const 3-element array of 2-element array of 4-component vector of float' to ' temp 4-ele…
9 …not convert from ' global 4-element array of 7-element array of float' to ' global 5-element array
10 …convert from ' global 4-element array of 7-element array of float' to ' global unsized 1-element a…
12 …ype ' global 4-element array of 7-element array of float' and a right operand of type ' global 5-e…
[all …]
/aosp_15_r20/external/deqp-deps/glslang/Test/baseResults/
D430AofA.frag.out2 ERROR: 0:6: '[]' : only outermost dimension of an array of arrays can be implicitly sized
3 ERROR: 0:14: 'constructor' : constructing non-array constituent from array argument
4 ERROR: 0:15: 'constructor' : array constructor argument not correct type to construct array element
5 ERROR: 0:28: '[' : array index out of range '4'
6 …t convert parameter 2 from ' const 3-element array of 4-component vector of float' to ' temp 2-ele…
7 …t convert parameter 2 from ' const 2-element array of 4-component vector of float' to ' temp 3-ele…
8 …rt from ' const 3-element array of 2-element array of 4-component vector of float' to ' temp 4-ele…
9 …not convert from ' global 4-element array of 7-element array of float' to ' global 5-element array
10 …convert from ' global 4-element array of 7-element array of float' to ' global unsized 1-element a…
12 …ype ' global 4-element array of 7-element array of float' and a right operand of type ' global 5-e…
[all …]
/aosp_15_r20/external/kmod/testsuite/
H A Dtest-array.c31 struct array array; in test_array_append1() local
34 array_init(&array, 2); in test_array_append1()
35 array_append(&array, c1); in test_array_append1()
36 assert_return(array.count == 1, EXIT_FAILURE); in test_array_append1()
37 assert_return(array.array[0] == c1, EXIT_FAILURE); in test_array_append1()
38 array_free_array(&array); in test_array_append1()
48 struct array array; in test_array_append2() local
53 array_init(&array, 2); in test_array_append2()
54 array_append(&array, c1); in test_array_append2()
55 array_append(&array, c2); in test_array_append2()
[all …]
/aosp_15_r20/art/test/449-checker-bce/src/
H A DMain.java72 static void narrow(int[] array, int offset) { in narrow() argument
76 if (offset < array.length) { in narrow()
79 array[offset] = 1; in narrow()
83 if (biased_offset1 < array.length) { in narrow()
86 array[biased_offset1] = 1; in narrow()
92 if (biased_offset2 < array.length) { in narrow()
95 array[biased_offset2] = 1; in narrow()
101 array[offset_sub1] = 1; // Bounds check can be eliminated. in narrow()
107 array[offset_sub2] = 1; // Bounds check can't be eliminated. in narrow()
126 static void constantIndexing1(int[] array) { in constantIndexing1() argument
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tests/
H A Dbinary_ops_test.py82 np.array([[[[-1, 2.00009999], [-3, b]]]], dtype=dtype),
83 np.array([[[[a, 2], [-3.00009, 4]]]], dtype=dtype),
84 expected=np.array([[[[False, True], [True, False]]]], dtype=dtype))
88 np.array([3, 3, -1.5, -8, 44], dtype=dtype),
89 np.array([2, -2, 7, -4, 0], dtype=dtype),
90 expected=np.array(
97 np.array([0, np.sqrt(2), 1, np.sqrt(2), 0], dtype),
98 np.array([1, np.sqrt(2), 0, -np.sqrt(2), -1], dtype),
99 expected=np.array([0, np.pi / 4, np.pi / 2, np.pi * 3 / 4, np.pi],
104 np.array([4, -3, -2, 1], dtype=dtype),
[all …]
/aosp_15_r20/external/openthread/tests/unit/
H A Dtest_heap_array.cpp183 Heap::Array<uint16_t, 2> array; in TestHeapArrayOfUint16() local
192 VerifyOrQuit(array.GetCapacity() == 0); in TestHeapArrayOfUint16()
193 VerifyArray(array); in TestHeapArrayOfUint16()
198 SuccessOrQuit(array.PushBack(1)); in TestHeapArrayOfUint16()
199 VerifyArray(array, 1); in TestHeapArrayOfUint16()
200 VerifyOrQuit(array.GetCapacity() == 2); in TestHeapArrayOfUint16()
202 SuccessOrQuit(array.PushBack(2)); in TestHeapArrayOfUint16()
203 VerifyArray(array, 1, 2); in TestHeapArrayOfUint16()
204 VerifyOrQuit(array.GetCapacity() == 2); in TestHeapArrayOfUint16()
206 SuccessOrQuit(array.PushBack(3)); in TestHeapArrayOfUint16()
[all …]
/aosp_15_r20/external/caliper/examples/src/main/java/examples/
H A DCopyArrayBenchmark.java50 @Override Object[] copy(Object[] array) { in copy() argument
51 return array.clone(); in copy()
53 @Override boolean[] copy(boolean[] array) { in copy() argument
54 return array.clone(); in copy()
56 @Override byte[] copy(byte[] array) { in copy() argument
57 return array.clone(); in copy()
59 @Override char[] copy(char[] array) { in copy() argument
60 return array.clone(); in copy()
62 @Override double[] copy(double[] array) { in copy() argument
63 return array.clone(); in copy()
[all …]
/aosp_15_r20/libcore/ojluni/src/test/java/lang/invoke/VarHandles/
H A DVarHandleTestByteArrayAsInt.java206 byte[] array = null; in testArrayNPE()
210 int x = (int) vh.get(array, ci); in testArrayNPE()
214 vh.set(array, ci, VALUE_1); in testArrayNPE()
218 int x = (int) vh.getVolatile(array, ci); in testArrayNPE()
222 int x = (int) vh.getAcquire(array, ci); in testArrayNPE()
226 int x = (int) vh.getOpaque(array, ci); in testArrayNPE()
230 vh.setVolatile(array, ci, VALUE_1); in testArrayNPE()
234 vh.setRelease(array, ci, VALUE_1); in testArrayNPE()
238 vh.setOpaque(array, ci, VALUE_1); in testArrayNPE()
242 boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2); in testArrayNPE()
[all …]
H A DVarHandleTestByteArrayAsLong.java206 byte[] array = null; in testArrayNPE()
210 long x = (long) vh.get(array, ci); in testArrayNPE()
214 vh.set(array, ci, VALUE_1); in testArrayNPE()
218 long x = (long) vh.getVolatile(array, ci); in testArrayNPE()
222 long x = (long) vh.getAcquire(array, ci); in testArrayNPE()
226 long x = (long) vh.getOpaque(array, ci); in testArrayNPE()
230 vh.setVolatile(array, ci, VALUE_1); in testArrayNPE()
234 vh.setRelease(array, ci, VALUE_1); in testArrayNPE()
238 vh.setOpaque(array, ci, VALUE_1); in testArrayNPE()
242 boolean r = vh.compareAndSet(array, ci, VALUE_1, VALUE_2); in testArrayNPE()
[all …]

12345678910>>...779