562 |
|
*/ |
563 |
|
public void testNextBytes() { |
564 |
|
SplittableRandom sr = new SplittableRandom(); |
565 |
< |
int n = sr.nextInt(20); |
565 |
> |
int n = sr.nextInt(1, 20); |
566 |
|
byte[] bytes = new byte[n]; |
567 |
|
outer: |
568 |
|
for (int i = 0; i < n; i++) { |
577 |
|
} |
578 |
|
} |
579 |
|
|
580 |
+ |
/** |
581 |
+ |
* Filling an empty array with random bytes succeeds without effect. |
582 |
+ |
*/ |
583 |
+ |
public void testNextBytes_emptyArray() { |
584 |
+ |
new SplittableRandom().nextBytes(new byte[0]); |
585 |
+ |
} |
586 |
+ |
|
587 |
+ |
public void testNextBytes_nullArray() { |
588 |
+ |
try { |
589 |
+ |
new SplittableRandom().nextBytes(null); |
590 |
+ |
shouldThrow(); |
591 |
+ |
} catch (NullPointerException success) {} |
592 |
+ |
} |
593 |
+ |
|
594 |
|
} |