]> granicus.if.org Git - icu/commitdiff
ICU-9284 Fix test case in date format round trip test for hebrew calendar
authorMichael Ow <mow@svn.icu-project.org>
Wed, 25 Apr 2012 16:21:28 +0000 (16:21 +0000)
committerMichael Ow <mow@svn.icu-project.org>
Wed, 25 Apr 2012 16:21:28 +0000 (16:21 +0000)
X-SVN-Rev: 31765

icu4c/source/test/intltest/dtfmtrtts.cpp

index a8fd9669de945d4f8a1c3683683dbcc0f433636a..b0ee96a6405331a42e39147f255825d649249f79 100644 (file)
@@ -1,6 +1,6 @@
 /***********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2010, International Business Machines Corporation
+ * Copyright (c) 1997-2012, International Business Machines Corporation
  * and others. All Rights Reserved.
  ***********************************************************************/
  
@@ -435,12 +435,19 @@ void DateFormatRoundTripTest::test(DateFormat *fmt, const Locale &origLocale, UB
                 }
             }
 
-            if(dmatch > maxDmatch || smatch > maxSmatch) { // Special case for Japanese and Islamic (could have large negative years)
+            /*
+             * Special case for Japanese and Buddhist (could have large negative years)
+             * Also, Hebrew calendar need help handling leap month.
+             */
+            if(dmatch > maxDmatch || smatch > maxSmatch) {
               const char *type = fmt->getCalendar()->getType();
               if(!strcmp(type,"japanese") || (!strcmp(type,"buddhist"))) {
                 maxSmatch = 4;
                 maxDmatch = 4;
-              }
+              } else if(!strcmp(type,"hebrew")) {
+                  maxSmatch = 3;
+                  maxDmatch = 3;
+                }
             }
 
             // Use @v to see verbose results on successful cases