From: Victor Chang Date: Fri, 3 May 2019 12:27:26 +0000 (+0100) Subject: ICU-20589 Fix EraRulesTest#testAPIs failure on 1 May 2019 X-Git-Tag: release-65-rc~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ff43608d28eaac2e81ae11b5bf1c666bd059cbe;p=icu ICU-20589 Fix EraRulesTest#testAPIs failure on 1 May 2019 --- diff --git a/icu4c/source/test/intltest/erarulestest.cpp b/icu4c/source/test/intltest/erarulestest.cpp index b550361b271..115e7eacbd1 100644 --- a/icu4c/source/test/intltest/erarulestest.cpp +++ b/icu4c/source/test/intltest/erarulestest.cpp @@ -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 cal(Calendar::createInstance("en", status)); + LocalPointer cal(Calendar::createInstance(*TimeZone::getGMT(), "en", status)); if (U_FAILURE(status)) { errln("Failed to create a Calendar instance."); continue; diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/EraRulesTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/EraRulesTest.java index c2cf6e11deb..94b996f09ba 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/EraRulesTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/EraRulesTest.java @@ -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));