/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | SortedMapTestBase.java | 46 Random rnd; field in SortedMapTestBase 49 rnd = new Random(-1); in setUp() 51 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() 103 if (rnd.nextBoolean()) { in testKeySet() 113 int key = rnd.nextInt(N); in testPut() 114 int value = rnd.nextInt(N); in testPut() 125 int key = rnd.nextInt(N); in testPut0() [all …]
|
/libcore/ojluni/src/test/java/util/Arrays/ |
D | ArrayObjectMethods.java | 203 private static Random rnd = new Random(); field in Rnd 206 switch(rnd.nextInt(10)) { in nextLong() 211 return (long) (rnd.nextInt(20) - 10); in nextLong() 212 default: return rnd.nextLong(); in nextLong() 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() [all …]
|
D | Correct.java | 45 static final Random rnd = new Random(); field in Correct 52 int size = rnd.nextInt(TEST_SIZE) + 1; in testDefaultSort() 65 int size = rnd.nextInt(TEST_SIZE) + 1; in testComparatorSort() 77 blah[x] = new Integer(rnd.nextInt()); in getIntegerArray()
|
/libcore/ojluni/src/test/java/math/BigInteger/ |
D | ModPow.java | 46 Random rnd = new Random(1234); in testModPow() local 51 BigInteger m = new BigInteger(800, rnd).max(BigInteger.ONE); in testModPow() 52 BigInteger base = new BigInteger(16, rnd); in testModPow() 53 if (rnd.nextInt() % 2 == 0) in testModPow() 55 BigInteger exp = new BigInteger(8, rnd); in testModPow()
|
/libcore/ojluni/src/test/java/lang/Integer/ |
D | BitTwiddle.java | 45 Random rnd = RandomFactory.getRandom(); in main() local 62 int x = rnd.nextInt(); in main() 77 int x = rnd.nextInt(); in main() 99 int x = rnd.nextInt(); in main() 123 int x = rnd.nextInt(); in main() 129 int x = rnd.nextInt(); in main() 130 int dist = rnd.nextInt(); in main() 150 int x = rnd.nextInt(); in main() 160 int x = rnd.nextInt(); in main()
|
/libcore/ojluni/src/test/java/lang/Long/ |
D | BitTwiddle.java | 45 Random rnd = RandomFactory.getRandom(); in main() local 62 long x = rnd.nextLong(); in main() 77 long x = rnd.nextLong(); in main() 101 long x = rnd.nextLong(); in main() 125 long x = rnd.nextLong(); in main() 131 long x = rnd.nextLong(); in main() 132 int dist = rnd.nextInt(); in main() 152 long x = rnd.nextLong(); in main() 162 long x = rnd.nextLong(); in main()
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | ThreadLocalRandomTest.java | 104 ThreadLocalRandom rnd = ThreadLocalRandom.current(); in testNext() local 125 int q = (int) m.invoke(rnd, new Object[] { 2 }); in testNext() 132 int r = (int) m.invoke(rnd, new Object[] { 3 }); in testNext() 134 int q = (int) m.invoke(rnd, new Object[] { 3 }); in testNext() 219 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 222 rnd.nextInt(bound); 238 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 241 rnd.nextInt(badBounds[0], badBounds[1]); 295 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 298 rnd.nextLong(bound); [all …]
|
D | Collection8Test.java | 311 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 312 int n = rnd.nextInt(6); 315 List orig = rnd.nextBoolean() 320 Iterator it = rnd.nextBoolean() ? c.iterator() : null; 328 switch (rnd.nextInt(3)) { 356 switch (rnd.nextInt(4)) { 400 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 401 int n = rnd.nextInt(6); 412 for (int i = rnd.nextInt(n + 1); --i >= 0; ) { 414 if (rnd.nextBoolean()) assertTrue(it.hasNext()); [all …]
|
D | TreeSetTest.java | 742 Random rnd = new Random(666); field in TreeSetTest 790 int element = rnd.nextInt(limit); in populate() 801 remove(set, min - 5 + rnd.nextInt(rangeSize + 10)); in mutateSet() 806 if (rnd.nextBoolean()) { in mutateSet() 814 int element = min + rnd.nextInt(rangeSize); in mutateSet() 826 remove(set, min - 5 + rnd.nextInt(rangeSize + 10)); in mutateSubSet() 831 if (rnd.nextBoolean()) { in mutateSubSet() 839 int element = min - 5 + rnd.nextInt(rangeSize + 10); in mutateSubSet() 876 boolean incl = rnd.nextBoolean(); in bashSubSet() 879 if (rnd.nextBoolean()) in bashSubSet() [all …]
|
D | ConcurrentSkipListSetTest.java | 746 Random rnd = new Random(666); field in ConcurrentSkipListSetTest 793 int element = rnd.nextInt(limit); in populate() 804 remove(set, min - 5 + rnd.nextInt(rangeSize + 10), bs); in mutateSet() 809 if (rnd.nextBoolean()) { in mutateSet() 817 int element = min + rnd.nextInt(rangeSize); in mutateSet() 830 remove(set, min - 5 + rnd.nextInt(rangeSize + 10), bs); in mutateSubSet() 835 if (rnd.nextBoolean()) { in mutateSubSet() 843 int element = min - 5 + rnd.nextInt(rangeSize + 10); in mutateSubSet() 881 boolean incl = rnd.nextBoolean(); in bashSubSet() 884 if (rnd.nextBoolean()) in bashSubSet() [all …]
|
D | TreeMapTest.java | 864 Random rnd = new Random(666); 899 int key = rnd.nextInt(limit); 910 remove(map, min - 5 + rnd.nextInt(rangeSize + 10)); 915 if (rnd.nextBoolean()) { 923 int key = min + rnd.nextInt(rangeSize); 935 remove(map, min - 5 + rnd.nextInt(rangeSize + 10)); 940 if (rnd.nextBoolean()) { 948 int key = min - 5 + rnd.nextInt(rangeSize + 10); 985 boolean incl = rnd.nextBoolean(); 988 if (rnd.nextBoolean()) [all …]
|
D | ConcurrentSkipListMapTest.java | 1075 Random rnd = new Random(666); 1110 int key = rnd.nextInt(limit); 1121 remove(map, min - 5 + rnd.nextInt(rangeSize + 10)); 1126 if (rnd.nextBoolean()) { 1134 int key = min + rnd.nextInt(rangeSize); 1146 remove(map, min - 5 + rnd.nextInt(rangeSize + 10)); 1151 if (rnd.nextBoolean()) { 1159 int key = min - 5 + rnd.nextInt(rangeSize + 10); 1196 boolean incl = rnd.nextBoolean(); 1199 if (rnd.nextBoolean()) [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | ThreadLocalRandomTest.java | 129 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 132 rnd.nextInt(bound); 147 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 150 rnd.nextInt(badBounds[0], badBounds[1]); 201 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 204 rnd.nextLong(bound); 219 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 222 rnd.nextLong(badBounds[0], badBounds[1]); 272 ThreadLocalRandom rnd = ThreadLocalRandom.current(); 282 rnd.nextFloat(bound); [all …]
|
D | ConcurrentSkipListSetTest.java | 663 Random rnd = new Random(666); field in ConcurrentSkipListSetTest 707 int element = rnd.nextInt(limit); in populate() 718 remove(set, min - 5 + rnd.nextInt(rangeSize + 10), bs); in mutateSet() 723 if (rnd.nextBoolean()) { in mutateSet() 731 int element = min + rnd.nextInt(rangeSize); in mutateSet() 744 remove(set, min - 5 + rnd.nextInt(rangeSize + 10), bs); in mutateSubSet() 749 if (rnd.nextBoolean()) { in mutateSubSet() 757 int element = min - 5 + rnd.nextInt(rangeSize + 10); in mutateSubSet() 795 boolean incl = rnd.nextBoolean(); in bashSubSet() 798 if (rnd.nextBoolean()) in bashSubSet() [all …]
|
D | TreeSetTest.java | 666 Random rnd = new Random(666); field in TreeSetTest 711 int element = rnd.nextInt(limit); in populate() 722 remove(set, min - 5 + rnd.nextInt(rangeSize + 10)); in mutateSet() 727 if (rnd.nextBoolean()) { in mutateSet() 735 int element = min + rnd.nextInt(rangeSize); in mutateSet() 747 remove(set, min - 5 + rnd.nextInt(rangeSize + 10)); in mutateSubSet() 752 if (rnd.nextBoolean()) { in mutateSubSet() 760 int element = min - 5 + rnd.nextInt(rangeSize + 10); in mutateSubSet() 797 boolean incl = rnd.nextBoolean(); in bashSubSet() 800 if (rnd.nextBoolean()) in bashSubSet() [all …]
|
D | TreeMapTest.java | 784 Random rnd = new Random(666); 818 int key = rnd.nextInt(limit); 829 remove(map, min - 5 + rnd.nextInt(rangeSize + 10)); 834 if (rnd.nextBoolean()) { 842 int key = min + rnd.nextInt(rangeSize); 854 remove(map, min - 5 + rnd.nextInt(rangeSize + 10)); 859 if (rnd.nextBoolean()) { 867 int key = min - 5 + rnd.nextInt(rangeSize + 10); 904 boolean incl = rnd.nextBoolean(); 907 if (rnd.nextBoolean()) [all …]
|
/libcore/ojluni/src/test/java/util/BitSet/ |
D | ImportExport.java | 38 final Random rnd = new Random(); field in ImportExport 53 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() 114 longs[i] = rnd.nextLong(); in test() 118 b2.put(i, rnd.nextLong()); in test() 119 int beg = rnd.nextInt(10); in test()
|
/libcore/ojluni/src/test/java/io/ByteArrayOutputStream/ |
D | Write.java | 97 Random rnd = new Random(); in writeTest() local 98 final int size = 17 + rnd.nextInt(128); in writeTest() 101 rnd.nextBytes(b); 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/util/HashSet/ |
D | Serialization.java | 47 private static final Random rnd = ThreadLocalRandom.current(); field in Serialization 50 int capacity = rnd.nextInt(MAX_CAPACITY); in createHashSet() 51 float loadFactor = Float.MIN_VALUE + rnd.nextFloat()*MAX_LOAD_FACTOR; in createHashSet() 53 float multiplier = 2*rnd.nextFloat(); // range [0,2] in createHashSet() 56 hashSet.add(rnd.nextInt()); in createHashSet()
|
/libcore/ojluni/src/test/java/util/Base64/ |
D | TestBase64.java | 55 private static final Random rnd = RandomFactory.getRandom(); field in TestBase64 74 int len = rnd.nextInt(200) + 4; in main() 116 rnd.nextBytes(src); in main() 166 rnd.nextBytes(orig); in test() 207 int n = rnd.nextInt(len); in test() 244 int n = rnd.nextInt(len); in test() 269 buf = new byte[encoded.length + rnd.nextInt(100)]; in test() 278 buf = new byte[orig.length + rnd.nextInt(100)]; in test() 558 vals.addAll(List.of(rnd.nextInt(), rnd.nextInt(), rnd.nextInt(), in testEncoderKeepsSilence() 559 rnd.nextInt())); in testEncoderKeepsSilence() [all …]
|
/libcore/ojluni/src/test/java/lang/StringBuffer/ |
D | Capacity.java | 42 Random rnd = new Random(); in test() local 43 int[] sizes = { 0, 1, rnd.nextInt(10), rnd.nextInt(1000) }; in test()
|
/libcore/ojluni/src/test/java/util/Timer/ |
D | Purge.java | 37 Random rnd = new Random(); in main() local 47 if (i != 1 && rnd.nextBoolean()) { in main()
|
/libcore/ojluni/src/main/java/java/util/random/ |
D | RandomGenerator.java | 484 long rnd = nextLong(); in nextBytes() local 485 for (int n = 8; n--> 0; rnd >>>= Byte.SIZE) in nextBytes() 486 bytes[i++] = (byte)rnd; in nextBytes() 489 for (long rnd = nextLong(); i < len; rnd >>>= Byte.SIZE) in nextBytes() 490 bytes[i++] = (byte)rnd; in nextBytes()
|
/libcore/ojluni/src/test/java/lang/Boolean/ |
D | MakeBooleanComparable.java | 42 Random rnd = new Random(); in testComparable() local 46 boolean element = rnd.nextBoolean(); in testComparable()
|
/libcore/ojluni/src/test/java/lang/Math/ |
D | MultiplicationTests.java | 48 private static java.util.Random rnd = RandomFactory.getRandom(); field in MultiplicationTests 132 if (!chk.apply(rnd.nextLong(), rnd.nextLong())) { in test()
|