Home
last modified time | relevance | path

Searched refs:cal (Results 1 – 25 of 387) sorted by relevance

12345678910>>...16

/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/calendar/
DCompatibilityTest.java79 GregorianCalendar cal = new GregorianCalendar(gmt); in TestGregorianChangeover() local
104 cal.setTime(d); in TestGregorianChangeover()
105 int y = cal.get(Calendar.YEAR), mon = cal.get(Calendar.MONTH)+1-Calendar.JANUARY, in TestGregorianChangeover()
106 dom = cal.get(Calendar.DATE), dow = cal.get(Calendar.DAY_OF_WEEK); in TestGregorianChangeover()
124 GregorianCalendar cal = in TestMapping() local
134 cal.setGregorianChange(type==0 ? PURE_GREGORIAN : PURE_JULIAN); in TestMapping()
135 fmt.setCalendar(cal); in TestMapping()
158 cal.setTime(new Date(millis)); in TestMapping()
159 lim[sign] = fmt.format(cal.getTime()); in TestMapping()
175 GregorianCalendar cal = new GregorianCalendar(); in TestMapping() local
[all …]
DCalendarTestFmwk.java78 protected void doTestCases(TestCase[] cases, Calendar cal) in doTestCases() argument
80 cal.setTimeZone(UTC); in doTestCases()
83 …DateFormat format = DateFormat.getDateTimeInstance(cal, DateFormat.SHORT, -1, Locale.getDefault()); in doTestCases()
85 final String pattern = (cal instanceof ChineseCalendar) ? in doTestCases()
112 test.applyTime(cal); in doTestCases()
113 if (!test.fieldsEqual(cal, this)) { in doTestCases()
116 format.format(cal.getTime()) + in doTestCases()
125 cal.clear(); in doTestCases()
126 test.applyFields(cal); in doTestCases()
127 if (!test.equals(cal)) { in doTestCases()
[all …]
DChineseTest.java98 ChineseCalendar cal = new ChineseCalendar(); in TestMapping() local
108 cal.setTime(date); in TestMapping()
109 int y = cal.get(Calendar.EXTENDED_YEAR); in TestMapping()
110 int m = cal.get(Calendar.MONTH)+1; // 0-based -> 1-based in TestMapping()
111 int L = cal.get(Calendar.IS_LEAP_MONTH); in TestMapping()
112 int d = cal.get(Calendar.DAY_OF_MONTH); in TestMapping()
136 cal.clear(); in TestMapping()
137 cal.set(Calendar.EXTENDED_YEAR, cyear); in TestMapping()
138 cal.set(Calendar.MONTH, cmonth-1); in TestMapping()
139 cal.set(Calendar.IS_LEAP_MONTH, cisleapmonth); in TestMapping()
[all …]
DCalendarRegressionTest.java91 GregorianCalendar cal = new GregorianCalendar(zone); in Test4031502() local
92 cal.clear(); in Test4031502()
93 cal.set(1900, 15, 5, 5, 8, 13); in Test4031502()
94 if (cal.get(Calendar.HOUR) != 5) { in Test4031502()
97 cal.get(Calendar.DST_OFFSET) / (60*60*1000.0) + "; ZONE_OFFSET = " + in Test4031502()
98 cal.get(Calendar.ZONE_OFFSET) / (60*60*1000.0) + "; getRawOffset() = " + in Test4031502()
100 "; HOUR = " + cal.get(Calendar.HOUR)); in Test4031502()
101 cal.clear(); in Test4031502()
102 cal.set(1900, 15, 5, 5, 8, 13); in Test4031502()
103 if (cal.get(Calendar.HOUR) != 5) { in Test4031502()
[all …]
DDangiTest.java78 Calendar cal = Calendar.getInstance(new ULocale("ko_KR@calendar=dangi")); in TestMapping() local
88 cal.setTime(date); in TestMapping()
89 int y = cal.get(Calendar.EXTENDED_YEAR); in TestMapping()
90 int m = cal.get(Calendar.MONTH) + 1; // 0-based -> 1-based in TestMapping()
91 int L = cal.get(Calendar.IS_LEAP_MONTH); in TestMapping()
92 int d = cal.get(Calendar.DAY_OF_MONTH); in TestMapping()
115 cal.clear(); in TestMapping()
116 cal.set(Calendar.EXTENDED_YEAR, cyear); in TestMapping()
117 cal.set(Calendar.MONTH, cmonth - 1); in TestMapping()
118 cal.set(Calendar.IS_LEAP_MONTH, cisleapmonth); in TestMapping()
[all …]
DEthiopicTest.java245 EthiopicCalendar cal = new EthiopicCalendar(1, 0, 1); in TestEraStart() local
246 assertEquals("Ethiopic Date", "Wed Jan 01, 0001 AD", fmt.format(cal)); in TestEraStart()
248 cal.set(Calendar.ERA, 0); in TestEraStart()
249 cal.set(Calendar.YEAR, 5500); in TestEraStart()
250 assertEquals("Ethiopic Date", "Tue Jan 01, 5500 BC", fmt.format(cal)); in TestEraStart()
260 gc.setTime(cal.getTime()); in TestEraStart()
267 EthiopicCalendar cal = new EthiopicCalendar(); in TestBasic() local
268 cal.clear(); in TestBasic()
269 cal.set(1000, 0, 30); in TestBasic()
271 cal.get(YEAR) + "/" + in TestBasic()
[all …]
DIndianTest.java117 IndianCalendar cal = new IndianCalendar(); in TestBasic() local
118 cal.clear(); in TestBasic()
119 cal.set(1000, 0, 30); in TestBasic()
121 cal.get(YEAR) + "/" + in TestBasic()
122 cal.get(MONTH) + "/" + in TestBasic()
123 cal.get(DATE)); in TestBasic()
124 cal.clear(); in TestBasic()
125 cal.set(1, 0, 30); in TestBasic()
127 cal.get(YEAR) + "/" + in TestBasic()
128 cal.get(MONTH) + "/" + in TestBasic()
[all …]
DHebrewTest.java86 HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); in TestRoll() local
88 doRollAdd(ROLL, cal, tests); in TestRoll()
125 HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); in TestAdd() local
127 doRollAdd(ADD, cal, tests); in TestAdd()
267 HebrewCalendar cal = new HebrewCalendar(); in TestElulMonth() local
273 cal.clear(); in TestElulMonth()
275 cal.set(Calendar.YEAR, year); in TestElulMonth()
276 cal.set(Calendar.MONTH, ELUL); in TestElulMonth()
277 cal.set(Calendar.DAY_OF_MONTH, 1); in TestElulMonth()
279 int yact = cal.get(Calendar.YEAR); in TestElulMonth()
[all …]
DIBMCalendarTest.java120 Calendar cal = Calendar.getInstance(loc); in TestWeekend() local
123 cal.clear(); in TestWeekend()
124 cal.set(data[i], data[i+1], data[i+2], data[i+3], 0, 0); in TestWeekend()
126 cal.setTime(new Date(cal.getTime().getTime() + data[i+4])); in TestWeekend()
128 boolean isWeekend = cal.isWeekend(); in TestWeekend()
131 logln("Ok: " + fmt.format(cal.getTime()) + " isWeekend=" + isWeekend); in TestWeekend()
133 errln("FAIL: " + fmt.format(cal.getTime()) + " isWeekend=" + isWeekend + in TestWeekend()
143 Calendar cal = Calendar.getInstance(loc); in TestWeekend() local
145 int type = cal.getDayOfWeekType(data[i]); in TestWeekend()
164 void quasiGregorianTest(Calendar cal, int[] data) { in quasiGregorianTest() argument
[all …]
DCopticTest.java152 CopticCalendar cal = new CopticCalendar(); in TestCopticToJD() local
153 cal.clear(); in TestCopticToJD()
158 cal.set(Calendar.JULIAN_DAY, jd); in TestCopticToJD()
159 int eyear = cal.get(Calendar.EXTENDED_YEAR); in TestCopticToJD()
160 int month = cal.get(Calendar.MONTH); in TestCopticToJD()
161 int day = cal.get(Calendar.DAY_OF_MONTH); in TestCopticToJD()
186 CopticCalendar cal = new CopticCalendar(1, 0, 1); in TestEraStart() local
187 assertEquals("Coptic Date", "Fri Jan 01, 0001 AD", copticFmt.format(cal)); in TestEraStart()
188 assertEquals("Gregorian Date", "Fri Aug 29, 0284 AD", fmt.format(cal.getTime())); in TestEraStart()
190 cal.set(Calendar.ERA, 0); in TestEraStart()
[all …]
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/
DCompatibilityTest.java76 GregorianCalendar cal = new GregorianCalendar(gmt); in TestGregorianChangeover() local
101 cal.setTime(d); in TestGregorianChangeover()
102 int y = cal.get(Calendar.YEAR), mon = cal.get(Calendar.MONTH)+1-Calendar.JANUARY, in TestGregorianChangeover()
103 dom = cal.get(Calendar.DATE), dow = cal.get(Calendar.DAY_OF_WEEK); in TestGregorianChangeover()
121 GregorianCalendar cal = in TestMapping() local
131 cal.setGregorianChange(type==0 ? PURE_GREGORIAN : PURE_JULIAN); in TestMapping()
132 fmt.setCalendar(cal); in TestMapping()
155 cal.setTime(new Date(millis)); in TestMapping()
156 lim[sign] = fmt.format(cal.getTime()); in TestMapping()
172 GregorianCalendar cal = new GregorianCalendar(); in TestMapping() local
[all …]
DCalendarTestFmwk.java75 protected void doTestCases(TestCase[] cases, Calendar cal) in doTestCases() argument
77 cal.setTimeZone(UTC); in doTestCases()
80 …DateFormat format = DateFormat.getDateTimeInstance(cal, DateFormat.SHORT, -1, Locale.getDefault()); in doTestCases()
82 final String pattern = (cal instanceof ChineseCalendar) ? in doTestCases()
109 test.applyTime(cal); in doTestCases()
110 if (!test.fieldsEqual(cal, this)) { in doTestCases()
113 format.format(cal.getTime()) + in doTestCases()
122 cal.clear(); in doTestCases()
123 test.applyFields(cal); in doTestCases()
124 if (!test.equals(cal)) { in doTestCases()
[all …]
DChineseTest.java95 ChineseCalendar cal = new ChineseCalendar(); in TestMapping() local
105 cal.setTime(date); in TestMapping()
106 int y = cal.get(Calendar.EXTENDED_YEAR); in TestMapping()
107 int m = cal.get(Calendar.MONTH)+1; // 0-based -> 1-based in TestMapping()
108 int L = cal.get(Calendar.IS_LEAP_MONTH); in TestMapping()
109 int d = cal.get(Calendar.DAY_OF_MONTH); in TestMapping()
133 cal.clear(); in TestMapping()
134 cal.set(Calendar.EXTENDED_YEAR, cyear); in TestMapping()
135 cal.set(Calendar.MONTH, cmonth-1); in TestMapping()
136 cal.set(Calendar.IS_LEAP_MONTH, cisleapmonth); in TestMapping()
[all …]
DCalendarRegressionTest.java88 GregorianCalendar cal = new GregorianCalendar(zone); in Test4031502() local
89 cal.clear(); in Test4031502()
90 cal.set(1900, 15, 5, 5, 8, 13); in Test4031502()
91 if (cal.get(Calendar.HOUR) != 5) { in Test4031502()
94 cal.get(Calendar.DST_OFFSET) / (60*60*1000.0) + "; ZONE_OFFSET = " + in Test4031502()
95 cal.get(Calendar.ZONE_OFFSET) / (60*60*1000.0) + "; getRawOffset() = " + in Test4031502()
97 "; HOUR = " + cal.get(Calendar.HOUR)); in Test4031502()
98 cal.clear(); in Test4031502()
99 cal.set(1900, 15, 5, 5, 8, 13); in Test4031502()
100 if (cal.get(Calendar.HOUR) != 5) { in Test4031502()
[all …]
DDangiTest.java75 Calendar cal = Calendar.getInstance(new ULocale("ko_KR@calendar=dangi")); in TestMapping() local
85 cal.setTime(date); in TestMapping()
86 int y = cal.get(Calendar.EXTENDED_YEAR); in TestMapping()
87 int m = cal.get(Calendar.MONTH) + 1; // 0-based -> 1-based in TestMapping()
88 int L = cal.get(Calendar.IS_LEAP_MONTH); in TestMapping()
89 int d = cal.get(Calendar.DAY_OF_MONTH); in TestMapping()
112 cal.clear(); in TestMapping()
113 cal.set(Calendar.EXTENDED_YEAR, cyear); in TestMapping()
114 cal.set(Calendar.MONTH, cmonth - 1); in TestMapping()
115 cal.set(Calendar.IS_LEAP_MONTH, cisleapmonth); in TestMapping()
[all …]
DEthiopicTest.java242 EthiopicCalendar cal = new EthiopicCalendar(1, 0, 1); in TestEraStart() local
243 assertEquals("Ethiopic Date", "Wed Jan 01, 0001 AD", fmt.format(cal)); in TestEraStart()
245 cal.set(Calendar.ERA, 0); in TestEraStart()
246 cal.set(Calendar.YEAR, 5500); in TestEraStart()
247 assertEquals("Ethiopic Date", "Tue Jan 01, 5500 BC", fmt.format(cal)); in TestEraStart()
257 gc.setTime(cal.getTime()); in TestEraStart()
264 EthiopicCalendar cal = new EthiopicCalendar(); in TestBasic() local
265 cal.clear(); in TestBasic()
266 cal.set(1000, 0, 30); in TestBasic()
268 cal.get(YEAR) + "/" + in TestBasic()
[all …]
DIndianTest.java114 IndianCalendar cal = new IndianCalendar(); in TestBasic() local
115 cal.clear(); in TestBasic()
116 cal.set(1000, 0, 30); in TestBasic()
118 cal.get(YEAR) + "/" + in TestBasic()
119 cal.get(MONTH) + "/" + in TestBasic()
120 cal.get(DATE)); in TestBasic()
121 cal.clear(); in TestBasic()
122 cal.set(1, 0, 30); in TestBasic()
124 cal.get(YEAR) + "/" + in TestBasic()
125 cal.get(MONTH) + "/" + in TestBasic()
[all …]
DHebrewTest.java83 HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); in TestRoll() local
85 doRollAdd(ROLL, cal, tests); in TestRoll()
122 HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); in TestAdd() local
124 doRollAdd(ADD, cal, tests); in TestAdd()
264 HebrewCalendar cal = new HebrewCalendar(); in TestElulMonth() local
270 cal.clear(); in TestElulMonth()
272 cal.set(Calendar.YEAR, year); in TestElulMonth()
273 cal.set(Calendar.MONTH, ELUL); in TestElulMonth()
274 cal.set(Calendar.DAY_OF_MONTH, 1); in TestElulMonth()
276 int yact = cal.get(Calendar.YEAR); in TestElulMonth()
[all …]
DIBMCalendarTest.java117 Calendar cal = Calendar.getInstance(loc); in TestWeekend() local
120 cal.clear(); in TestWeekend()
121 cal.set(data[i], data[i+1], data[i+2], data[i+3], 0, 0); in TestWeekend()
123 cal.setTime(new Date(cal.getTime().getTime() + data[i+4])); in TestWeekend()
125 boolean isWeekend = cal.isWeekend(); in TestWeekend()
128 logln("Ok: " + fmt.format(cal.getTime()) + " isWeekend=" + isWeekend); in TestWeekend()
130 errln("FAIL: " + fmt.format(cal.getTime()) + " isWeekend=" + isWeekend + in TestWeekend()
140 Calendar cal = Calendar.getInstance(loc); in TestWeekend() local
142 int type = cal.getDayOfWeekType(data[i]); in TestWeekend()
161 void quasiGregorianTest(Calendar cal, int[] data) { in quasiGregorianTest() argument
[all …]
DCopticTest.java149 CopticCalendar cal = new CopticCalendar(); in TestCopticToJD() local
150 cal.clear(); in TestCopticToJD()
155 cal.set(Calendar.JULIAN_DAY, jd); in TestCopticToJD()
156 int eyear = cal.get(Calendar.EXTENDED_YEAR); in TestCopticToJD()
157 int month = cal.get(Calendar.MONTH); in TestCopticToJD()
158 int day = cal.get(Calendar.DAY_OF_MONTH); in TestCopticToJD()
183 CopticCalendar cal = new CopticCalendar(1, 0, 1); in TestEraStart() local
184 assertEquals("Coptic Date", "Fri Jan 01, 0001 AD", copticFmt.format(cal)); in TestEraStart()
185 assertEquals("Gregorian Date", "Fri Aug 29, 0284 AD", fmt.format(cal.getTime())); in TestEraStart()
187 cal.set(Calendar.ERA, 0); in TestEraStart()
[all …]
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/
DShadowDateFormatTest.java17 Calendar cal = Calendar.getInstance(); in getTimeFormat_returnsATimeFormat() local
18 cal.clear(); in getTimeFormat_returnsATimeFormat()
19 cal.set(Calendar.HOUR, 7); in getTimeFormat_returnsATimeFormat()
20 cal.set(Calendar.MINUTE, 48); in getTimeFormat_returnsATimeFormat()
21 cal.set(Calendar.SECOND, 3); in getTimeFormat_returnsATimeFormat()
22 Date date = cal.getTime(); in getTimeFormat_returnsATimeFormat()
28 Calendar cal = Calendar.getInstance(); in getDateFormat_returnsADateFormat_January() local
29 cal.clear(); in getDateFormat_returnsADateFormat_January()
30 cal.set(Calendar.DATE, 12); in getDateFormat_returnsADateFormat_January()
31 cal.set(Calendar.MONTH, Calendar.JANUARY); in getDateFormat_returnsADateFormat_January()
[all …]
/external/icu/icu4c/source/test/intltest/
Dcalregts.cpp144 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in test4100311() local
147 delete cal; in test4100311()
151 cal->set(UCAL_YEAR, 1997); in test4100311()
152 cal->set(UCAL_DAY_OF_YEAR, 1); in test4100311()
153 UDate d = cal->getTime(status); // Should be Jan 1 in test4100311()
156 delete cal; in test4100311()
167 GregorianCalendar *cal = new GregorianCalendar(status); in test4074758() local
170 delete cal; in test4074758()
175 cal->set(97, UCAL_JANUARY, 1, h, 34); in test4074758()
177 logln(UnicodeString("HOUR=") + cal->get(UCAL_HOUR, status)); //prints 0 in test4074758()
[all …]
Dcallimts.cpp56 CalendarLimitTest::test(UDate millis, icu::Calendar* cal, icu::DateFormat* fmt) in test() argument
62 cal->setTime(millis, exception); in test()
70 logln(UnicodeString(" ") + theDate + " " + CalendarTest::calToStr(*cal)); in test()
103 Calendar *cal = Calendar::createInstance(status); in TestCalendarExtremeLimit() local
105 cal->adoptTimeZone(TimeZone::createTimeZone("GMT")); in TestCalendarExtremeLimit()
107 if(!fmt || !cal) { in TestCalendarExtremeLimit()
111 fmt->adoptCalendar(cal); in TestCalendarExtremeLimit()
123 test(m, cal, fmt); in TestCalendarExtremeLimit()
127 test(m, cal, fmt); in TestCalendarExtremeLimit()
139 test(VERY_EARLY_MILLIS, cal, fmt); in TestCalendarExtremeLimit()
[all …]
Dcaltest.cpp60 UnicodeString CalendarTest::calToStr(const Calendar & cal) in calToStr() argument
67 …out += (UnicodeString("") + fieldName((UCalendarDateFields)i) + "=" + cal.get((UCalendarDateField… in calToStr()
69 out += "[" + UnicodeString(cal.getType()) + "]"; in calToStr()
71 if(cal.inDaylightTime(status)) { in calToStr()
79 out += cal.getTimeZone().getDisplayName(str2); in calToStr()
80 d = cal.getTime(status); in calToStr()
410 Calendar *cal = Calendar::createInstance(zone->clone(), status); in TestGenericAPI() local
413 if (*zone != cal->getTimeZone()) errln("FAIL: Calendar::getTimeZone failed"); in TestGenericAPI()
415 Calendar *cal2 = Calendar::createInstance(cal->getTimeZone(), status); in TestGenericAPI()
417 cal->setTime(when, status); in TestGenericAPI()
[all …]
/external/icu/icu4c/source/i18n/
Ducal.cpp189 ucal_close(UCalendar *cal) in ucal_close() argument
191 if (cal != nullptr) { in ucal_close()
192 delete (Calendar*) cal; in ucal_close()
197 ucal_clone(const UCalendar* cal, in ucal_clone() argument
202 Calendar* res = ((Calendar*)cal)->clone(); in ucal_clone()
213 ucal_setTimeZone( UCalendar* cal, in ucal_setTimeZone() argument
226 ((Calendar*)cal)->adoptTimeZone(zone); in ucal_setTimeZone()
231 ucal_getTimeZoneID(const UCalendar *cal, in ucal_getTimeZoneID() argument
239 const TimeZone& tz = ((Calendar*)cal)->getTimeZone(); in ucal_getTimeZoneID()
246 ucal_getTimeZoneDisplayName(const UCalendar* cal, in ucal_getTimeZoneDisplayName() argument
[all …]

12345678910>>...16