jdk/test/java/text/Bidi/Bug6850113.java
author amlu
Fri, 18 Nov 2016 14:39:03 +0800
changeset 42166 5582c83b1156
parent 30820 0d4717a011d3
permissions -rw-r--r--
8169836: ProblemList update for java/lang/management/MemoryMXBean/PendingAllGC.sh Reviewed-by: mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2956
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 12180
diff changeset
     2
 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
2956
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     4
 *
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     7
 * published by the Free Software Foundation.
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     8
 *
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    13
 * accompanied this code).
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    14
 *
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3097
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3097
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3097
diff changeset
    21
 * questions.
2956
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    22
 */
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    23
/*
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    24
 * @test
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    25
 * @bug 6850113
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    26
 * @summary Verify the return value of digit() for some digits.
30820
0d4717a011d3 8081347: Add @modules to jdk_core tests
mchung
parents: 14342
diff changeset
    27
 * @modules java.base/sun.text.normalizer
3097
5c07a20f8360 6853792: test/java/text/Bidi/Bug6850113.java compilation error
peytoia
parents: 2956
diff changeset
    28
 * @compile -XDignore.symbol.file=true Bug6850113.java
12180
90b9045428bd 7152866: Tests not run because they are missing the @run tag
alanb
parents: 5506
diff changeset
    29
 * @run main Bug6850113
2956
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    30
 */
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    31
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    32
import sun.text.normalizer.UCharacter;
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    33
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    34
public class Bug6850113 {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    35
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    36
    public static void main(String[] args) {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    37
        boolean err = false;
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    38
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    39
        // Fullwidth Latin capital letters
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    40
        for (int i = 0xff21, j = 10; i <= 0xff3a; i++, j++) {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    41
            if (UCharacter.digit(i, 36) != j) {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    42
                err = true;
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    43
                System.out.println("Error: UCharacter.digit(0x" +
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    44
                    Integer.toHexString(i) + ", 36) returned " +
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    45
                    UCharacter.digit(i, 36) + ", expected=" + j);
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    46
            }
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    47
        }
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    48
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    49
        // Fullwidth Latin small letters
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    50
        for (int i = 0xff41, j = 10; i <= 0xff5a; i++, j++) {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    51
            if (UCharacter.digit(i, 36) != j) {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    52
                err = true;
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    53
                System.out.println("Error: UCharacter.digit(0x" +
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    54
                    Integer.toHexString(i) + ", 36) returned " +
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    55
                    UCharacter.digit(i, 36) + ", expected=" + j);
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    56
            }
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    57
        }
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    58
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    59
        if (err) {
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    60
            throw new RuntimeException("UCharacter.digit():  Wrong return value");
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    61
        }
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    62
   }
931f209e57a9 6850113: Bidi class needs to be updated to support Unicode 5.1
peytoia
parents:
diff changeset
    63
}