commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1152366 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java
Date Fri, 29 Jul 2011 20:28:13 GMT
Author: psteitz
Date: Fri Jul 29 20:28:12 2011
New Revision: 1152366

URL: http://svn.apache.org/viewvc?rev=1152366&view=rev
Log:
Moved PRNG seeding so it actually determines fixed seed for the test.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java?rev=1152366&r1=1152365&r2=1152366&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/ContinuousDistributionAbstractTest.java
Fri Jul 29 20:28:12 2011
@@ -262,11 +262,11 @@ public abstract class ContinuousDistribu
     public void testSampling() throws Exception {
         AbstractContinuousDistribution dist = (AbstractContinuousDistribution) makeDistribution();
         final int sampleSize = 1000;
+        dist.reseedRandomGenerator(1000);  // Use fixed seed
         double[] sample = dist.sample(sampleSize);
         double[] quartiles = TestUtils.getDistributionQuartiles(dist);
         double[] expected = {250, 250, 250, 250};
         long[] counts = new long[4];
-        dist.reseedRandomGenerator(1000);  // Use fixed seed
         for (int i = 0; i < sampleSize; i++) {
             TestUtils.updateCounts(sample[i], counts, quartiles);
         }



Mime
View raw message