Skip to content

Commit

Permalink
Actually uses seed in RandomRule, and a way to reset
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Feb 1, 2015
1 parent d60655a commit 9bbd22f
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -54,7 +54,7 @@ public Statement apply( final Statement base, Description description )
public void evaluate() throws Throwable
{
seed = specificSeed == null ? currentTimeMillis() : specificSeed;
random = new Random();
reset();
try
{
base.evaluate();
Expand All @@ -67,6 +67,11 @@ public void evaluate() throws Throwable
};
}

public void reset()
{
random = new Random( seed );
}

public void nextBytes( byte[] bytes )
{
random.nextBytes( bytes );
Expand Down

0 comments on commit 9bbd22f

Please sign in to comment.