]> granicus.if.org Git - icu/commitdiff
ICU-10720 Fixed a couple of defective test code.
authorYoshito Umaoka <y.umaoka@gmail.com>
Tue, 4 Mar 2014 16:52:33 +0000 (16:52 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Tue, 4 Mar 2014 16:52:33 +0000 (16:52 +0000)
X-SVN-Rev: 35323

icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterTest.java

index 4fbc0fa3c69f4771301d008c9d5384eddc97e5f5..c059d79e085ebffc55214676a579b27ff3310502 100644 (file)
@@ -1115,9 +1115,7 @@ public class DateTimeGeneratorTest extends TestFmwk {
                   "{Hour:N}{Month:N}{Fractional_Second:N} {Month:N}{Day_Of_Year:N}{Year:N}",
                   "{Hour:N}{Month:N}{Fractional_Second:N} {Month:N}{Day_Of_Year:N}{Year:N}"};
           for(int i=0; i<cases.length; i++){
-              try{
-                  if(!dt.getFields(cases[i]).equals(results[i]));
-              } catch(Exception e){
+              if(!dt.getFields(cases[i]).equals(results[i])) {
                   errln("DateTimePatternGenerator.getFields(String) did not " +
                           "not return an expected result when passing " + cases[i] +
                           ". Got " + dt.getFields(cases[i]) + " but expected " +
index fdcaaf597b4a29b1b171e34c342ef4b1215e1fa2..21b155d97a9f3e0bdccc31565a20b3409fce93a6 100644 (file)
@@ -1,6 +1,6 @@
 /**
 *******************************************************************************
-* Copyright (C) 1996-2013, International Business Machines Corporation and
+* Copyright (C) 1996-2014, International Business Machines Corporation and
 * others. All Rights Reserved.
 *******************************************************************************
 */
@@ -3324,7 +3324,7 @@ public final class UCharacterTest extends TestFmwk
                 UCharacter.codePointCount(reg_text, invalid_startCases[i], 1);
                 errln("UCharacter.codePointCount was suppose to return an exception " +
                         "but got " + UCharacter.codePointCount(reg_text, invalid_startCases[i], 1) +
-                        ". The following passed parameters were Text: " + reg_text.toString() + ", Start: " + 
+                        ". The following passed parameters were Text: " + String.valueOf(reg_text) + ", Start: " + 
                         invalid_startCases[i] + ", Limit: " + 1 + ".");
             } catch(Exception e){
             }