jdk/test/java/text/Bidi/BidiEmbeddingTest.java
changeset 2956 931f209e57a9
parent 1834 6eefd0d6804d
child 5506 202f599c92aa
equal deleted inserted replaced
2818:c59bda501419 2956:931f209e57a9
    21  * have any questions.
    21  * have any questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 4396492 4396496 4778510
    26  * @bug 4396492 4396496 4778510 6850113
    27  * @summary verify that the embedding values processed by the bidi code use negative values to
    27  * @summary verify that the embedding values processed by the bidi code use negative values to
    28  * indicate overrides, rather than using bit 7.  Also tests Bidi without loading awt classes to
    28  * indicate overrides, rather than using bit 7.  Also tests Bidi without loading awt classes to
    29  * confirm that Bidi can be used without awt. Verify that embedding level 0 is properly mapped
    29  * confirm that Bidi can be used without awt. Verify that embedding level 0 is properly mapped
    30  * to the base embedding level.
    30  * to the base embedding level.
    31  */
    31  */
    87                                " from " + bidi2.getRunStart(i) +
    87                                " from " + bidi2.getRunStart(i) +
    88                                " to " + bidi2.getRunLimit(i) +
    88                                " to " + bidi2.getRunLimit(i) +
    89                                " at level " + bidi2.getRunLevel(i));
    89                                " at level " + bidi2.getRunLevel(i));
    90         }
    90         }
    91 
    91 
    92         System.out.println(bidi2);
    92         System.out.println(bidi2 + "\n");
    93 
    93 
    94         if (bidi.getRunCount() != 3 || bidi2.getRunCount() != 3) {
    94         if (bidi.getRunCount() != 3 || bidi2.getRunCount() != 3) {
    95             throw new Error("Bidi run count incorrect");
    95             throw new Error("Bidi run count incorrect");
       
    96         } else {
       
    97             System.out.println("test1() passed.\n");
    96         }
    98         }
    97     }
    99     }
    98 
   100 
    99     // make sure BIDI_EMBEDDING values of 0 are mapped to base run direction, instead of flagging an error.
   101     // make sure BIDI_EMBEDDING values of 0 are mapped to base run direction, instead of flagging an error.
   100     static void test2() {
   102     static void test2() {
   121                                " from " + bidi.getRunStart(i) +
   123                                " from " + bidi.getRunStart(i) +
   122                                " to " + bidi.getRunLimit(i) +
   124                                " to " + bidi.getRunLimit(i) +
   123                                " at level " + bidi.getRunLevel(i));
   125                                " at level " + bidi.getRunLevel(i));
   124         }
   126         }
   125 
   127 
   126         System.out.println(bidi);
   128         System.out.println(bidi + "\n");
   127 
   129 
   128         if (bidi.getRunCount() != 6) { // runs of spaces and angles at embedding bound,s and final period, each get level 1
   130         if (bidi.getRunCount() != 6) { // runs of spaces and angles at embedding bound,s and final period, each get level 1
   129             throw new Error("Bidi embedding processing failed");
   131             throw new Error("Bidi embedding processing failed");
       
   132         } else {
       
   133             System.out.println("test2() passed.\n");
   130         }
   134         }
   131     }
   135     }
   132 }
   136 }