Lines Matching full:status
120 CalendarRegressionTest::failure(UErrorCode status, const char* msg) in failure() argument
122 if(U_FAILURE(status)) { in failure()
123 errcheckln(status, UnicodeString("FAIL: ") + msg + " failed, error " + u_errorName(status)); in failure()
136 UErrorCode status = U_ZERO_ERROR; in test4100311() local
137 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in test4100311()
138 if(U_FAILURE(status)) { in test4100311()
139 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4100311()
143 failure(status, "Calendar::createInstance(status)"); in test4100311()
146 UDate d = cal->getTime(status); // Should be Jan 1 in test4100311()
147 failure(status, "cal->getTime"); in test4100311()
159 UErrorCode status = U_ZERO_ERROR; in test4074758() local
160 GregorianCalendar *cal = new GregorianCalendar(status); in test4074758()
161 if(U_FAILURE(status)) { in test4074758()
162 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4074758()
166 failure(status, "new GregorianCalendar"); in test4074758()
170 logln(UnicodeString("HOUR=") + cal->get(UCAL_HOUR, status)); //prints 0 in test4074758()
171 failure(status, "cal->get"); in test4074758()
172 logln(UnicodeString("HOUR_OF_DAY=") + cal->get(UCAL_HOUR_OF_DAY, status)); in test4074758()
173 failure(status, "cal->get"); in test4074758()
182 UErrorCode status = U_ZERO_ERROR; in test4028518() local
183 GregorianCalendar *cal1 = new GregorianCalendar(status) ; in test4028518()
184 if(U_FAILURE(status)) { in test4028518()
185 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4028518()
189 failure(status, "new GregorianCalendar"); in test4028518()
194 cal1->add(UCAL_DATE, 1, status) ; in test4028518()
195 failure(status, "cal1->add"); in test4028518()
206 UErrorCode status = U_ZERO_ERROR; in Test9019() local
207 LocalPointer<GregorianCalendar> cal1(new GregorianCalendar(status), status); in Test9019()
208 LocalPointer<GregorianCalendar> cal2(new GregorianCalendar(status), status); in Test9019()
209 if(U_FAILURE(status)) { in Test9019()
210 dataerrln("Error creating Calendar: %s", u_errorName(status)); in Test9019()
217 failure(status, "new GregorianCalendar"); in Test9019()
222 cal1->add(UCAL_MONTH,8,status); in Test9019()
223 failure(status, "->add(UCAL_MONTH,8)"); in Test9019()
227 if(!cal1->equals(*cal2,status)) { in Test9019()
230 failure(status, "equals"); in Test9019()
236 UErrorCode status = U_ZERO_ERROR; in printdate() local
238 log(UnicodeString("") + cal->get(UCAL_MONTH, status)) ; in printdate()
239 failure(status, "cal->get"); in printdate()
240 int32_t date = cal->get(UCAL_DATE, status) + 1 ; in printdate()
241 failure(status, "cal->get"); in printdate()
243 logln(UnicodeString("/") + cal->get(UCAL_YEAR, status)) ; in printdate()
244 failure(status, "cal->get"); in printdate()
255 UErrorCode status = U_ZERO_ERROR; in test4031502() local
263 failure(status, "new TimeZone"); in test4031502()
264 GregorianCalendar *cl = new GregorianCalendar(tz, status); in test4031502()
265 if (U_FAILURE(status)) { in test4031502()
266 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4031502()
272 cl->get(UCAL_HOUR, status); in test4031502()
273 failure(status, "cl->get(UCAL_HOUR, status)"); in test4031502()
274 status = U_ZERO_ERROR; in test4031502()
276 for (int32_t i=0; i<ids->count(status); ++i) { in test4031502()
277 TimeZone *zone = TimeZone::createTimeZone(*ids->snext(status)); in test4031502()
278 GregorianCalendar *cal = new GregorianCalendar(zone, status); in test4031502()
279 failure(status, "new GregorianCalendar"); in test4031502()
282 if (cal->get(UCAL_HOUR, status) != 5 || U_FAILURE(status)) { in test4031502()
286 cal->get(UCAL_DST_OFFSET,status) / (60*60*1000) + " " + in test4031502()
288 ": HOUR = " + cal->get(UCAL_HOUR,status)); in test4031502()
304 UErrorCode status = U_ZERO_ERROR; in test4035301() local
305 GregorianCalendar *c = new GregorianCalendar(98, 8, 7,status); in test4035301()
306 GregorianCalendar *d = new GregorianCalendar(98, 8, 7,status); in test4035301()
307 if (c->after(*d,status) || in test4035301()
308 c->after(*c,status) || in test4035301()
309 c->before(*d,status) || in test4035301()
310 c->before(*c,status) || in test4035301()
329 UErrorCode status = U_ZERO_ERROR; in test4040996() local
330 count = ids->count(status); in test4040996()
332 SimpleTimeZone *pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, *ids->snext(status)); in test4040996()
333 pdt->setStartRule(UCAL_APRIL, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status); in test4040996()
334 pdt->setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status); in test4040996()
335 Calendar *calendar = new GregorianCalendar(pdt, status); in test4040996()
336 if (U_FAILURE(status)) { in test4040996()
337 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4040996()
344 logln(UnicodeString("MONTH: ") + calendar->get(UCAL_MONTH, status)); in test4040996()
346 calendar->get(UCAL_DATE, status)); in test4040996()
347 logln(UnicodeString("MINUTE: ") + calendar->get(UCAL_MINUTE, status)); in test4040996()
348 logln(UnicodeString("SECOND: ") + calendar->get(UCAL_SECOND, status)); in test4040996()
350 calendar->add(UCAL_SECOND,6, status); in test4040996()
354 logln(UnicodeString("MONTH: ") + calendar->get(UCAL_MONTH, status)); in test4040996()
356 calendar->get(UCAL_DATE, status)); in test4040996()
357 logln(UnicodeString("MINUTE: ") + calendar->get(UCAL_MINUTE, status)); in test4040996()
358 logln(UnicodeString("SECOND: ") + calendar->get(UCAL_SECOND, status)); in test4040996()
359 if (calendar->get(UCAL_MONTH, status) != 3 || in test4040996()
360 calendar->get(UCAL_DATE, status) != 18 || in test4040996()
361 calendar->get(UCAL_SECOND, status) != 36) in test4040996()
374 UErrorCode status = U_ZERO_ERROR; in test4051765() local
375 Calendar *cal = Calendar::createInstance(status); in test4051765()
376 if(U_FAILURE(status)) { in test4051765()
377 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4051765()
384 cal->getTime(status); in test4051765()
385 if( ! U_FAILURE(status)) in test4051765()
398 GregorianCalendar calendar = new GregorianCalendar(status);
457 UErrorCode status = U_ZERO_ERROR; in test4059654() local
458 GregorianCalendar *gc = new GregorianCalendar(status); in test4059654()
459 if(U_FAILURE(status)) { in test4059654()
460 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4059654()
473 UDate cd = gc->getTime(status); in test4059654()
474 GregorianCalendar *exp = new GregorianCalendar(1997, 3, 1, 0, 0, 0, status); in test4059654()
475 if (cd != exp->getTime(status)) in test4059654()
476 … errln(UnicodeString("Fail: Calendar::set broken. Got ") + cd + " Want " + exp->getTime(status)); in test4059654()
487 UErrorCode status = U_ZERO_ERROR; in test4061476() local
488 SimpleDateFormat *fmt = new SimpleDateFormat(UnicodeString("ddMMMyy"), Locale::getUK(),status); in test4061476()
490 Locale::getUK(),status); in test4061476()
491 if(U_FAILURE(status)) { in test4061476()
492 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4061476()
499 UDate date = fmt->parse("29MAY97", status); in test4061476()
500 failure(status, "fmt->parse"); in test4061476()
501 cal->setTime(date, status); in test4061476()
502 failure(status, "cal->setTime"); in test4061476()
506 logln(UnicodeString("Hour: ")+cal->get(UCAL_HOUR_OF_DAY, status)); in test4061476()
507 cal->add(UCAL_HOUR_OF_DAY, 6,status); in test4061476()
508 logln(UnicodeString("Hour: ")+cal->get(UCAL_HOUR_OF_DAY, status)); in test4061476()
509 if (cal->get(UCAL_HOUR_OF_DAY, status) != 19) in test4061476()
510 errln(UnicodeString("Fail: Want 19 Got ") + cal->get(UCAL_HOUR_OF_DAY, status)); in test4061476()
520 UErrorCode status = U_ZERO_ERROR; in test4070502() local
521 Calendar *cal = new GregorianCalendar(status); in test4070502()
522 if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) { in test4070502()
523 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4070502()
527 UDate d = getAssociatedDate(makeDate(1998,0,30), status); in test4070502()
528 cal->setTime(d,status); in test4070502()
529 if (cal->get(UCAL_DAY_OF_WEEK,status) == UCAL_SATURDAY || in test4070502()
530 cal->get(UCAL_DAY_OF_WEEK,status) == UCAL_SUNDAY) in test4070502()
544 CalendarRegressionTest::getAssociatedDate(UDate d, UErrorCode& status) in getAssociatedDate() argument
546 GregorianCalendar *cal = new GregorianCalendar(status); in getAssociatedDate()
547 cal->setTime(d,status); in getAssociatedDate()
551 int32_t wd = cal->get(UCAL_DAY_OF_WEEK, status); in getAssociatedDate()
553 cal->add(UCAL_DATE, 1, status); in getAssociatedDate()
560 UDate dd = cal->getTime(status); in getAssociatedDate()
576 UErrorCode status = U_ZERO_ERROR; in dowTest() local
577 GregorianCalendar *cal = new GregorianCalendar(status); in dowTest()
578 if(U_FAILURE(status)) { in dowTest()
579 dataerrln("Error creating Calendar: %s", u_errorName(status)); in dowTest()
587 int32_t dow = cal->get(UCAL_DAY_OF_WEEK, status); in dowTest()
598 if(U_FAILURE(status)) { in dowTest()
599 errln("Error checking Calendar: %s", u_errorName(status)); in dowTest()
604 if(cal->getActualMinimum(UCAL_DAY_OF_WEEK, status) != min) { in dowTest()
607 if(cal->getActualMinimum(Calendar::DAY_OF_WEEK, status) != min) { in dowTest()
608 errln("FAIL: actual minimum (Calendar::DAY_OF_WEEK, status) differs from minimum"); in dowTest()
613 if(((Calendar*)cal)->getActualMinimum(UCAL_DAY_OF_WEEK, status) != min) { in dowTest()
614 errln("FAIL: actual minimum (UCAL_DAY_OF_WEEK, status) differs from minimum"); in dowTest()
617 // if(((Calendar*)cal)->getActualMinimum(Calendar::DAY_OF_WEEK, status) != min) { in dowTest()
618 // errln("FAIL: actual minimum (Calendar::DAY_OF_WEEK, status) differs from minimum"); in dowTest()
620 if(U_FAILURE(status)) { in dowTest()
621 errln("Error getting actual minimum: %s", u_errorName(status)); in dowTest()
633 UErrorCode status = U_ZERO_ERROR; in test4071385() local
634 Calendar *cal = Calendar::createInstance(status); in test4071385()
635 if(U_FAILURE(status)) { in test4071385()
636 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4071385()
640 cal->setTime(makeDate(1998, UCAL_JUNE, 24),status); in test4071385()
643 if (cal->getTime(status) != makeDate(1998, UCAL_NOVEMBER, 24)) in test4071385()
654 UErrorCode status = U_ZERO_ERROR; in test4073929() local
655 GregorianCalendar *foo1 = new GregorianCalendar(1997, 8, 27,status); in test4073929()
656 if(U_FAILURE(status)) { in test4073929()
657 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4073929()
661 logln("foo1@%.0f - %d-%d-%d %d:%d:%d.%ds\n", foo1->getTime(status), in test4073929()
662 foo1->get(UCAL_YEAR, status), in test4073929()
663 foo1->get(UCAL_MONTH, status), in test4073929()
664 foo1->get(UCAL_DATE, status), in test4073929()
665 foo1->get(UCAL_HOUR, status), in test4073929()
666 foo1->get(UCAL_MINUTE, status), in test4073929()
667 foo1->get(UCAL_SECOND, status), in test4073929()
668 foo1->get(UCAL_MILLISECOND,status)); in test4073929()
669 foo1->add(UCAL_DATE, + 1, status); in test4073929()
670 logln("foo1@%.0f - %d-%d-%d %d:%d:%d.%ds after +\n", foo1->getTime(status), in test4073929()
671 foo1->get(UCAL_YEAR, status), in test4073929()
672 foo1->get(UCAL_MONTH, status), in test4073929()
673 foo1->get(UCAL_DATE, status), in test4073929()
674 foo1->get(UCAL_HOUR, status), in test4073929()
675 foo1->get(UCAL_MINUTE, status), in test4073929()
676 foo1->get(UCAL_SECOND, status), in test4073929()
677 foo1->get(UCAL_MILLISECOND ,status)); in test4073929()
678 foo1->add(UCAL_DATE, - 1, status); in test4073929()
679 logln("foo1@%.0f - %d-%d-%d %d:%d:%d.%ds after -\n", foo1->getTime(status), in test4073929()
680 foo1->get(UCAL_YEAR, status), in test4073929()
681 foo1->get(UCAL_MONTH, status), in test4073929()
682 foo1->get(UCAL_DATE, status), in test4073929()
683 foo1->get(UCAL_HOUR, status), in test4073929()
684 foo1->get(UCAL_MINUTE, status), in test4073929()
685 foo1->get(UCAL_SECOND, status), in test4073929()
686 foo1->get(UCAL_MILLISECOND, status)); in test4073929()
688 foo1->add(UCAL_DATE, + 1, status); in test4073929()
689 int32_t testyear = foo1->get(UCAL_YEAR, status); in test4073929()
690 int32_t testmonth = foo1->get(UCAL_MONTH, status); in test4073929()
691 int32_t testday = foo1->get(UCAL_DATE, status); in test4073929()
705 UErrorCode status = U_ZERO_ERROR; in test4083167() local
711 Calendar *cal = new GregorianCalendar(status); in test4083167()
712 if(U_FAILURE(status)) { in test4083167()
713 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4083167()
717 cal->setTime(firstDate,status); in test4083167()
718 int32_t hr = cal->get(UCAL_HOUR_OF_DAY, status); in test4083167()
719 int32_t min = cal->get(UCAL_MINUTE, status); in test4083167()
720 int32_t sec = cal->get(UCAL_SECOND, status); in test4083167()
721 int32_t msec = cal->get(UCAL_MILLISECOND, status); in test4083167()
728 cal->setTime(lastDate, status); in test4083167()
729 hr = cal->get(UCAL_HOUR_OF_DAY, status); in test4083167()
730 min = cal->get(UCAL_MINUTE, status); in test4083167()
731 sec = cal->get(UCAL_SECOND, status); in test4083167()
732 msec = cal->get(UCAL_MILLISECOND, status); in test4083167()
752 UErrorCode status = U_ZERO_ERROR; in test4086724() local
757 Locale::setDefault(Locale::getUK(),status); in test4086724()
760 date = new SimpleDateFormat(UnicodeString("dd MMM yyy (zzzz) 'is in week' ww"),status); in test4086724()
761 Calendar *cal = Calendar::createInstance(status); in test4086724()
762 if(U_FAILURE(status)) { in test4086724()
763 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4086724()
770 UDate now = cal->getTime(status); in test4086724()
775 now=cal->getTime(status); in test4086724()
778 now=cal->getTime(status); in test4086724()
781 now=cal->getTime(status); in test4086724()
785 Locale::setDefault(saveLocale,status); in test4086724()
800 UErrorCode status = U_ZERO_ERROR; in test4092362() local
801 GregorianCalendar *cal1 = new GregorianCalendar(1997, 10, 11, 10, 20, 40,status); in test4092362()
802 if (U_FAILURE(status)) { in test4092362()
803 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4092362()
814 logln( UnicodeString(" Cal1 = ") + cal1->getTime(status) ); in test4092362()
815 logln( UnicodeString(" Cal1 time in ms = ") + cal1->get(UCAL_MILLISECOND,status) ); in test4092362()
819 GregorianCalendar *cal2 = new GregorianCalendar(1997, 10, 11, 10, 20, 40,status); in test4092362()
827 logln( UnicodeString(" Cal2 = ") + cal2->getTime(status) ); in test4092362()
828 logln( UnicodeString(" Cal2 time in ms = ") + cal2->get(UCAL_MILLISECOND,status) ); in test4092362()
841 UErrorCode status = U_ZERO_ERROR; in test4095407() local
842 GregorianCalendar *a = new GregorianCalendar(1997,UCAL_NOVEMBER, 13,status); in test4095407()
843 if (U_FAILURE(status)) { in test4095407()
844 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4095407()
848 int32_t dow = a->get(UCAL_DAY_OF_WEEK, status); in test4095407()
860 UErrorCode status = U_ZERO_ERROR; in test4096231() local
865 Calendar *cal1 = new GregorianCalendar(*PST,status); in test4096231()
866 if (U_FAILURE(status)) { in test4096231()
867 dataerrln("Failure new GregorianCalendar: %s", u_errorName(status)); in test4096231()
873 cal1->setTime(880698639000.0,status); in test4096231()
879 logln(UnicodeString("PST 1 is: ") + (h1=cal1->get(UCAL_HOUR_OF_DAY, status))); in test4096231()
881 logln(UnicodeString("GMT 2 is: ") + (h2=cal1->get(UCAL_HOUR_OF_DAY, status))); in test4096231()
885 Calendar *cal2 = new GregorianCalendar(*GMT,status); in test4096231()
886 Calendar *cal3 = new GregorianCalendar(*PST,status); in test4096231()
890 cal2->set(cal1->get(UCAL_YEAR,status), in test4096231()
891 cal1->get(UCAL_MONTH,status), in test4096231()
892 cal1->get(UCAL_DATE,status), in test4096231()
893 cal1->get(UCAL_HOUR_OF_DAY,status), in test4096231()
894 cal1->get(UCAL_MINUTE,status), in test4096231()
895 cal1->get(UCAL_SECOND,status)); in test4096231()
898 logln(UnicodeString("RGMT 1 is: ") + (t1=cal2->getTime(status))); in test4096231()
900 logln(UnicodeString("RPST 1 is: ") + (t2=cal3->getTime(status))); in test4096231()
902 logln(UnicodeString("RGMT 2 is: ") + (t3=cal3->getTime(status))); in test4096231()
903 cal3->set(cal1->get(UCAL_YEAR,status), in test4096231()
904 cal1->get(UCAL_MONTH,status), in test4096231()
905 cal1->get(UCAL_DATE,status), in test4096231()
906 cal1->get(UCAL_HOUR_OF_DAY,status), in test4096231()
907 cal1->get(UCAL_MINUTE,status), in test4096231()
908 cal1->get(UCAL_SECOND,status)); in test4096231()
912 logln(UnicodeString("RGMT 3 is: ") + (t4=cal3->getTime(status))); in test4096231()
930 UErrorCode status = U_ZERO_ERROR; in test4096539() local
935 GregorianCalendar(1997,x,y[x], status); in test4096539()
936 if (U_FAILURE(status)) { in test4096539()
937 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4096539()
942 log(UnicodeString("") + (m1=gc->get(UCAL_MONTH,status)+1)+UnicodeString("/")+ in test4096539()
943 gc->get(UCAL_DATE,status)+"/"+gc->get(UCAL_YEAR,status)+ in test4096539()
946 gc->add(UCAL_MONTH, 1,status); in test4096539()
947 logln(UnicodeString("") + (m2=gc->get(UCAL_MONTH,status)+1)+UnicodeString("/")+ in test4096539()
948 gc->get(UCAL_DATE,status)+"/"+gc->get(UCAL_YEAR,status) in test4096539()
963 UErrorCode status = U_ZERO_ERROR; in test41003112() local
964 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in test41003112()
965 if(U_FAILURE(status)) { in test41003112()
966 dataerrln("Error creating calendar: %s", u_errorName(status)); in test41003112()
972 //UDate d = cal->getTime(status); // Should be Jan 1 in test41003112()
974 if (cal->get(UCAL_DAY_OF_YEAR, status) != 1) in test41003112()
984 UErrorCode status = U_ZERO_ERROR; in test4103271() local
985 SimpleDateFormat sdf(status); in test4103271()
988 GregorianCalendar *testCal = (GregorianCalendar*)Calendar::createInstance(status); in test4103271()
989 if(U_FAILURE(status)) { in test4103271()
990 dataerrln("Error creating calendar: %s", u_errorName(status)); in test4103271()
1010 testCal->add(UCAL_DATE,1,status); in test4103271()
1012 int32_t actWOY = testCal->get(UCAL_WEEK_OF_YEAR,status); in test4103271()
1014 UDate d = testCal->getTime(status); in test4103271()
1043 int32_t woy = testCal->get(UCAL_WEEK_OF_YEAR,status); in test4103271()
1045 log(UnicodeString("") + sdf.format(testCal->getTime(status), str) + in test4103271()
1055 UDate save = testCal->getTime(status); in test4103271()
1060 if (testCal->getTime(status) != save) { in test4103271()
1063 sdf.format(testCal->getTime(status), str)); in test4103271()
1067 testCal->setTime(save,status); in test4103271()
1068 testCal->add(UCAL_DATE, 1,status); in test4103271()
1096 UDate got = testCal->getTime(status); in test4103271()
1102 UDate got = testCal->getTime(status); in test4103271()
1108 UDate got = testCal->getTime(status); in test4103271()
1124 UDate got = testCal->getTime(status); in test4103271()
1133 testCal->setTime(exp, status); in test4103271()
1143 got = testCal->getTime(status); in test4103271()
1185 testCal->setTime(before,status); in test4103271()
1187 testCal->add(UCAL_WEEK_OF_YEAR, amount,status); in test4103271()
1189 testCal->roll(UCAL_WEEK_OF_YEAR, amount,status); in test4103271()
1190 UDate got = testCal->getTime(status); in test4103271()
1208 testCal->setTime(after,status); in test4103271()
1210 testCal->add(UCAL_WEEK_OF_YEAR, -amount,status); in test4103271()
1212 testCal->roll(UCAL_WEEK_OF_YEAR, -amount,status); in test4103271()
1213 got = testCal->getTime(status); in test4103271()
1234 UErrorCode status = U_ZERO_ERROR; in test4106136() local
1239 Locale::setDefault(locales[i], status); in test4106136()
1240 failure(status, "Locale::setDefault"); in test4106136()
1256 Locale::setDefault(saveLocale,status); in test4106136()
1265 UErrorCode status = U_ZERO_ERROR; in test4108764() local
1266 Calendar *cal = Calendar::createInstance(status); in test4108764()
1267 if(U_FAILURE(status)) { in test4108764()
1268 dataerrln("Error creating calendar %s", u_errorName(status)); in test4108764()
1278 cal->setTime(d11,status); in test4108764()
1281 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1282 if (cal->getTime(status) != d01) in test4108764()
1286 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1287 if (cal->getTime(status) != d00) in test4108764()
1290 cal->setTime(d11,status); in test4108764()
1292 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1293 if (cal->getTime(status) != d10) in test4108764()
1297 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1298 if (cal->getTime(status) != d00) in test4108764()
1302 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1303 if (cal->getTime(status) != epoch) in test4108764()
1314 UErrorCode status = U_ZERO_ERROR; in test4114578() local
1316 Calendar *cal = Calendar::createInstance(status); in test4114578()
1317 if(U_FAILURE(status)) { in test4114578()
1318 dataerrln("Error creating calendar %s", u_errorName(status)); in test4114578()
1349 cal->setTime(date,status); in test4114578()
1354 cal->add(UCAL_HOUR, amt,status); in test4114578()
1358 cal->roll(UCAL_HOUR, amt,status); in test4114578()
1362 log(UnicodeString("") + cal->getTime(status)); in test4114578()
1364 double change = cal->getTime(status) - date; in test4114578()
1383 UErrorCode status = U_ZERO_ERROR; in test4118384() local
1384 Calendar *cal = Calendar::createInstance(status); in test4118384()
1385 if(U_FAILURE(status)) { in test4118384()
1386 dataerrln("Error creating calendar %s", u_errorName(status)); in test4118384()
1392 cal->getActualMaximum(UCAL_HOUR,status) != 11) in test4118384()
1407 cal = Calendar::createInstance(Locale("th_TH@calendar=buddhist"),status); in test4118384()
1421 cal = Calendar::createInstance(Locale("ja_JP@calendar=japanese"),status); in test4118384()
1441 UErrorCode status = U_ZERO_ERROR; in test4125881() local
1442 GregorianCalendar *cal = (GregorianCalendar*) Calendar::createInstance(status); in test4125881()
1443 if(U_FAILURE(status)) { in test4125881()
1444 dataerrln("Error creating calendar %s", u_errorName(status)); in test4125881()
1448 DateFormat *fmt = new SimpleDateFormat(UnicodeString("MMMM d, yyyy G"),status); in test4125881()
1449 if(U_FAILURE(status)) { in test4125881()
1450 dataerrln("Error creating SimpleDateFormat - %s", u_errorName(status)); in test4125881()
1459 …logln(UnicodeString("") + y + UnicodeString(" = ") + fmt->format(cal->getTime(status), temp) + " "… in test4125881()
1475 UErrorCode status = U_ZERO_ERROR; in test4125892() local
1476 GregorianCalendar *cal = (GregorianCalendar*) Calendar::createInstance(status); in test4125892()
1477 if(U_FAILURE(status)) { in test4125892()
1478 dataerrln("Error creating calendar %s", u_errorName(status)); in test4125892()
1482 DateFormat *fmt = new SimpleDateFormat(UnicodeString("MMMM d, yyyy G"),status); in test4125892()
1483 if(U_FAILURE(status)) { in test4125892()
1484 dataerrln("Error creating SimpleDateFormat - %s", u_errorName(status)); in test4125892()
1493 cal->add(UCAL_DATE, 1,status); in test4125892()
1494 if(U_FAILURE(status)) in test4125892()
1496 if (cal->get(UCAL_DATE,status) != 29 || in test4125892()
1510 UErrorCode status = U_ZERO_ERROR; in test4141665() local
1511 GregorianCalendar *cal = new GregorianCalendar(status); in test4141665()
1512 if(U_FAILURE(status)) { in test4141665()
1513 dataerrln("Error creating calendar %s", u_errorName(status)); in test4141665()
1523 cal2->setGregorianChange(cut2,status); in test4141665()
1539 UErrorCode status = U_ZERO_ERROR; in test4142933() local
1540 GregorianCalendar *calendar = new GregorianCalendar(status); in test4142933()
1541 if(U_FAILURE(status)) { in test4142933()
1542 dataerrln("Error creating calendar %s", u_errorName(status)); in test4142933()
1547 calendar->roll((UCalendarDateFields)-1, TRUE, status); in test4142933()
1548 if(U_SUCCESS(status)) in test4142933()
1573 UErrorCode status = U_ZERO_ERROR; in test4145158() local
1574 GregorianCalendar *calendar = new GregorianCalendar(status); in test4145158()
1575 if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) { in test4145158()
1576 dataerrln("Error creating calendar %s", u_errorName(status)); in test4145158()
1583 calendar->setTime(makeDate(INT32_MIN),status); in test4145158()
1584 int32_t year1 = calendar->get(UCAL_YEAR,status); in test4145158()
1585 int32_t era1 = calendar->get(UCAL_ERA,status); in test4145158()
1587 calendar->setTime(makeDate(INT32_MAX),status); in test4145158()
1588 int32_t year2 = calendar->get(UCAL_YEAR,status); in test4145158()
1589 int32_t era2 = calendar->get(UCAL_ERA,status); in test4145158()
1612 UErrorCode status = U_ZERO_ERROR; in test4145983() local
1613 GregorianCalendar *calendar = new GregorianCalendar(status); in test4145983()
1614 if(U_FAILURE(status)) { in test4145983()
1615 dataerrln("Error creating calendar %s", u_errorName(status)); in test4145983()
1622 calendar->setTime(DATES[i], status); in test4145983()
1623 int32_t year = calendar->get(UCAL_YEAR,status); in test4145983()
1643 UErrorCode status = U_ZERO_ERROR; in test4147269() local
1644 GregorianCalendar *calendar = new GregorianCalendar(status); in test4147269()
1645 if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) { in test4147269()
1646 dataerrln("Error creating calendar %s", u_errorName(status)); in test4147269()
1653 calendar->setTime(date,status); in test4147269()
1661 calendar->getTime(status); // Force time computation in test4147269()
1664 if(U_SUCCESS(status)) in test4147269()
1667 ", date after: " + calendar->getTime(status) + in test4147269()
1684 UErrorCode status = U_ZERO_ERROR; in Test4149677() local
1691 if(U_FAILURE(status)) { in Test4149677()
1698 GregorianCalendar *calendar = new GregorianCalendar(zones[i], status); in Test4149677()
1699 if(U_FAILURE(status)) { in Test4149677()
1700 dataerrln("Couldnt' create calendar.: %s", u_errorName(status)); in Test4149677()
1705 calendar->setTime(EARLIEST_SUPPORTED_MILLIS, status); in Test4149677()
1706 if(U_FAILURE(status)) in Test4149677()
1708 if (calendar->get(UCAL_ERA, status) != GregorianCalendar::BC || U_FAILURE(status)) { in Test4149677()
1711 calendar->setTime(LATEST_SUPPORTED_MILLIS, status); in Test4149677()
1712 if(U_FAILURE(status)) in Test4149677()
1714 if (calendar->get(UCAL_ERA, status) != GregorianCalendar::AD || U_FAILURE(status)) { in Test4149677()
1718 calendar->setGregorianChange(LATEST_SUPPORTED_MILLIS, status); in Test4149677()
1719 if(U_FAILURE(status)) in Test4149677()
1744 UErrorCode status = U_ZERO_ERROR; in Test4162587() local
1750 GregorianCalendar *cal = new GregorianCalendar(tz, status); in Test4162587()
1751 if(U_FAILURE(status)) { in Test4162587()
1752 dataerrln("Couldn't create calendar.: %s", u_errorName(status)); in Test4162587()
1762 d0 = cal->getTime(status); in Test4162587()
1763 if(U_FAILURE(status)) in Test4162587()
1770 dPlus = cal->getTime(status); in Test4162587()
1771 if(U_FAILURE(status)) in Test4162587()
1778 dMinus = cal->getTime(status); in Test4162587()
1779 if(U_FAILURE(status)) in Test4162587()
1801 UErrorCode status = U_ZERO_ERROR; in Test4165343() local
1802 GregorianCalendar *calendar = new GregorianCalendar(1996, UCAL_FEBRUARY, 29, status); in Test4165343()
1803 if(U_FAILURE(status)) { in Test4165343()
1804 dataerrln("Couldn't create calendar.: %s", u_errorName(status)); in Test4165343()
1807 UDate start = calendar->getTime(status); in Test4165343()
1808 if(U_FAILURE(status)) in Test4165343()
1811 calendar->add(UCAL_MONTH, 12, status); in Test4165343()
1812 if(U_FAILURE(status)) in Test4165343()
1814 UDate date1 = calendar->getTime(status); in Test4165343()
1815 if(U_FAILURE(status)) in Test4165343()
1818 calendar->setTime(start, status); in Test4165343()
1819 if(U_FAILURE(status)) in Test4165343()
1821 calendar->add(UCAL_YEAR, 1, status); in Test4165343()
1822 if(U_FAILURE(status)) in Test4165343()
1824 UDate date2 = calendar->getTime(status); in Test4165343()
1825 if(U_FAILURE(status)) in Test4165343()
1854 UErrorCode status = U_ZERO_ERROR; in Test4166109() local
1857 GregorianCalendar *calendar = new GregorianCalendar(Locale::getUS(), status); in Test4166109()
1858 if(U_FAILURE(status)) { in Test4166109()
1859 dataerrln("Couldn't create calendar.: %s", u_errorName(status)); in Test4166109()
1864 logln(UnicodeString("Date: ") + calendar->getTime(status)); // 888817448000 in Test4166109()
1866 int32_t firstInMonth = calendar->get(UCAL_DATE, status); in Test4166109()
1867 if(U_FAILURE(status)) in Test4166109()
1872 int32_t returned = calendar->getActualMaximum(field, status); in Test4166109()
1876 " getActualMaximum(WEEK_OF_MONTH, status) = " + returned + in Test4166109()
1898 UErrorCode status = U_ZERO_ERROR; in Test4167060() local
1901 Locale::getUS(), status); in Test4167060()
1902 if(U_FAILURE(status)) { in Test4167060()
1903 dataerrln("Couldn't create SimpleDateFormat - %s", u_errorName(status)); in Test4167060()
1908 new GregorianCalendar(100, UCAL_NOVEMBER, 1, status), in Test4167060()
1909 new GregorianCalendar(-99 /*100BC*/, UCAL_JANUARY, 1, status), in Test4167060()
1910 new GregorianCalendar(1996, UCAL_FEBRUARY, 29, status), in Test4167060()
1912 if(U_FAILURE(status)) { in Test4167060()
1926 calendar->setGregorianChange(EARLIEST_SUPPORTED_MILLIS, status); in Test4167060()
1929 calendar->setGregorianChange(LATEST_SUPPORTED_MILLIS, status); in Test4167060()
1932 if(U_FAILURE(status)) in Test4167060()
1936 UDate dateBefore = calendar->getTime(status); in Test4167060()
1937 if(U_FAILURE(status)) in Test4167060()
1940 int32_t maxYear = calendar->getActualMaximum(field, status); in Test4167060()
1942 …(UnicodeString("maxYear: ") + maxYear + " for " + format->format(calendar->getTime(status), temp)); in Test4167060()
1951 UDate dateAfter = calendar->getTime(status); in Test4167060()
1952 if(U_FAILURE(status)) in Test4167060()
1954 int32_t newYear = calendar->get(field, status); in Test4167060()
1955 if(U_FAILURE(status)) in Test4167060()
1957 calendar->setTime(dateBefore, status); // restore calendar for next use in Test4167060()
1958 if(U_FAILURE(status)) in Test4167060()
1986 UErrorCode status = U_ZERO_ERROR; in Test4197699() local
1987 GregorianCalendar cal(status); in Test4197699()
1991 Locale::getUS(), status); in Test4197699()
1993 if (U_FAILURE(status)) { in Test4197699()
1994 dataerrln("Couldn't initialize test - %s", u_errorName(status)); in Test4197699()
2011 int32_t actWOY = cal.get(UCAL_WEEK_OF_YEAR, status); in Test4197699()
2013 logln(UnicodeString("Ok: ") + dfmt.format(cal.getTime(status), str.remove())); in Test4197699()
2015 errln(UnicodeString("FAIL: ") + dfmt.format(cal.getTime(status), str.remove()) in Test4197699()
2017 cal.add(UCAL_DATE, -8, status); in Test4197699()
2019 cal.add(UCAL_DATE, 1, status); in Test4197699()
2020 logln(dfmt.format(cal.getTime(status), str.remove())); in Test4197699()
2023 if (U_FAILURE(status)) { in Test4197699()
2050 UErrorCode status = U_ZERO_ERROR; in TestJ81() local
2053 GregorianCalendar cal(TimeZone::createTimeZone("GMT"), Locale::getUS(), status); in TestJ81()
2054 SimpleDateFormat fmt("HH:mm 'w'w 'd'D E d MMM yyyy", Locale::getUS(), status); in TestJ81()
2055 if (U_FAILURE(status)) { in TestJ81()
2056 dataerrln("Error: Cannot create calendar or format - %s", u_errorName(status)); in TestJ81()
2110 int32_t woy = cal.get(UCAL_WEEK_OF_YEAR, status); in TestJ81()
2111 int32_t doy = cal.get(UCAL_DAY_OF_YEAR, status); in TestJ81()
2112 int32_t dow = cal.get(UCAL_DAY_OF_WEEK, status); in TestJ81()
2113 if (U_FAILURE(status)) { in TestJ81()
2120 fmt.format(cal.getTime(status), temp.remove()) + in TestJ81()
2123 status = U_ZERO_ERROR; in TestJ81()
2127 fmt.format(cal.getTime(status), temp.remove())); in TestJ81()
2129 status = U_ZERO_ERROR; in TestJ81()
2136 int32_t dom = cal.get(UCAL_DATE, status); in TestJ81()
2137 if (U_FAILURE(status)) { in TestJ81()
2144 fmt.format(cal.getTime(status), temp.remove()) + in TestJ81()
2147 status = U_ZERO_ERROR; in TestJ81()
2154 dom = cal.get(UCAL_DATE, status); in TestJ81()
2155 if (U_FAILURE(status)) { in TestJ81()
2162 fmt.format(cal.getTime(status), temp.remove()) + in TestJ81()
2164 status = U_ZERO_ERROR; in TestJ81()
2167 status = U_ZERO_ERROR; in TestJ81()
2207 status = U_ZERO_ERROR; in TestJ81()
2213 cal.setTime(date, status); in TestJ81()
2214 if (U_FAILURE(status)) { in TestJ81()
2215 … errln((UnicodeString)"FAIL: setTime returned error code " + u_errorName(status)); in TestJ81()
2219 cal.add(DATA[i].field, amount, status); in TestJ81()
2221 cal.roll(DATA[i].field, amount, status); in TestJ81()
2223 if (U_FAILURE(status)) { in TestJ81()
2226 " returned error code " + u_errorName(status)); in TestJ81()
2229 UDate result = cal.getTime(status); in TestJ81()
2230 if (U_FAILURE(status)) { in TestJ81()
2231 … errln((UnicodeString)"FAIL: getTime returned error code " + u_errorName(status)); in TestJ81()
2443 UErrorCode status = U_ZERO_ERROR; in TestT6745() local
2444 Calendar *cal = Calendar::createInstance(Locale(testLocalePtr->locale), status); in TestT6745()
2445 if ( U_FAILURE(status) ) { in TestT6745()
2446 …L: Calendar::createInstance, locale " + testLocalePtr->locale + ", status " + u_errorName(status)); in TestT6745()
2451 status = U_ZERO_ERROR; in TestT6745()
2453 cal->add( testItemPtr->fieldToChange, testItemPtr->fieldDelta, status ); in TestT6745()
2454 if ( U_FAILURE(status) ) { in TestT6745()
2456 … testItemPtr->fieldToChange + "/" + testItemPtr->fieldDelta + ", status " + u_errorName(status)); in TestT6745()
2460 int32_t year = cal->get(UCAL_YEAR, status); in TestT6745()
2461 int32_t month = cal->get(UCAL_MONTH, status); in TestT6745()
2462 int32_t day = cal->get(UCAL_DATE, status); in TestT6745()
2463 …if ( U_FAILURE(status) || year != endYear || month != testItemPtr->endMonth || day != testItemPtr-… in TestT6745()
2465 … testItemPtr->fieldToChange + "/" + testItemPtr->fieldDelta + ", status " + u_errorName(status) + in TestT6745()
2711 UErrorCode status = U_ZERO_ERROR; in makeDate() local
2712 Calendar *cal = Calendar::createInstance(status); in makeDate()
2723 result = cal->getTime(status); in makeDate()
2732 UErrorCode status = U_ZERO_ERROR; in TestDeprecates() local
2733 Calendar *c1 = Calendar::createInstance("ja_JP@calendar=japanese",status); in TestDeprecates()
2734 Calendar *c2 = Calendar::createInstance("ja_JP_TRADITIONAL",status); in TestDeprecates()
2736 if(!c1 || !c2 || U_FAILURE(status)) { in TestDeprecates()
2737 dataerrln("Couldn't create calendars for roll of HOUR: %s", u_errorName(status)); in TestDeprecates()
2742 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2745 c1->roll(Calendar::HOUR,(int32_t)3,status); in TestDeprecates()
2746 c2->roll(UCAL_HOUR,(int32_t)3,status); in TestDeprecates()
2748 if(U_FAILURE(status)) { in TestDeprecates()
2754 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2755 c1->roll(Calendar::HOUR,(UBool)FALSE,status); in TestDeprecates()
2756 c2->roll(UCAL_HOUR,(UBool)FALSE,status); in TestDeprecates()
2758 if(U_FAILURE(status)) { in TestDeprecates()
2767 status = U_ZERO_ERROR; in TestDeprecates()
2769 c1 = Calendar::createInstance("th_TH_TRADITIONAL",status); in TestDeprecates()
2770 c2 = Calendar::createInstance("th_TH@calendar=buddhist",status); in TestDeprecates()
2772 if(!c1 || !c2 || U_FAILURE(status)) { in TestDeprecates()
2778 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2781 c1->add(Calendar::HOUR,(int32_t)1,status); in TestDeprecates()
2783 if(U_FAILURE(status)) { in TestDeprecates()
2784 errln("Error code when trying to add Calendar::HOUR - %s", u_errorName(status)); in TestDeprecates()
2787 c2->add(UCAL_HOUR,(int32_t)1,status); in TestDeprecates()
2789 if(U_FAILURE(status)) { in TestDeprecates()
2790 errln("Error code when trying to add - UCAL_HOUR %s", u_errorName(status)); in TestDeprecates()
2798 status = U_ZERO_ERROR; in TestDeprecates()
2800 c1 = Calendar::createInstance("es_ES",status); in TestDeprecates()
2801 c2 = Calendar::createInstance("es_ES",status); in TestDeprecates()
2803 if(!c1 || !c2 || U_FAILURE(status)) { in TestDeprecates()
2809 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2812 c1->add(Calendar::YEAR,(int32_t)9,status); in TestDeprecates()
2813 c2->add(UCAL_YEAR,(int32_t)9,status); in TestDeprecates()
2815 if(U_FAILURE(status)) { in TestDeprecates()
2828 UErrorCode status = U_ZERO_ERROR; in TestT8057() local
2829 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in TestT8057()
2830 if(U_FAILURE(status)) { in TestT8057()
2831 errln("Error creating Calendar: %s", u_errorName(status)); in TestT8057()
2840 UDate t = cal->getTime(status); in TestT8057()
2841 if(U_FAILURE(status)) { in TestT8057()
2849 cal->add(UCAL_YEAR, 1, status); in TestT8057()
2850 t = cal->getTime(status); in TestT8057()
2851 if (U_SUCCESS(status)) { in TestT8057()
2866 UErrorCode status = U_ZERO_ERROR; in TestT8596() local
2867 GregorianCalendar *gc = new GregorianCalendar(*TimeZone::getGMT(), status); in TestT8596()
2869 if (U_FAILURE(status)) { in TestT8596()
2870 dataerrln("Error creating Calendar: %s", u_errorName(status)); in TestT8596()
2881 gc->get(UCAL_YEAR, status); in TestT8596()
2890 int32_t maxWeeks = gc->getActualMaximum(UCAL_WEEK_OF_YEAR, status); in TestT8596()
2892 if (U_FAILURE(status)) { in TestT8596()
2893 errln("Error calendar calculation: %s", u_errorName(status)); in TestT8596()
2908 UErrorCode status = U_ZERO_ERROR; in TestT9452() local
2909 GregorianCalendar cal(TimeZone::createTimeZone("Pacific/Apia"), status); in TestT9452()
2910 failure(status, "initializing GregorianCalendar"); in TestT9452()
2912 SimpleDateFormat sdf(UnicodeString("y-MM-dd'T'HH:mm:ssZZZZZ"), status); in TestT9452()
2913 failure(status, "initializing SimpleDateFormat"); in TestT9452()
2922 UDate d = cal.getTime(status); in TestT9452()
2923 if (!failure(status, "getTime for initial date")) { in TestT9452()
2928 cal.add(UCAL_DATE, 1, status); in TestT9452()
2929 failure(status, "add 1 day"); in TestT9452()
2930 d = cal.getTime(status); in TestT9452()
2931 failure(status, "getTime after +1 day"); in TestT9452()
2938 cal.add(UCAL_DATE, -1, status); in TestT9452()
2939 failure(status, "subtract 1 day"); in TestT9452()
2940 d = cal.getTime(status); in TestT9452()
2941 failure(status, "getTime after -1 day"); in TestT9452()