Home
last modified time | relevance | path

Searched refs:r (Results 1 – 25 of 178) 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()
176 T[] r = a.length >= size ? a : in toArray() local
181 for (int i = 0; i < r.length; i++) { in toArray()
183 if (a == r) { in toArray()
184 r[i] = null; // null-terminate in toArray()
186 return Arrays.copyOf(r, i); in toArray()
[all …]
DSplittableRandom.java293 long r = mix64(nextSeed()); in internalNextLong() local
297 r = (r & m) + origin; in internalNextLong()
299 for (long u = r >>> 1; // ensure nonnegative in internalNextLong()
300 u + m - (r = u % n) < 0L; // rejection check in internalNextLong()
303 r += origin; in internalNextLong()
306 while (r < origin || r >= bound) in internalNextLong()
307 r = mix64(nextSeed()); in internalNextLong()
310 return r; in internalNextLong()
322 int r = mix32(nextSeed()); in internalNextInt() local
326 r = (r & m) + origin; in internalNextInt()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DMath.java621 int r = ((intBits & FloatConsts.SIGNIF_BIT_MASK) in round() local
624 r = -r; in round()
632 return ((r >> shift) + 1) >> 1; in round()
670 long r = ((longBits & DoubleConsts.SIGNIF_BIT_MASK) in round() local
673 r = -r; in round()
681 return ((r >> shift) + 1) >> 1; in round()
750 int r = x + y; in addExact() local
752 if (((x ^ r) & (y ^ r)) < 0) { in addExact()
755 return r; in addExact()
769 long r = x + y; in addExact() local
[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 …]
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 …]
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 …]
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 …]
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.java47 LogRecord r; field in OldFileHandlerTest
77 r = new LogRecord(Level.CONFIG, "msg"); in setUp()
102 handler.publish(r); in testFileHandler()
108 handler.publish(r); in testFileHandler()
112 new LogRecord[] { r, null, r, null, r, null, r }, in testFileHandler()
126 handler.publish(r); in testFileHandler_1params()
133 handler.publish(r); in testFileHandler_1params()
137 r, null, r, null, r, null, r }, new MockFormatter()); in testFileHandler_1params()
145 h.publish(r); in testFileHandler_1params()
146 h2.publish(r); in testFileHandler_1params()
[all …]
/libcore/ojluni/src/main/java/java/lang/ref/
DReferenceQueue.java64 private boolean enqueueLocked(Reference<? extends T> r) { in enqueueLocked() argument
66 if (r.queueNext != null) { in enqueueLocked()
70 if (r instanceof Cleaner) { in enqueueLocked()
74 Cleaner cl = (sun.misc.Cleaner) r; in enqueueLocked()
79 r.queueNext = sQueueNextUnenqueued; in enqueueLocked()
84 head = r; in enqueueLocked()
86 tail.queueNext = r; in enqueueLocked()
88 tail = r; in enqueueLocked()
89 tail.queueNext = r; in enqueueLocked()
123 Reference<? extends T> r = head; in reallyPollLocked() 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/sun/security/jca/
DJCAUtil.java72 SecureRandom r = secureRandom; in getSecureRandom() local
73 if (r == null) { in getSecureRandom()
75 r = secureRandom; in getSecureRandom()
76 if (r == null) { in getSecureRandom()
77 r = new SecureRandom(); in getSecureRandom()
78 secureRandom = r; in getSecureRandom()
82 return r; in getSecureRandom()
/libcore/luni/src/main/java/java/util/concurrent/
DThreadLocalRandom.java161 Thread t; long r; // read and update per-thread seed in nextSeed() local
163 r = U.getLong(t, SEED) + GAMMA); in nextSeed()
164 return r; in nextSeed()
182 long r = mix64(nextSeed()); in internalNextLong() local
186 r = (r & m) + origin; in internalNextLong()
188 for (long u = r >>> 1; // ensure nonnegative in internalNextLong()
189 u + m - (r = u % n) < 0L; // rejection check in internalNextLong()
192 r += origin; in internalNextLong()
195 while (r < origin || r >= bound) in internalNextLong()
196 r = mix64(nextSeed()); in internalNextLong()
[all …]
/libcore/luni/src/main/java/java/math/
DBigInt.java229 BigInt r = newBigInt(); in shift() local
230 NativeBN.BN_shift(r.bignum, a.bignum, n); in shift()
231 return r; in shift()
251 BigInt r = newBigInt(); in addition() local
252 NativeBN.BN_add(r.bignum, a.bignum, b.bignum); in addition()
253 return r; in addition()
261 BigInt r = newBigInt(); in subtraction() local
262 NativeBN.BN_sub(r.bignum, a.bignum, b.bignum); in subtraction()
263 return r; in subtraction()
268 BigInt r = newBigInt(); in gcd() local
[all …]
/libcore/luni/src/main/java/java/util/concurrent/locks/
DLockSupport.java366 int r; in nextSecondarySeed() local
368 if ((r = U.getInt(t, SECONDARY)) != 0) { in nextSecondarySeed()
369 r ^= r << 13; // xorshift in nextSecondarySeed()
370 r ^= r >>> 17; in nextSecondarySeed()
371 r ^= r << 5; in nextSecondarySeed()
373 else if ((r = java.util.concurrent.ThreadLocalRandom.current().nextInt()) == 0) in nextSecondarySeed()
374 r = 1; // avoid zero in nextSecondarySeed()
375 U.putInt(t, SECONDARY, r); in nextSecondarySeed()
376 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/sun/misc/
DFDBigInt.java198 int r[]; in mult() local
202 r = new int[ ( v * ((long)data[nWords-1]&0xffffffffL) > 0xfffffffL ) ? nWords+1 : nWords ]; in mult()
206 r[i] = (int)p; in mult()
210 return new FDBigInt( r, nWords ); in mult()
212 r[nWords] = (int)p; in mult()
213 return new FDBigInt( r, nWords+1 ); in mult()
249 int r[] = new int[ nWords + other.nWords ]; in mult() local
258 …p += ((long)r[i+j]&0xffffffffL) + v*((long)other.data[j]&0xffffffffL); // UNSIGNED CONVERSIONS ALL… in mult()
259 r[i+j] = (int)p; in mult()
262 r[i+j] = (int)p; in mult()
[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