ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/SplittableRandomTest.java
(Generate patch)

Comparing jsr166/src/test/tck/SplittableRandomTest.java (file contents):
Revision 1.22 by jsr166, Tue Oct 3 22:27:04 2017 UTC vs.
Revision 1.23 by jsr166, Fri Oct 13 02:34:59 2017 UTC

# Line 562 | Line 562 | public class SplittableRandomTest extend
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++) {
# Line 577 | Line 577 | public class SplittableRandomTest extend
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines