]> granicus.if.org Git - icu/commitdiff
ICU-20589 Fix EraRulesTest#testAPIs failure on 1 May 2019
authorVictor Chang <vichang@google.com>
Fri, 3 May 2019 12:27:26 +0000 (13:27 +0100)
committerYoshito Umaoka <yumaoka@users.noreply.github.com>
Fri, 30 Aug 2019 21:21:25 +0000 (17:21 -0400)
icu4c/source/test/intltest/erarulestest.cpp
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/EraRulesTest.java

index b550361b271f465a4f55149a763799cc3aa764fd..115e7eacbd10ca4e92099ca4ed598d009f90a6c1 100644 (file)
@@ -8,6 +8,7 @@
 #include "unicode/calendar.h"
 #include "unicode/localpointer.h"
 #include "unicode/unistr.h"
+#include "unicode/timezone.h"
 #include "erarules.h"
 #include "erarulestest.h"
 
@@ -73,7 +74,7 @@ void EraRulesTest::testAPIs() {
                     + calId);
         }
 
-        LocalPointer<Calendar> cal(Calendar::createInstance("en", status));
+        LocalPointer<Calendar> cal(Calendar::createInstance(*TimeZone::getGMT(), "en", status));
         if (U_FAILURE(status)) {
             errln("Failed to create a Calendar instance.");
             continue;
index c2cf6e11debf2db6c42297c99d9b3c6d0b063baf..94b996f09baabb546b0aa4e6712b15143dec3319 100644 (file)
@@ -12,6 +12,7 @@ import com.ibm.icu.impl.EraRules;
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.JapaneseCalendar;
 import com.ibm.icu.util.ULocale;
+import com.ibm.icu.util.TimeZone;
 
 /**
  * Tests for EraRules class
@@ -44,7 +45,7 @@ public class EraRulesTest extends TestFmwk {
                         + calId);
             }
 
-            Calendar cal = Calendar.getInstance(new ULocale("en"));
+            Calendar cal = Calendar.getInstance(TimeZone.GMT_ZONE, new ULocale("en"));
             int currentIdx = rules1.getCurrentEraIndex();
             int currentYear = cal.get(Calendar.YEAR);
             int idx = rules1.getEraIndex(currentYear, cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DATE));