test/sun/nio/cs/TestStringCodingUTF8.java
Print this page
@@ -20,11 +20,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
- @bug 7040220
+ @bug 7040220 8054307
@summary Test if StringCoding and NIO result have the same de/encoding result for UTF-8
* @run main/othervm/timeout=2000 TestStringCodingUTF8
* @key randomness
*/
@@ -48,10 +48,22 @@
for (int i = 0; i < 0x10000; i++) {
bmp[i] = (char)i;
}
test(cs, bmp, 0, bmp.length);
+ char[] ascii = new char[0x80];
+ for (int i = 0; i < 0x80; i++) {
+ ascii[i] = (char)i;
+ }
+ test(cs, ascii, 0, ascii.length);
+
+ char[] latin1 = new char[0x100];
+ for (int i = 0; i < 0x100; i++) {
+ latin1[i] = (char)i;
+ }
+ test(cs, latin1, 0, latin1.length);
+
ArrayList<Integer> list = new ArrayList<>(0x20000);
for (int i = 0; i < 0x20000; i++) {
list.add(i, i);
}
Collections.shuffle(list);