]> granicus.if.org Git - icu/commitdiff
ICU-13390 Fixed TestTimeZoneRoundTrip test code issue with Chakma digits.
authorYoshito Umaoka <y.umaoka@gmail.com>
Wed, 4 Oct 2017 15:34:10 +0000 (15:34 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Wed, 4 Oct 2017 15:34:10 +0000 (15:34 +0000)
X-SVN-Rev: 40545

icu4c/source/test/intltest/tzfmttst.cpp

index 4613d5e1a92cc2ca34a4048177293b8564edffcf..1b1cd7e8f0558e4923ab2b51991d862384220f95 100644 (file)
@@ -141,7 +141,8 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip(void) {
         Locale("en_CA"),
         Locale("fr"),
         Locale("zh_Hant"),
-        Locale("fa")
+        Locale("fa"),
+        Locale("ccp")
     };
 
     const Locale *LOCALES;
@@ -170,11 +171,6 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip(void) {
         gmtFmt.format(0.0, localGMTString);
 
         for (int32_t patidx = 0; patidx < UPRV_LENGTHOF(PATTERNS); patidx++) {
-
-            if (uprv_strcmp(LOCALES[locidx].getLanguage(),"ccp")==0 && (PATTERNS[patidx][0]==0x7A || PATTERNS[patidx][0]==0x76) && 
-                    logKnownIssue("13390", "Skip handling ccp until TimeZone offset roundtrip is fixed")) {
-                 continue;
-            }
             SimpleDateFormat *sdf = new SimpleDateFormat((UnicodeString)PATTERNS[patidx], LOCALES[locidx], status);
             if (U_FAILURE(status)) {
                 dataerrln((UnicodeString)"new SimpleDateFormat failed for pattern " +
@@ -305,10 +301,13 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip(void) {
                         if (!isOffsetFormat) {
                             // Check if localized GMT format is used as a fallback of name styles
                             int32_t numDigits = 0;
-                            for (int n = 0; n < tzstr.length(); n++) {
-                                if (u_isdigit(tzstr.charAt(n))) {
+                            int32_t idx = 0;
+                            while (idx < tzstr.length()) {
+                                UChar32 cp = tzstr.char32At(idx);
+                                if (u_isdigit(cp)) {
                                     numDigits++;
                                 }
+                                idx += U16_LENGTH(cp);
                             }
                             isOffsetFormat = (numDigits > 0);
                         }