Home
last modified time | relevance | path

Searched refs:r (Results 1 – 25 of 193) sorted by relevance

12345678

/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
DNullCipherTest.java102 byte [] r = c.update(b); in testUpdatebyteArray()
103 assertEquals("different length", b.length, r.length); in testUpdatebyteArray()
104 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArray()
112 byte [] r = c.update(b, 0, 5); in testUpdatebyteArrayintint()
113 assertEquals("different length", b.length, r.length); in testUpdatebyteArrayintint()
114 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArrayintint()
116 r = c.update(b, 1, 3); in testUpdatebyteArrayintint()
117 assertEquals("different length", 3, r.length); in testUpdatebyteArrayintint()
119 assertEquals("different content", b[i + 1], r[i]); in testUpdatebyteArrayintint()
128 byte [] r = new byte[5]; in testUpdatebyteArrayintintbyteArray()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadLocalRandom8Test.java43 ThreadLocalRandom r = ThreadLocalRandom.current(); in testBadStreamSize() local
45 () -> r.ints(-1L), in testBadStreamSize()
46 () -> r.ints(-1L, 2, 3), in testBadStreamSize()
47 () -> r.longs(-1L), in testBadStreamSize()
48 () -> r.longs(-1L, -1L, 1L), in testBadStreamSize()
49 () -> r.doubles(-1L), in testBadStreamSize()
50 () -> r.doubles(-1L, .5, .6), in testBadStreamSize()
60 ThreadLocalRandom r = ThreadLocalRandom.current(); in testBadStreamBounds() local
62 () -> r.ints(2, 1), in testBadStreamBounds()
63 () -> r.ints(10, 42, 42), in testBadStreamBounds()
[all …]
/libcore/ojluni/src/main/java/java/util/
DAbstractCollection.java136 Object[] r = new Object[size()]; in toArray() local
138 for (int i = 0; i < r.length; i++) { in toArray()
140 return Arrays.copyOf(r, i); in toArray()
141 r[i] = it.next(); in toArray()
143 return it.hasNext() ? finishToArray(r, it) : r; in toArray()
177 T[] r = a.length >= size ? a : in toArray() local
182 for (int i = 0; i < r.length; i++) { in toArray()
184 if (a == r) { in toArray()
185 r[i] = null; // null-terminate in toArray()
187 return Arrays.copyOf(r, i); in toArray()
[all …]
DSplittableRandom.java292 long r = mix64(nextSeed()); in internalNextLong() local
296 r = (r & m) + origin; in internalNextLong()
298 for (long u = r >>> 1; // ensure nonnegative in internalNextLong()
299 u + m - (r = u % n) < 0L; // rejection check in internalNextLong()
302 r += origin; in internalNextLong()
305 while (r < origin || r >= bound) in internalNextLong()
306 r = mix64(nextSeed()); in internalNextLong()
309 return r; in internalNextLong()
321 int r = mix32(nextSeed()); in internalNextInt() local
325 r = (r & m) + origin; in internalNextInt()
[all …]
DRandom.java245 long r = nextLong(); in internalNextLong() local
249 r = (r & m) + origin; in internalNextLong()
251 for (long u = r >>> 1; // ensure nonnegative in internalNextLong()
252 u + m - (r = u % n) < 0L; // rejection check in internalNextLong()
255 r += origin; in internalNextLong()
258 while (r < origin || r >= bound) in internalNextLong()
259 r = nextLong(); in internalNextLong()
262 return r; in internalNextLong()
282 int r; in internalNextInt() local
284 r = nextInt(); in internalNextInt()
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOldAndroidStringReaderTest.java42 int r; in read() local
45 r = a.read(); in read()
46 if (r != -1) in read()
47 builder.append((char) r); in read()
48 } while (r != -1); in read()
62 int r; in skipRead() local
66 r = a.read(); in skipRead()
67 if (r != -1) in skipRead()
68 builder.append((char) r); in skipRead()
69 } while (r != -1); in skipRead()
[all …]
DOldAndroidByteArrayInputStreamTest.java45 int r; in read() local
48 r = a.read(); in read()
49 if (r != -1) in read()
50 builder.append((char) r); in read()
51 } while (r != -1); in read()
65 int r; in skipRead() local
69 r = a.read(); in skipRead()
70 if (r != -1) in skipRead()
71 builder.append((char) r); in skipRead()
72 } while (r != -1); in skipRead()
[all …]
DOldAndroidCharArrayReaderTest.java44 int r; in read() local
47 r = a.read(); in read()
48 if (r != -1) in read()
49 builder.append((char) r); in read()
50 } while (r != -1); in read()
64 int r; in skipRead() local
68 r = a.read(); in skipRead()
69 if (r != -1) in skipRead()
70 builder.append((char) r); in skipRead()
71 } while (r != -1); in skipRead()
[all …]
DOldBufferedReaderTest.java147 int r = br.read(); in test_read() local
148 assertTrue("Char read improperly", testString.charAt(0) == r); in test_read()
328 BufferedReader r = new BufferedReader(new StringReader("1\r2\n3\r\n4")); in test_readLine_all_line_endings() local
329 assertEquals("1", r.readLine()); in test_readLine_all_line_endings()
330 assertEquals("2", r.readLine()); in test_readLine_all_line_endings()
331 assertEquals("3", r.readLine()); in test_readLine_all_line_endings()
332 assertEquals("4", r.readLine()); in test_readLine_all_line_endings()
333 assertNull(r.readLine()); in test_readLine_all_line_endings()
337 BufferedReader r = new BufferedReader(new StringReader("1\r\n2")); in test_readLine_interaction_with_read() local
338 assertEquals('1', r.read()); in test_readLine_interaction_with_read()
[all …]
DOldAndroidBufferedReaderTest.java67 int r; in read() local
70 r = a.read(); in read()
71 if (r != -1) in read()
72 builder.append((char) r); in read()
73 } while (r != -1); in read()
87 int r; in skipRead() local
91 r = a.read(); in skipRead()
92 if (r != -1) in skipRead()
93 builder.append((char) r); in skipRead()
94 } while (r != -1); in skipRead()
[all …]
DOldAndroidPushbackInputStreamTest.java59 int r; in read() local
62 r = a.read(); in read()
63 if (r != -1) in read()
64 builder.append((char) r); in read()
65 } while (r != -1); in read()
79 int r; in skipRead() local
83 r = a.read(); in skipRead()
84 if (r != -1) in skipRead()
85 builder.append((char) r); in skipRead()
86 } while (r != -1); in skipRead()
[all …]
DOldAndroidLineNumberReaderTest.java81 int r; in read() local
84 r = a.read(); in read()
85 if (r != -1) in read()
86 builder.append((char) r); in read()
87 } while (r != -1); in read()
101 int r; in skipRead() local
105 r = a.read(); in skipRead()
106 if (r != -1) in skipRead()
107 builder.append((char) r); in skipRead()
108 } while (r != -1); in skipRead()
[all …]
DOldAndroidPushbackReaderTest.java59 int r; in read() local
62 r = a.read(); in read()
63 if (r != -1) in read()
64 builder.append((char) r); in read()
65 } while (r != -1); in read()
79 int r; in skipRead() local
83 r = a.read(); in skipRead()
84 if (r != -1) in skipRead()
85 builder.append((char) r); in skipRead()
86 } while (r != -1); in skipRead()
DOldAndroidDataInputStreamTest.java109 int r; in read() local
112 r = a.read(); in read()
113 if (r != -1) in read()
114 builder.append((char) r); in read()
115 } while (r != -1); in read()
129 int r; in skipRead() local
133 r = a.read(); in skipRead()
134 if (r != -1) in skipRead()
135 builder.append((char) r); in skipRead()
136 } while (r != -1); in skipRead()
[all …]
/libcore/luni/src/test/java/libcore/java/util/logging/
DOldFileHandlerTest.java48 LogRecord r; field in OldFileHandlerTest
77 r = new LogRecord(Level.CONFIG, "msg"); in setUp()
104 handler.publish(r); in testFileHandler()
110 handler.publish(r); in testFileHandler()
114 new LogRecord[] { r, null, r, null, r, null, r }, in testFileHandler()
127 handler.publish(r); in testFileHandler_1params()
134 handler.publish(r); in testFileHandler_1params()
138 r, null, r, null, r, null, r }, new MockFormatter()); in testFileHandler_1params()
146 h.publish(r); in testFileHandler_1params()
147 h2.publish(r); in testFileHandler_1params()
[all …]
/libcore/ojluni/src/main/java/java/lang/ref/
DReferenceQueue.java66 private boolean enqueueLocked(Reference<? extends T> r) { in enqueueLocked() argument
68 if (r.queueNext != null) { in enqueueLocked()
72 if (r instanceof Cleaner) { in enqueueLocked()
76 Cleaner cl = (sun.misc.Cleaner) r; in enqueueLocked()
81 r.queueNext = sQueueNextUnenqueued; in enqueueLocked()
86 head = r; in enqueueLocked()
88 tail.queueNext = r; in enqueueLocked()
90 tail = r; in enqueueLocked()
91 tail.queueNext = r; in enqueueLocked()
125 Reference<? extends T> r = head; in reallyPollLocked() local
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DThreadLocalRandom.java190 Thread t; long r; // read and update per-thread seed in nextSeed() local
192 r = U.getLong(t, SEED) + GAMMA); in nextSeed()
193 return r; in nextSeed()
211 long r = mix64(nextSeed()); in internalNextLong() local
215 r = (r & m) + origin; in internalNextLong()
217 for (long u = r >>> 1; // ensure nonnegative in internalNextLong()
218 u + m - (r = u % n) < 0L; // rejection check in internalNextLong()
221 r += origin; in internalNextLong()
224 while (r < origin || r >= bound) in internalNextLong()
225 r = mix64(nextSeed()); in internalNextLong()
[all …]
DCompletableFuture.java225 final boolean internalComplete(Object r) { // CAS from null to r in internalComplete() argument
226 return U.compareAndSwapObject(this, RESULT, null, r); in internalComplete()
294 static Object encodeThrowable(Throwable x, Object r) { in encodeThrowable() argument
297 else if (r instanceof AltResult && x == ((AltResult)r).ex) in encodeThrowable()
298 return r; in encodeThrowable()
310 final boolean completeThrowable(Throwable x, Object r) { in completeThrowable() argument
312 encodeThrowable(x, r)); in completeThrowable()
328 static Object encodeRelay(Object r) { in encodeRelay() argument
330 return (((r instanceof AltResult) && in encodeRelay()
331 (x = ((AltResult)r).ex) != null && in encodeRelay()
[all …]
/libcore/luni/src/main/java/java/math/
DBigInt.java231 BigInt r = newBigInt(); in shift() local
232 NativeBN.BN_shift(r.bignum, a.bignum, n); in shift()
233 return r; in shift()
253 BigInt r = newBigInt(); in addition() local
254 NativeBN.BN_add(r.bignum, a.bignum, b.bignum); in addition()
255 return r; in addition()
263 BigInt r = newBigInt(); in subtraction() local
264 NativeBN.BN_sub(r.bignum, a.bignum, b.bignum); in subtraction()
265 return r; in subtraction()
270 BigInt r = newBigInt(); in gcd() local
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DBigIntegerBenchmark.java24 Random r = new Random(); in timeRandomDivision() local
25 BigInteger x = new BigInteger(1024, r); in timeRandomDivision()
26 BigInteger y = new BigInteger(1024, r); in timeRandomDivision()
33 Random r = new Random(); in timeRandomGcd() local
34 BigInteger x = new BigInteger(1024, r); in timeRandomGcd()
35 BigInteger y = new BigInteger(1024, r); in timeRandomGcd()
42 Random r = new Random(); in timeRandomMultiplication() local
43 BigInteger x = new BigInteger(1024, r); in timeRandomMultiplication()
44 BigInteger y = new BigInteger(1024, r); in timeRandomMultiplication()
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DLockSupport.java395 int r; in nextSecondarySeed() local
397 if ((r = U.getInt(t, SECONDARY)) != 0) { in nextSecondarySeed()
398 r ^= r << 13; // xorshift in nextSecondarySeed()
399 r ^= r >>> 17; in nextSecondarySeed()
400 r ^= r << 5; in nextSecondarySeed()
402 else if ((r = java.util.concurrent.ThreadLocalRandom.current().nextInt()) == 0) in nextSecondarySeed()
403 r = 1; // avoid zero in nextSecondarySeed()
404 U.putInt(t, SECONDARY, r); in nextSecondarySeed()
405 return r; in nextSecondarySeed()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DRandomTest.java27 private Random r; field in RandomTest
41 Random r = new Random(8409238L); in test_ConstructorJ() local
44 assertTrue("Values from randoms with same seed don't match", r in test_ConstructorJ()
49 Random r = new Random(); in test_setSeed() local
50 r.setSeed(1337); in test_setSeed()
54 assertTrue("Values from randoms with same seed don't match", r in test_setSeed()
66 if (r.nextBoolean()) in test_nextBoolean()
83 r.nextBytes(randomBytes); in test_nextBytes$B()
98 double lastNum = r.nextDouble(); in test_nextDouble()
103 nextNum = r.nextDouble(); in test_nextDouble()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DMath.java670 int r = ((intBits & FloatConsts.SIGNIF_BIT_MASK) in round() local
673 r = -r; in round()
681 return ((r >> shift) + 1) >> 1; in round()
719 long r = ((longBits & DoubleConsts.SIGNIF_BIT_MASK) in round() local
722 r = -r; in round()
730 return ((r >> shift) + 1) >> 1; in round()
810 int r = x + y; in addExact() local
812 if (((x ^ r) & (y ^ r)) < 0) { in addExact()
815 return r; in addExact()
829 long r = x + y; in addExact() local
[all …]
/libcore/luni/src/test/java/tests/java/sql/
DUpdateFunctionalityTest2.java189 ResultSet r = statement.executeQuery("SELECT COUNT(*) " + "FROM " in testUpdate5() local
191 r.next(); in testUpdate5()
192 assertEquals("Should be 2 rows", 2, r.getInt(1)); in testUpdate5()
193 r = statement.executeQuery("SELECT COUNT(*) " + "FROM " in testUpdate5()
195 r.next(); in testUpdate5()
196 assertEquals("Should be 0 rows", 0, r.getInt(1)); in testUpdate5()
197 r.close(); in testUpdate5()
232 ResultSet r = statement.executeQuery("SELECT COUNT(*) FROM " in testUpdate7() local
234 r.next(); in testUpdate7()
235 assertEquals("Should be 1 row", 1, r.getInt(1)); in testUpdate7()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DRuntimeTest.java28 Runtime r = Runtime.getRuntime(); field in RuntimeTest
106 r.gc(); in test_runFinalization()
107 r.runFinalization(); in test_runFinalization()
117 assertTrue("freeMemory < 0", r.freeMemory() >= 0); in test_memory()
118 assertTrue("totalMemory() < freeMemory()", r.totalMemory() >= r.freeMemory()); in test_memory()
119 assertTrue("maxMemory() < totalMemory()", r.maxMemory() >= r.totalMemory()); in test_memory()

12345678