Home
last modified time | relevance | path

Searched refs:nextInt (Results 1 – 25 of 158) sorted by relevance

1234567

/libcore/ojluni/src/test/java/lang/StringBuffer/
DAppendCharSequence.java71 int index = generator.nextInt(100); in bash()
72 int len = generator.nextInt(100); in bash()
74 index = generator.nextInt(100); in bash()
75 len = generator.nextInt(100); in bash()
84 index = generator.nextInt(100); in bash()
86 index = generator.nextInt(100); in bash()
95 int index1 = generator.nextInt(100); in bash()
97 index1 = generator.nextInt(100); in bash()
99 int index2 = generator.nextInt(100); in bash()
100 len = generator.nextInt(100); in bash()
[all …]
DTrim.java60 if (generator.nextInt(2) == 0) in bash()
72 if (generator.nextInt(2) == 0) in bash()
91 int sizeNeeded = generator.nextInt(1000)+1; in capacityCheck()
92 int sizeExtra = generator.nextInt(100) + 1; in capacityCheck()
110 int x = generator.nextInt(range); in getRandomIndex()
118 int achar = generator.nextInt(30)+30; in generateTestBuffer()
DIndexOf.java63 int achar = generator.nextInt(30)+30; in generateTestString()
72 int x = generator.nextInt(range); in getRandomIndex()
89 int index1 = generator.nextInt(90) + 5; in simpleTest()
118 int index1 = generator.nextInt(100); in compareIndexOfLastIndexOf()
156 x1 = generator.nextInt(len); in compareStringStringBuffer()
157 x2 = generator.nextInt(100); in compareStringStringBuffer()
/libcore/ojluni/src/test/java/util/BitSet/
DBSMethods.java180 int numberOfSetBits = generator.nextInt(100) + 1; in testNextSetBit()
187 nextBitToSet += generator.nextInt(30)+1; in testNextSetBit()
219 nextBitToClear += generator.nextInt(24)+1; in testNextClearBit()
259 int numberOfSetBits = generator.nextInt(100) + 1; in testSetGetClearFlip()
260 int highestPossibleSetBit = generator.nextInt(1000) + 1; in testSetGetClearFlip()
262 nextBitToSet = generator.nextInt(highestPossibleSetBit); in testSetGetClearFlip()
357 b1.set(generator.nextInt(255)); in testAndNot()
361 b2.set(generator.nextInt(255)); in testAndNot()
391 b1.set(generator.nextInt(255)); in testAnd()
395 b2.set(generator.nextInt(255)); in testAnd()
[all …]
DImportExport.java53 Arrays.copyOf(bytes, bytes.length + 8 + rnd.nextInt(8))) in equal()
71 int k = rnd.nextInt(i); in test()
86 byte[] bytes = new byte[rnd.nextInt(17)]; in test()
88 bytes[j] = (byte) rnd.nextInt(0x100); in test()
98 int n = rnd.nextInt(8 * bytes.length); in test()
112 long[] longs = new long[rnd.nextInt(10)]; in test()
119 int beg = rnd.nextInt(10); in test()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DRandomTest.java45 .nextInt() == r2.nextInt()); in test_ConstructorJ()
55 .nextInt() == r2.nextInt()); in test_setSeed()
169 int lastNum = r.nextInt(); in test_nextInt()
173 nextNum = r.nextInt(); in test_nextInt()
188 int lastNum = r.nextInt(range); in test_nextIntI()
193 nextNum = r.nextInt(range); in test_nextIntI()
291 mr.nextInt(); in test_next()
293 mr.nextInt(10); in test_next()
324 assertEquals("should be equal", initialRand.nextInt(), deserializedRand.nextInt());
DSortedMapTestBase.java51 ref.put(rnd.nextInt(N) * 2, rnd.nextBoolean() ? null : rnd.nextInt(N) * 2); in setUp()
62 int key = rnd.nextInt(N); in testContainsKey()
70 int value = rnd.nextInt(N); in testContainsValue()
91 int key = rnd.nextInt(N); in testGet()
113 int key = rnd.nextInt(N); in testPut()
114 int value = rnd.nextInt(N); in testPut()
125 int key = rnd.nextInt(N); in testPut0()
126 int value = rnd.nextInt(N); in testPut0()
135 mixin.put(rnd.nextInt(N), rnd.nextInt(N)); in testPutAll()
145 int key = rnd.nextInt(N); in testRemove()
[all …]
DScannerTest.java397 s.nextInt(); in test_ConstructorLjava_nio_channels_ReadableByteChannel()
1050 assertEquals(123, s.nextInt(10)); in test_nextIntI()
1051 assertEquals(456, s.nextInt(10)); in test_nextIntI()
1053 s.nextInt(10); in test_nextIntI()
1060 assertEquals(38, s.nextInt(5)); in test_nextIntI()
1062 s.nextInt(5); in test_nextIntI()
1070 s.nextInt(10); in test_nextIntI()
1082 s.nextInt(10); in test_nextIntI()
1088 assertEquals(23456, s.nextInt(10)); in test_nextIntI()
1089 assertEquals(23456, s.nextInt(10)); in test_nextIntI()
[all …]
/libcore/ojluni/src/test/java/util/Arrays/
DArrayObjectMethods.java206 switch(rnd.nextInt(10)) { in nextLong()
211 return (long) (rnd.nextInt(20) - 10); in nextLong()
216 public static int nextInt() { in nextInt() method in Rnd
217 switch(rnd.nextInt(10)) { in nextInt()
222 return rnd.nextInt(20) - 10; in nextInt()
223 default: return rnd.nextInt(); in nextInt()
228 switch(rnd.nextInt(10)) { in nextShort()
233 return (short) (rnd.nextInt(20) - 10); in nextShort()
234 default: return (short) rnd.nextInt(); in nextShort()
239 switch(rnd.nextInt(10)) { in nextChar()
[all …]
/libcore/ojluni/src/test/java/nio/channels/Channels/
DBasic2.java96 byte[] buf = new byte[128 + rand.nextInt(128)]; in run()
103 len = 1 + rand.nextInt(64); in run()
104 off = rand.nextInt(64); in run()
135 this.total = 50*1000 + rand.nextInt(50*1000); in Writer()
143 byte[] buf = new byte[1 + rand.nextInt(rem)]; in run()
151 off = rand.nextInt(buf.length); in run()
153 len = (r <= 1) ? 1 : (1 + rand.nextInt(r)); in run()
156 byte value = (byte)rand.nextInt(256); in run()
/libcore/benchmarks/src/benchmarks/regression/
DRandomBenchmark.java26 rng.nextInt(); in timeNewRandom()
33 rng.nextInt(); in timeReusedRandom()
40 rng.nextInt(); in timeReusedSecureRandom()
47 rng.nextInt(); in timeNewSecureRandom()
/libcore/ojluni/src/main/java/jdk/random/
DL32X64MixRandom.java227 return new L32X64MixRandom((int)brine << 1, source.nextInt(), in split()
228 source.nextInt(), source.nextInt()); in split()
232 public int nextInt() { in nextInt() method in L32X64MixRandom
255 return ((long)nextInt() << 32) ^ (long)nextInt(); in nextLong()
/libcore/ojluni/src/test/java/lang/String/
DChars.java42 int n = 100 + r.nextInt(100); in testCharsAndCodePoints()
48 cc[j] = (char)(ccExp[j] = cpExp[j] = r.nextInt(0x80)); in testCharsAndCodePoints()
55 cc[j] = (char)(ccExp[j] = cpExp[j] = r.nextInt(0x8000)); in testCharsAndCodePoints()
64 int cp = 0x10000 + r.nextInt(2000); in testCharsAndCodePoints()
71 cc[j] = (char)(ccExp[j] = cpExp[k++] = r.nextInt(0x8000)); in testCharsAndCodePoints()
/libcore/ojluni/src/test/java/text/Collator/
DMonkeyTest.java81 int s = checkValue(r.nextInt() % source.length()); in TestCollationKey()
82 int t = checkValue(r.nextInt() % source.length()); in TestCollationKey()
83 int slen = checkValue((r.nextInt() - source.length()) % source.length()); in TestCollationKey()
84 int tlen = checkValue((r.nextInt() - source.length()) % source.length()); in TestCollationKey()
124 int s = checkValue(r.nextInt() % source.length()); in TestCompare()
125 int t = checkValue(r.nextInt() % source.length()); in TestCompare()
126 int slen = checkValue((r.nextInt() - source.length()) % source.length()); in TestCompare()
127 int tlen = checkValue((r.nextInt() - source.length()) % source.length()); in TestCompare()
/libcore/ojluni/src/test/java/io/ByteArrayInputStream/
DReadAllReadNTransferTo.java51 int position = random.nextInt(SIZE/2); in testRead()
52 int size = random.nextInt(SIZE - position); in testRead()
56 int off = size < 2 ? 0 : random.nextInt(size / 2); in testRead()
57 int len = size - off < 1 ? 0 : random.nextInt(size - off); in testRead()
/libcore/ojluni/src/test/java/util/Properties/
DConcurrentLoadAndStoreXML.java79 final int NTASKS = 4 + RAND.nextInt(4); in main()
85 for (int j=0; j<RAND.nextInt(100); j++) { in main()
86 String key = "k" + RAND.nextInt(1000); in main()
87 String value = "v" + RAND.nextInt(1000); in main()
DXMLSaveLoadBasher.java73 int keyLen = generator.nextInt(MAX_KEY_SIZE - MIN_KEY_SIZE + 1) + in testSaveLoad()
75 int valLen = generator.nextInt( in testSaveLoad()
82 char test = (char)(generator.nextInt(6527) + 32); in testSaveLoad()
88 char test = (char)(generator.nextInt(6527) + 32); in testSaveLoad()
/libcore/ojluni/src/test/java/util/Scanner/
DScanTest.java158 if (sc.nextInt() != 9) in useCase2()
162 if (sc.nextInt() != 6) in useCase2()
166 if (sc.nextInt() != 2) in useCase2()
170 if (sc.nextInt() != 5) in useCase2()
282 int i = sc.nextInt(); in nonASCIITest()
421 len = generator.nextInt(3) + 1; in read()
435 if (sc.nextInt() != 2) failCount++; in hasNextLineTest()
439 if (sc.nextInt() != 3) failCount++; in hasNextLineTest()
443 if (sc.nextInt() != 4) failCount++; in hasNextLineTest()
445 if (sc.nextInt() != 4) failCount++; in hasNextLineTest()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DThreadLocalRandomTest.java107 int val = new java.util.Random().nextInt(4); in testNext()
130 int f = ThreadLocalRandom.current().nextInt();
132 while (i < NCALLS && ThreadLocalRandom.current().nextInt() == f)
199 rnd.nextInt(bound);
217 rnd.nextInt(badBounds[0], badBounds[1]);
230 int f = ThreadLocalRandom.current().nextInt(bound);
235 (j = ThreadLocalRandom.current().nextInt(bound)) == f) {
250 int f = ThreadLocalRandom.current().nextInt(least, bound);
255 (j = ThreadLocalRandom.current().nextInt(least, bound)) == f) {
DSplittableRandomTest.java94 int f = sr.nextInt(); in testNextInt()
96 while (i < NCALLS && sr.nextInt() == f) in testNextInt()
175 () -> sr.nextInt(-17),
176 () -> sr.nextInt(0),
177 () -> sr.nextInt(Integer.MIN_VALUE));
187 () -> sr.nextInt(17, 2),
188 () -> sr.nextInt(-42, -42),
189 () -> sr.nextInt(Integer.MAX_VALUE, Integer.MIN_VALUE));
198 for (int i = 0; i < 2; i++) assertEquals(0, sr.nextInt(1));
201 int f = sr.nextInt(bound);
[all …]
/libcore/ojluni/src/test/java/io/FileInputStream/
DReadXBytes.java82 int size = 1 + RND.nextInt(MAX_FILE_SIZE); in main()
91 int pos = RND.nextInt(size); in main()
92 int len = RND.nextInt(size - pos); in main()
105 int pos = RND.nextInt(size); in main()
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadLocalRandomTest.java63 int f = ThreadLocalRandom.current().nextInt(); in testNextInt()
65 while (i < NCALLS && ThreadLocalRandom.current().nextInt() == f) in testNextInt()
132 rnd.nextInt(bound);
150 rnd.nextInt(badBounds[0], badBounds[1]);
163 int f = ThreadLocalRandom.current().nextInt(bound);
168 (j = ThreadLocalRandom.current().nextInt(bound)) == f) {
183 int f = ThreadLocalRandom.current().nextInt(least, bound);
188 (j = ThreadLocalRandom.current().nextInt(least, bound)) == f) {
/libcore/ojluni/src/main/java/java/util/concurrent/
DThreadLocalRandom.java235 return nextInt() >>> (32 - bits); in next()
418 public int nextInt() { in nextInt() method in ThreadLocalRandom.ThreadLocalRandomProxy
419 return ThreadLocalRandom.current().nextInt(); in nextInt()
439 public int nextInt() { in nextInt() method in ThreadLocalRandom
448 public int nextInt(int bound) { in nextInt() method in ThreadLocalRandom
449 return super.nextInt(bound); in nextInt()
457 public int nextInt(int origin, int bound) { in nextInt() method in ThreadLocalRandom
458 return super.nextInt(origin, bound); in nextInt()
/libcore/ojluni/src/test/java/io/ByteArrayOutputStream/
DWrite.java98 final int size = 17 + rnd.nextInt(128); in writeTest()
103 int off1 = rnd.nextInt(size / 4) + 1; in writeTest()
104 int len1 = Math.min(rnd.nextInt(size / 4) + 1, size - off1); in writeTest()
105 int off2 = rnd.nextInt(size / 2) + 1; in writeTest()
106 int len2 = Math.min(rnd.nextInt(size / 2) + 1, size - off2); in writeTest()
/libcore/ojluni/src/test/java/nio/Buffer/
DChars.java49 static final int SIZE = 128 + RAND.nextInt(1024);
56 int start = RAND.nextInt(mid + 1); // from 0 to mid in randomizeRange()
57 int end = mid + RAND.nextInt(cb.capacity() - mid + 1); // from mid to capacity in randomizeRange()
68 cb.put((char)RAND.nextInt()); in randomize()

1234567