Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 47 for nextInt (0.14 sec)

  1. guava-tests/test/com/google/common/hash/HashTestUtils.java

            int len = random.nextInt(value.length - off + 1);
            for (PrimitiveSink sink : sinks) {
              sink.putBytes(value, off, len);
            }
          }
        },
        PUT_BYTE_BUFFER() {
          @Override
          void performAction(Random random, Iterable<? extends PrimitiveSink> sinks) {
            byte[] value = new byte[random.nextInt(128)];
            random.nextBytes(value);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

            double num = RANDOM.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add((double) counter.getAndIncrement());
            }
            builder.addAll(iterable(list));
          }
        },
        ADD_STREAM {
          @Override
          void doIt(ImmutableDoubleArray.Builder builder, AtomicInteger counter) {
            double[] array = new double[RANDOM.nextInt(10)];
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        for (int i = 0; i < heapSize; i++) {
          mmHeap.add(random.nextInt());
        }
        for (int i = 0; i < numberOfModifications; i++) {
          mmHeap.removeAt(random.nextInt(mmHeap.size()));
          assertIntactUsingSeed(seed, mmHeap);
          mmHeap.add(random.nextInt());
          assertIntactUsingSeed(seed, mmHeap);
        }
      }
    
      public void testRemoveAt_exhaustive() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java

        assertEquals(-1L, map.get(key));
      }
    
      public void testAddAndGet() {
        AtomicLongMap<String> map = AtomicLongMap.create();
        String key = "key";
        long addend = random.nextInt(MAX_ADDEND);
        for (int i = 0; i < ITERATIONS; i++) {
          long before = map.get(key);
          long result = map.addAndGet(key, addend);
          long after = map.get(key);
          assertEquals(before + addend, after);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 13 14:28:25 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java

            int num = RANDOM.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add(counter.getAndIncrement());
            }
            builder.addAll(iterable(list));
          }
        },
        ADD_STREAM {
          @Override
          void doIt(ImmutableIntArray.Builder builder, AtomicInteger counter) {
            int[] array = new int[RANDOM.nextInt(10)];
            for (int i = 0; i < array.length; i++) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

            double num = RANDOM.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add((double) counter.getAndIncrement());
            }
            builder.addAll(iterable(list));
          }
        },
        ADD_STREAM {
          @Override
          void doIt(ImmutableDoubleArray.Builder builder, AtomicInteger counter) {
            double[] array = new double[RANDOM.nextInt(10)];
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        for (int i = 0; i < heapSize; i++) {
          mmHeap.add(random.nextInt());
        }
        for (int i = 0; i < numberOfModifications; i++) {
          mmHeap.removeAt(random.nextInt(mmHeap.size()));
          assertIntactUsingSeed(seed, mmHeap);
          mmHeap.add(random.nextInt());
          assertIntactUsingSeed(seed, mmHeap);
        }
      }
    
      public void testRemoveAt_exhaustive() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35.9K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java

          for (int trials = 10; trials-- > 0; ) {
            byte[] left = new byte[1 + rnd.nextInt(32)];
            rnd.nextBytes(left);
            byte[] right = left.clone();
            assertThat(comparator.compare(left, right)).isEqualTo(0);
            int i = rnd.nextInt(left.length);
            left[i] ^= (byte) (1 + rnd.nextInt(255));
            assertThat(comparator.compare(left, right)).isNotEqualTo(0);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/hash/BloomFilterTest.java

          new ThreadLocal<Random>() {
            @Override
            protected Random initialValue() {
              return new Random();
            }
          };
    
      private static final int GOLDEN_PRESENT_KEY = random.get().nextInt();
    
      @AndroidIncompatible // OutOfMemoryError
      public void testLargeBloomFilterDoesntOverflow() {
        long numBits = Integer.MAX_VALUE;
        numBits++;
    
        LockFreeBitArray bitArray = new LockFreeBitArray(numBits);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/primitives/UnsignedIntsTest.java

      public void testDivideRemainderEuclideanProperty() {
        // Use a seed so that the test is deterministic:
        Random r = new Random(0L);
        for (int i = 0; i < 1000000; i++) {
          int dividend = r.nextInt();
          int divisor = r.nextInt();
          // Test that the Euclidean property is preserved:
          assertThat(
                  dividend
                      - (divisor * UnsignedInts.divide(dividend, divisor)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 02:56:12 UTC 2024
    - 12.5K bytes
    - Viewed (0)
Back to top