Package org.waveprotocol.wave.model.testing.RandomDocOpGenerator

Examples of org.waveprotocol.wave.model.testing.RandomDocOpGenerator.RandomProvider.nextBoolean()


  public void testNextBooleanDistribution() {
    for (int seed : NUMBERS) {
      RandomProvider rp = RandomProviderImpl.ofSeed(seed);
      int trueCount = 0;
      for (int i = 0; i < ITERATIONS; i++) {
        if (rp.nextBoolean()) {
          trueCount++;
        }
      }
      assertTrue("seed " + seed + ", trueCount " + trueCount,
          trueCount >= (1.0 - MAX_DEVIATION) * 0.5 * ITERATIONS);
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.