--- old/test/java/lang/ToString.java 2014-06-14 22:28:19.586165598 +0400 +++ new/test/java/lang/ToString.java 2014-06-14 22:28:18.989875092 +0400 @@ -23,7 +23,7 @@ /* * @test - * @bug 4031762 + * @bug 4031762 8042990 * @summary Test the primitive wrappers static toString() */ @@ -100,5 +100,22 @@ throw new RuntimeException("Double wrapper toString() failure."); } + // unsigned hex int + for(int x=0; x<100; x++) { + int i = generator.nextInt(); + int w = 1 + generator.nextInt(9); + String s = String.format("%0" + w + "x", i); + if (!s.equals(Integer.toHexString(i, w))) + throw new RuntimeException("Integer wrapper toHexString() failed for " + i + "."); + } + + // unsigned hex long + for(int x=0; x<100; x++) { + long l = generator.nextLong(); + int w = 1 + generator.nextInt(19); + String s = String.format("%0" + w + "x", l); + if (!s.equals(Long.toHexString(l, w))) + throw new RuntimeException("Long wrapper toHexString() failed for " + l + "."); + } } }