Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
Merge pull request #258 from lgto4/patch-3
Browse files Browse the repository at this point in the history
Update to test for random(x) - see Issue #256
  • Loading branch information
Pomax committed Aug 1, 2016
2 parents 73fb78f + 39b04c0 commit d97b70b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/unit/random.pde
Expand Up @@ -74,3 +74,16 @@ for (int i=0; i<100000; i++) {
}
// at this point `failed` reflects whether or not the previous run failed even once.
_checkFalse(failed);

double r,
b = 5e-324;
boolean failed = false;
for (int i=0; i<100; i++) {
r = random(b);
if (r >= b || r < 0) {
failed = true;
break;
}
}
// at this point `failed` reflects whether or not the previous run failed even once.
_checkFalse(failed);

0 comments on commit d97b70b

Please sign in to comment.