Home
last modified time | relevance | path

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

12345678910

/cts/tests/tests/renderscript/src/android/renderscript/cts/
DRSUtils.java70 public static void genRandomDoubles(long seed, double min, double max, double array[], in genRandomDoubles() argument
78 for (int i = 0; i < array.length; i++) { in genRandomDoubles()
86 array[i] = rand; in genRandomDoubles()
90 for (int i = 0; i < array.length; i++) { in genRandomDoubles()
92 array[i] = min + rand * (max - min); in genRandomDoubles()
99 array[r.nextInt(array.length)] = d; in genRandomDoubles()
102 array[r.nextInt(array.length)] = min; in genRandomDoubles()
103 array[r.nextInt(array.length)] = max; in genRandomDoubles()
105 array[r.nextInt(array.length)] = Double.NaN; in genRandomDoubles()
106 array[r.nextInt(array.length)] = Double.POSITIVE_INFINITY; in genRandomDoubles()
[all …]
DScriptGroupTest.java367 int[] array = new int[ARRAY_SIZE * 4]; in testBuilder2PointWiseKernelToKernelDependency() local
370 array[i] = i; in testBuilder2PointWiseKernelToKernelDependency()
374 input.copyFrom(array); in testBuilder2PointWiseKernelToKernelDependency()
419 int[] array = new int[ARRAY_SIZE * 4]; in testBuilder2GatherScatterAcrossKernelsViaGlobals() local
422 array[i*4] = i * 7; in testBuilder2GatherScatterAcrossKernelsViaGlobals()
423 array[i*4 + 1] = i * 7; in testBuilder2GatherScatterAcrossKernelsViaGlobals()
424 array[i*4 + 2] = i * 7; in testBuilder2GatherScatterAcrossKernelsViaGlobals()
425 array[i*4 + 3] = i * 7; in testBuilder2GatherScatterAcrossKernelsViaGlobals()
429 input.copyFrom(array); in testBuilder2GatherScatterAcrossKernelsViaGlobals()
478 int[] array = new int[ARRAY_SIZE * 4]; in testBuilder2KernelOutputToGlobal() local
[all …]
Dsetelementat.rscript14 rs_allocation array;
37 rsSetElementAt(array, &source, i);
47 rsSetElementAt(array, &source, xtemp, y);
/cts/tests/tests/renderscriptlegacy/src/android/renderscriptlegacy/cts/
DRSUtils.java48 public static void genRandomDoubles(long seed, double min, double max, double array[], in genRandomDoubles() argument
56 for (int i = 0; i < array.length; i++) { in genRandomDoubles()
64 array[i] = rand; in genRandomDoubles()
68 for (int i = 0; i < array.length; i++) { in genRandomDoubles()
70 array[i] = min + rand * (max - min); in genRandomDoubles()
77 array[r.nextInt(array.length)] = d; in genRandomDoubles()
80 array[r.nextInt(array.length)] = min; in genRandomDoubles()
81 array[r.nextInt(array.length)] = max; in genRandomDoubles()
83 array[r.nextInt(array.length)] = Double.NaN; in genRandomDoubles()
84 array[r.nextInt(array.length)] = Double.POSITIVE_INFINITY; in genRandomDoubles()
[all …]
/cts/tests/tests/rscpp/src/android/cts/rscpp/
DRSUtils.java29 public static void genRandom(long seed, int factor, int offset, float array[]) { in genRandom() argument
31 for (int i = 0; i < array.length; i++) { in genRandom()
32 array[i] = r.nextFloat() * factor + offset; in genRandom()
36 public static void genRandom(long seed, int factor, int offset, float array[], in genRandom() argument
39 for (int i = 0; i < array.length / stride; i++) { in genRandom()
42 array[i * stride + j] = 0; in genRandom()
44 array[i * stride + j] = r.nextFloat() * factor + offset; in genRandom()
49 public static void genRandom(long seed, int max, int factor, int offset, int array[]) { in genRandom() argument
51 for (int i = 0; i < array.length; i++) { in genRandom()
52 array[i] = (r.nextInt(max) * factor + offset); in genRandom()
[all …]
/cts/tests/tests/media/audio/jni/
Dsl-utils.h64 jbyte *envGetArrayElements(JNIEnv *env, jbyteArray array, jboolean *isCopy) { in envGetArrayElements() argument
65 return env->GetByteArrayElements(array, isCopy); in envGetArrayElements()
69 void envReleaseArrayElements(JNIEnv *env, jbyteArray array, jbyte *elems, jint mode) { in envReleaseArrayElements() argument
70 env->ReleaseByteArrayElements(array, elems, mode); in envReleaseArrayElements()
74 jshort *envGetArrayElements(JNIEnv *env, jshortArray array, jboolean *isCopy) { in envGetArrayElements() argument
75 return env->GetShortArrayElements(array, isCopy); in envGetArrayElements()
79 void envReleaseArrayElements(JNIEnv *env, jshortArray array, jshort *elems, jint mode) { in envReleaseArrayElements() argument
80 env->ReleaseShortArrayElements(array, elems, mode); in envReleaseArrayElements()
84 jfloat *envGetArrayElements(JNIEnv *env, jfloatArray array, jboolean *isCopy) { in envGetArrayElements() argument
85 return env->GetFloatArrayElements(array, isCopy); in envGetArrayElements()
[all …]
/cts/tests/sample/src/android/sample/cts/
DSampleDeviceResultTest.java73 private int[] array; in testSort()
76 array = createArray(ARRAY_SIZE); in testSort()
80 Arrays.sort(array); in testSort()
81 Assert.assertTrue("Array not sorted", isSorted(array)); in testSort()
103 int[] array = new int[size]; in createArray() local
105 array[i] = random.nextInt(); in createArray()
107 return array; in createArray()
113 private static boolean isSorted(int[] array) { in isSorted() argument
114 int len = array.length; in isSorted()
116 if (array[i] > array[j]) { in isSorted()
/cts/tests/tests/graphics/src/android/graphics/drawable/cts/
DLayerDrawableTest.java99 Drawable[] array = new Drawable[]{mBitmapDrawable, mColorDrawable}; in testConstructor() local
100 LayerDrawable layerDrawable = new LayerDrawable(array); in testConstructor()
101 assertEquals(array.length, layerDrawable.getNumberOfLayers()); in testConstructor()
105 array = new Drawable[0]; in testConstructor()
106 layerDrawable = new LayerDrawable(array); in testConstructor()
117 Drawable[] array = new Drawable[0]; in testInflate() local
118 LayerDrawable layerDrawable = new LayerDrawable(array); in testInflate()
136 layerDrawable = new LayerDrawable(array); in testInflate()
172 Drawable[] array = new Drawable[] { mBitmapDrawable, mColorDrawable }; in testFindDrawableByLayerId() local
173 LayerDrawable layerDrawable = new LayerDrawable(array); in testFindDrawableByLayerId()
[all …]
/cts/tests/tests/security/jni/
Dandroid_security_cts_cve_2021_0394.cpp25 char array[kStringLength]; in android_security_cts_cve_2021_0394_poc() local
26 memset(array, kDefaultValue, kStringLength - 1); in android_security_cts_cve_2021_0394_poc()
27 array[kStringLength - 1] = 0; in android_security_cts_cve_2021_0394_poc()
28 jstring s = env->NewStringUTF(array); in android_security_cts_cve_2021_0394_poc()
33 array[kStringLength - 2] = invalid; in android_security_cts_cve_2021_0394_poc()
34 s = env->NewStringUTF(array); in android_security_cts_cve_2021_0394_poc()
/cts/tests/tests/jni/src/android/jni/cts/
DJniInstanceTest.java181 private void checkShortArray(short[] array) { in checkShortArray() argument
182 assertSame(short[].class, array.getClass()); in checkShortArray()
183 assertEquals(3, array.length); in checkShortArray()
184 assertEquals(10, array[0]); in checkShortArray()
185 assertEquals(20, array[1]); in checkShortArray()
186 assertEquals(30, array[2]); in checkShortArray()
198 private void checkStringArray(String[] array) { in checkStringArray() argument
199 assertSame(String[].class, array.getClass()); in checkStringArray()
200 assertEquals(100, array.length); in checkStringArray()
201 assertEquals("blort", array[0]); in checkStringArray()
[all …]
DJniStaticTest.java256 private void checkShortArray(short[] array) { in checkShortArray() argument
257 assertSame(short[].class, array.getClass()); in checkShortArray()
258 assertEquals(3, array.length); in checkShortArray()
259 assertEquals(10, array[0]); in checkShortArray()
260 assertEquals(20, array[1]); in checkShortArray()
261 assertEquals(30, array[2]); in checkShortArray()
273 private void checkStringArray(String[] array) { in checkStringArray() argument
274 assertSame(String[].class, array.getClass()); in checkStringArray()
275 assertEquals(100, array.length); in checkStringArray()
276 assertEquals("blort", array[0]); in checkStringArray()
[all …]
/cts/tests/tests/preference/src/android/preference/cts/
DListPreferenceTest.java42 R.array.entries_list_preference); in testGetEntries()
49 R.array.entryvalues_list_preference); in testGetEntryValues()
58 private synchronized String[] convertToStringArray(CharSequence[] array) { in convertToStringArray() argument
59 String[] strArray = new String[array.length]; in convertToStringArray()
60 for (int i = 0; i < array.length; i++) { in convertToStringArray()
61 strArray[i] = (String) array[i]; in convertToStringArray()
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DDeviceInfoStore.java180 public void addArrayResult(String name, int[] array) throws IOException { in addArrayResult() argument
184 for (int value : checkArray(array)) { in addArrayResult()
194 public void addArrayResult(String name, long[] array) throws IOException { in addArrayResult() argument
198 for (long value : checkArray(array)) { in addArrayResult()
208 public void addArrayResult(String name, float[] array) throws IOException { in addArrayResult() argument
209 double[] doubleArray = new double[array.length]; in addArrayResult()
210 for (int i = 0; i < array.length; i++) { in addArrayResult()
211 doubleArray[i] = array[i]; in addArrayResult()
220 public void addArrayResult(String name, double[] array) throws IOException { in addArrayResult() argument
224 for (double value : checkArray(array)) { in addArrayResult()
[all …]
/cts/apps/CameraITS/utils/
Dimage_processing_utils_tests.py50 img_check = numpy.array(check_list).reshape(img_h, img_w)
62 chunk_raw10 = numpy.array(packed, dtype='uint8').reshape(1, 5)
107 lut = numpy.array([i*2 for i in range(lut_max)])
108 x = numpy.array(ref_image).reshape((1, 1, 3))
115 srgb_red = numpy.array([[[234, 51, 35]]], dtype='uint8')
116 srgb_green = numpy.array([[[117, 252, 76]]], dtype='uint8')
119 blue = numpy.array([[[0, 0, 255]]], dtype='uint8')
122 p3_red = numpy.array([[[255, 0, 0]]], dtype='uint8')
123 p3_green = numpy.array([[[0, 255, 0]]], dtype='uint8')
/cts/tests/tests/media/codec/src/android/media/codec/cts/
DIvfWriter.java182 private static void lay16Bits(byte[] array, int index, int value){ in lay16Bits() argument
183 array[index] = (byte) (value); in lay16Bits()
184 array[index + 1] = (byte) (value >> 8); in lay16Bits()
196 private static void lay32Bits(byte[] array, int index, int value){ in lay32Bits() argument
198 array[index + i] = (byte) (value >> (i * 8)); in lay32Bits()
211 private static void lay64bits(byte[] array, int index, long value){ in lay64bits() argument
213 array[index + i] = (byte) (value >> (i * 8)); in lay64bits()
/cts/tests/inputmethod/mocka11yime/client/src/com/android/cts/mocka11yime/
DMockA11yImeEventStream.java188 private static boolean areEnterExitPairedMessages(@NonNull EventArray array, in areEnterExitPairedMessages() argument
190 return array.mArray[i] != null in areEnterExitPairedMessages()
191 && array.mArray[i].isEnterEvent() in areEnterExitPairedMessages()
192 && (i + 1) < array.mLength in areEnterExitPairedMessages()
193 && array.mArray[i + 1] != null in areEnterExitPairedMessages()
194 && array.mArray[i].getEventName().equals(array.mArray[i + 1].getEventName()) in areEnterExitPairedMessages()
195 && array.mArray[i].getEnterTimestamp() == array.mArray[i + 1].getEnterTimestamp(); in areEnterExitPairedMessages()
243 EventArray(MockA11yImeEvent[] array, int length) { in EventArray() argument
244 mArray = array; in EventArray()
/cts/tests/inputmethod/mockime/src/com/android/cts/mockime/
DImeEventStream.java194 private static boolean areEnterExitPairedMessages(@NonNull ImeEventArray array, in areEnterExitPairedMessages() argument
196 return array.mArray[i] != null in areEnterExitPairedMessages()
197 && array.mArray[i].isEnterEvent() in areEnterExitPairedMessages()
198 && (i + 1) < array.mLength in areEnterExitPairedMessages()
199 && array.mArray[i + 1] != null in areEnterExitPairedMessages()
200 && array.mArray[i].getEventName().equals(array.mArray[i + 1].getEventName()) in areEnterExitPairedMessages()
201 && array.mArray[i].getEnterTimestamp() == array.mArray[i + 1].getEnterTimestamp(); in areEnterExitPairedMessages()
247 ImeEventArray(ImeEvent[] array, int length) { in ImeEventArray() argument
248 mArray = array; in ImeEventArray()
/cts/tests/tests/util/src/android/util/cts/
DArrayMapTest.java167 private static void compareMaps(HashMap map, ArrayMap array) { in compareMaps() argument
168 if (map.size() != array.size()) { in compareMaps()
169 fail("Bad size: expected " + map.size() + ", got " + array.size()); in compareMaps()
175 Object gotValue = array.get(entry.getKey()); in compareMaps()
182 for (int i=0; i<array.size(); i++) { in compareMaps()
183 Object gotValue = array.valueAt(i); in compareMaps()
184 Object key = array.keyAt(i); in compareMaps()
192 if (map.entrySet().hashCode() != array.entrySet().hashCode()) { in compareMaps()
195 + Integer.toHexString(array.entrySet().hashCode())); in compareMaps()
198 if (!map.entrySet().equals(array.entrySet())) { in compareMaps()
[all …]
DArraySetTest.java140 private static <E> void compareSets(HashSet<E> set, ArraySet<E> array) { in compareSets() argument
141 assertEquals("Bad size", set.size(), array.size()); in compareSets()
145 assertTrue("ArraySet missing value: " + entry, array.contains(entry)); in compareSets()
149 for (E entry : array) { in compareSets()
155 for (int i = 0; i < array.size(); ++i) { in compareSets()
156 E entry = array.valueAt(i); in compareSets()
161 if (set.hashCode() != array.hashCode()) { in compareSets()
162 assertEquals("Set hash codes differ", set.hashCode(), array.hashCode()); in compareSets()
165 assertTrue("HashSet.equals(ArraySet) failed", set.equals(array)); in compareSets()
166 assertTrue("ArraySet.equals(HashSet) failed", array.equals(set)); in compareSets()
[all …]
/cts/tests/tests/content/src/android/content/res/cts/
DArrayTest.java82 checkStringArray(R.array.strings, new String[] {"zero", "1", "here"}); in testStrings()
83 checkTextArray(R.array.strings, new String[] {"zero", "1", "here"}); in testStrings()
84 checkStringArray(R.array.integers, new String[] {null, null, null}); in testStrings()
85 checkTextArray(R.array.integers, new String[] {null, null, null}); in testStrings()
91 checkIntArray(R.array.strings, new int[] {0, 0, 0}); in testIntegers()
92 checkIntArray(R.array.integers, new int[] {0, 1, 101}); in testIntegers()
/cts/tests/tests/view/src/android/view/cts/
DViewGroup_LayoutParamsTest.java70 TypedArray array = mContext.getTheme().obtainStyledAttributes(R.style.Whatever, attrs); in testSetBaseAttributes() local
71 mockLayoutParams.setBaseAttributes(array, R.styleable.style1_type6, in testSetBaseAttributes()
74 assertEquals(array.getDimensionPixelSize(R.styleable.style1_type6, defValue), in testSetBaseAttributes()
76 assertEquals(array.getDimensionPixelSize(R.styleable.style1_type7, defValue), in testSetBaseAttributes()
78 array.recycle(); in testSetBaseAttributes()
/cts/tests/tests/rscpp/librscpptest/
Dsetelementat.rscript13 rs_allocation array;
36 rsSetElementAt(array, &source, i);
46 rsSetElementAt(array, &source, xtemp, y);
/cts/tests/tests/contactsprovider/src/android/provider/cts/contacts/
DCommonDatabaseUtils.java62 private static void fillArray(Cursor cursor, String[] array) { in fillArray() argument
63 for (int i = 0; i < array.length; i++) { in fillArray()
64 array[i] = cursor.getString(i); in fillArray()
/cts/tests/tests/openglperf/src/android/openglperf/cts/
DSphere.java152 private int max(int[] array) { in max() argument
153 int max = array[0]; in max()
154 for (int i = 1; i < array.length; i++) { in max()
155 if (array[i] > max) max = array[i]; in max()
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DCellBroadcastDataMigrationTest.java78 private static <T> void assertEmpty(String message, T[] array) { in assertEmpty() argument
79 if (array != null && array.length > 0) { in assertEmpty()

12345678910