< prev index next >

test/sun/nio/cs/FindDecoderBugs.java

Print this page

        

*** 22,41 **** */ /* * @test * @bug 6380723 ! * @summary Decode many byte sequences in many ways * @run main/timeout=1800 FindDecoderBugs * @author Martin Buchholz ! * @key randomness */ import java.util.*; import java.util.regex.*; import java.nio.*; import java.nio.charset.*; public class FindDecoderBugs { static boolean isBroken(String csn) { if (csn.equals("x-COMPOUND_TEXT")) return true; --- 22,44 ---- */ /* * @test * @bug 6380723 ! * @summary Decode many byte sequences in many ways (use -Dseed=X to set PRNG seed) ! * @library /lib/testlibrary ! * @build jdk.testlibrary.* * @run main/timeout=1800 FindDecoderBugs * @author Martin Buchholz ! * @key intermittent randomness */ import java.util.*; import java.util.regex.*; import java.nio.*; import java.nio.charset.*; + import jdk.testlibrary.RandomFactory; public class FindDecoderBugs { static boolean isBroken(String csn) { if (csn.equals("x-COMPOUND_TEXT")) return true;
*** 320,330 **** testRandomly(prefix, 3); testRandomly(prefix, 4); } } ! private final static Random rnd = new Random(); private static byte randomByte() { return (byte) rnd.nextInt(0x100); } private static byte[] randomBytes(int len) { byte[] a = new byte[len]; --- 323,333 ---- testRandomly(prefix, 3); testRandomly(prefix, 4); } } ! private final static Random rnd = RandomFactory.getRandom(); private static byte randomByte() { return (byte) rnd.nextInt(0x100); } private static byte[] randomBytes(int len) { byte[] a = new byte[len];
< prev index next >