Lines Matching refs:status
114 CalendarRegressionTest::failure(UErrorCode status, const char* msg) in failure() argument
116 if(U_FAILURE(status)) { in failure()
117 errcheckln(status, UnicodeString("FAIL: ") + msg + " failed, error " + u_errorName(status)); in failure()
130 UErrorCode status = U_ZERO_ERROR; in test4100311() local
131 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in test4100311()
132 if(U_FAILURE(status)) { in test4100311()
133 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4100311()
137 failure(status, "Calendar::createInstance(status)"); in test4100311()
140 UDate d = cal->getTime(status); // Should be Jan 1 in test4100311()
141 failure(status, "cal->getTime"); in test4100311()
153 UErrorCode status = U_ZERO_ERROR; in test4074758() local
154 GregorianCalendar *cal = new GregorianCalendar(status); in test4074758()
155 if(U_FAILURE(status)) { in test4074758()
156 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4074758()
160 failure(status, "new GregorianCalendar"); in test4074758()
164 logln(UnicodeString("HOUR=") + cal->get(UCAL_HOUR, status)); //prints 0 in test4074758()
165 failure(status, "cal->get"); in test4074758()
166 logln(UnicodeString("HOUR_OF_DAY=") + cal->get(UCAL_HOUR_OF_DAY, status)); in test4074758()
167 failure(status, "cal->get"); in test4074758()
176 UErrorCode status = U_ZERO_ERROR; in test4028518() local
177 GregorianCalendar *cal1 = new GregorianCalendar(status) ; in test4028518()
178 if(U_FAILURE(status)) { in test4028518()
179 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4028518()
183 failure(status, "new GregorianCalendar"); in test4028518()
188 cal1->add(UCAL_DATE, 1, status) ; in test4028518()
189 failure(status, "cal1->add"); in test4028518()
199 UErrorCode status = U_ZERO_ERROR; in printdate() local
201 log(UnicodeString("") + cal->get(UCAL_MONTH, status)) ; in printdate()
202 failure(status, "cal->get"); in printdate()
203 int32_t date = cal->get(UCAL_DATE, status) + 1 ; in printdate()
204 failure(status, "cal->get"); in printdate()
206 logln(UnicodeString("/") + cal->get(UCAL_YEAR, status)) ; in printdate()
207 failure(status, "cal->get"); in printdate()
218 UErrorCode status = U_ZERO_ERROR; in test4031502() local
226 failure(status, "new TimeZone"); in test4031502()
227 GregorianCalendar *cl = new GregorianCalendar(tz, status); in test4031502()
228 if (U_FAILURE(status)) { in test4031502()
229 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4031502()
235 cl->get(UCAL_HOUR, status); in test4031502()
236 failure(status, "cl->get(UCAL_HOUR, status)"); in test4031502()
237 status = U_ZERO_ERROR; in test4031502()
239 for (int32_t i=0; i<ids->count(status); ++i) { in test4031502()
240 TimeZone *zone = TimeZone::createTimeZone(*ids->snext(status)); in test4031502()
241 GregorianCalendar *cal = new GregorianCalendar(zone, status); in test4031502()
242 failure(status, "new GregorianCalendar"); in test4031502()
245 if (cal->get(UCAL_HOUR, status) != 5 || U_FAILURE(status)) { in test4031502()
249 cal->get(UCAL_DST_OFFSET,status) / (60*60*1000) + " " + in test4031502()
251 ": HOUR = " + cal->get(UCAL_HOUR,status)); in test4031502()
267 UErrorCode status = U_ZERO_ERROR; in test4035301() local
268 GregorianCalendar *c = new GregorianCalendar(98, 8, 7,status); in test4035301()
269 GregorianCalendar *d = new GregorianCalendar(98, 8, 7,status); in test4035301()
270 if (c->after(*d,status) || in test4035301()
271 c->after(*c,status) || in test4035301()
272 c->before(*d,status) || in test4035301()
273 c->before(*c,status) || in test4035301()
292 UErrorCode status = U_ZERO_ERROR; in test4040996() local
293 count = ids->count(status); in test4040996()
294 SimpleTimeZone *pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, *ids->snext(status)); in test4040996()
295 pdt->setStartRule(UCAL_APRIL, 1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status); in test4040996()
296 pdt->setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2 * 60 * 60 * 1000, status); in test4040996()
297 Calendar *calendar = new GregorianCalendar(pdt, status); in test4040996()
298 if (U_FAILURE(status)) { in test4040996()
299 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4040996()
306 logln(UnicodeString("MONTH: ") + calendar->get(UCAL_MONTH, status)); in test4040996()
308 calendar->get(UCAL_DATE, status)); in test4040996()
309 logln(UnicodeString("MINUTE: ") + calendar->get(UCAL_MINUTE, status)); in test4040996()
310 logln(UnicodeString("SECOND: ") + calendar->get(UCAL_SECOND, status)); in test4040996()
312 calendar->add(UCAL_SECOND,6, status); in test4040996()
316 logln(UnicodeString("MONTH: ") + calendar->get(UCAL_MONTH, status)); in test4040996()
318 calendar->get(UCAL_DATE, status)); in test4040996()
319 logln(UnicodeString("MINUTE: ") + calendar->get(UCAL_MINUTE, status)); in test4040996()
320 logln(UnicodeString("SECOND: ") + calendar->get(UCAL_SECOND, status)); in test4040996()
321 if (calendar->get(UCAL_MONTH, status) != 3 || in test4040996()
322 calendar->get(UCAL_DATE, status) != 18 || in test4040996()
323 calendar->get(UCAL_SECOND, status) != 36) in test4040996()
336 UErrorCode status = U_ZERO_ERROR; in test4051765() local
337 Calendar *cal = Calendar::createInstance(status); in test4051765()
338 if(U_FAILURE(status)) { in test4051765()
339 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4051765()
346 cal->getTime(status); in test4051765()
347 if( ! U_FAILURE(status)) in test4051765()
419 UErrorCode status = U_ZERO_ERROR; in test4059654() local
420 GregorianCalendar *gc = new GregorianCalendar(status); in test4059654()
421 if(U_FAILURE(status)) { in test4059654()
422 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4059654()
435 UDate cd = gc->getTime(status); in test4059654()
436 GregorianCalendar *exp = new GregorianCalendar(1997, 3, 1, 0, 0, 0, status); in test4059654()
437 if (cd != exp->getTime(status)) in test4059654()
438 … errln(UnicodeString("Fail: Calendar::set broken. Got ") + cd + " Want " + exp->getTime(status)); in test4059654()
449 UErrorCode status = U_ZERO_ERROR; in test4061476() local
450 SimpleDateFormat *fmt = new SimpleDateFormat(UnicodeString("ddMMMyy"), Locale::getUK(),status); in test4061476()
452 Locale::getUK(),status); in test4061476()
453 if(U_FAILURE(status)) { in test4061476()
454 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4061476()
461 UDate date = fmt->parse("29MAY97", status); in test4061476()
462 failure(status, "fmt->parse"); in test4061476()
463 cal->setTime(date, status); in test4061476()
464 failure(status, "cal->setTime"); in test4061476()
468 logln(UnicodeString("Hour: ")+cal->get(UCAL_HOUR_OF_DAY, status)); in test4061476()
469 cal->add(UCAL_HOUR_OF_DAY, 6,status); in test4061476()
470 logln(UnicodeString("Hour: ")+cal->get(UCAL_HOUR_OF_DAY, status)); in test4061476()
471 if (cal->get(UCAL_HOUR_OF_DAY, status) != 19) in test4061476()
472 errln(UnicodeString("Fail: Want 19 Got ") + cal->get(UCAL_HOUR_OF_DAY, status)); in test4061476()
482 UErrorCode status = U_ZERO_ERROR; in test4070502() local
483 Calendar *cal = new GregorianCalendar(status); in test4070502()
484 if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) { in test4070502()
485 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4070502()
489 UDate d = getAssociatedDate(makeDate(1998,0,30), status); in test4070502()
490 cal->setTime(d,status); in test4070502()
491 if (cal->get(UCAL_DAY_OF_WEEK,status) == UCAL_SATURDAY || in test4070502()
492 cal->get(UCAL_DAY_OF_WEEK,status) == UCAL_SUNDAY) in test4070502()
506 CalendarRegressionTest::getAssociatedDate(UDate d, UErrorCode& status) in getAssociatedDate() argument
508 GregorianCalendar *cal = new GregorianCalendar(status); in getAssociatedDate()
509 cal->setTime(d,status); in getAssociatedDate()
513 int32_t wd = cal->get(UCAL_DAY_OF_WEEK, status); in getAssociatedDate()
515 cal->add(UCAL_DATE, 1, status); in getAssociatedDate()
522 UDate dd = cal->getTime(status); in getAssociatedDate()
538 UErrorCode status = U_ZERO_ERROR; in dowTest() local
539 GregorianCalendar *cal = new GregorianCalendar(status); in dowTest()
540 if(U_FAILURE(status)) { in dowTest()
541 dataerrln("Error creating Calendar: %s", u_errorName(status)); in dowTest()
549 int32_t dow = cal->get(UCAL_DAY_OF_WEEK, status); in dowTest()
560 if(U_FAILURE(status)) { in dowTest()
561 errln("Error checking Calendar: %s", u_errorName(status)); in dowTest()
566 if(cal->getActualMinimum(UCAL_DAY_OF_WEEK, status) != min) { in dowTest()
569 if(cal->getActualMinimum(Calendar::DAY_OF_WEEK, status) != min) { in dowTest()
575 if(((Calendar*)cal)->getActualMinimum(UCAL_DAY_OF_WEEK, status) != min) { in dowTest()
582 if(U_FAILURE(status)) { in dowTest()
583 errln("Error getting actual minimum: %s", u_errorName(status)); in dowTest()
595 UErrorCode status = U_ZERO_ERROR; in test4071385() local
596 Calendar *cal = Calendar::createInstance(status); in test4071385()
597 if(U_FAILURE(status)) { in test4071385()
598 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4071385()
602 cal->setTime(makeDate(1998, UCAL_JUNE, 24),status); in test4071385()
605 if (cal->getTime(status) != makeDate(1998, UCAL_NOVEMBER, 24)) in test4071385()
616 UErrorCode status = U_ZERO_ERROR; in test4073929() local
617 GregorianCalendar *foo1 = new GregorianCalendar(1997, 8, 27,status); in test4073929()
618 if(U_FAILURE(status)) { in test4073929()
619 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4073929()
623 logln("foo1@%.0f - %d-%d-%d %d:%d:%d.%ds\n", foo1->getTime(status), in test4073929()
624 foo1->get(UCAL_YEAR, status), in test4073929()
625 foo1->get(UCAL_MONTH, status), in test4073929()
626 foo1->get(UCAL_DATE, status), in test4073929()
627 foo1->get(UCAL_HOUR, status), in test4073929()
628 foo1->get(UCAL_MINUTE, status), in test4073929()
629 foo1->get(UCAL_SECOND, status), in test4073929()
630 foo1->get(UCAL_MILLISECOND,status)); in test4073929()
631 foo1->add(UCAL_DATE, + 1, status); in test4073929()
632 logln("foo1@%.0f - %d-%d-%d %d:%d:%d.%ds after +\n", foo1->getTime(status), in test4073929()
633 foo1->get(UCAL_YEAR, status), in test4073929()
634 foo1->get(UCAL_MONTH, status), in test4073929()
635 foo1->get(UCAL_DATE, status), in test4073929()
636 foo1->get(UCAL_HOUR, status), in test4073929()
637 foo1->get(UCAL_MINUTE, status), in test4073929()
638 foo1->get(UCAL_SECOND, status), in test4073929()
639 foo1->get(UCAL_MILLISECOND ,status)); in test4073929()
640 foo1->add(UCAL_DATE, - 1, status); in test4073929()
641 logln("foo1@%.0f - %d-%d-%d %d:%d:%d.%ds after -\n", foo1->getTime(status), in test4073929()
642 foo1->get(UCAL_YEAR, status), in test4073929()
643 foo1->get(UCAL_MONTH, status), in test4073929()
644 foo1->get(UCAL_DATE, status), in test4073929()
645 foo1->get(UCAL_HOUR, status), in test4073929()
646 foo1->get(UCAL_MINUTE, status), in test4073929()
647 foo1->get(UCAL_SECOND, status), in test4073929()
648 foo1->get(UCAL_MILLISECOND, status)); in test4073929()
650 foo1->add(UCAL_DATE, + 1, status); in test4073929()
651 int32_t testyear = foo1->get(UCAL_YEAR, status); in test4073929()
652 int32_t testmonth = foo1->get(UCAL_MONTH, status); in test4073929()
653 int32_t testday = foo1->get(UCAL_DATE, status); in test4073929()
667 UErrorCode status = U_ZERO_ERROR; in test4083167() local
673 Calendar *cal = new GregorianCalendar(status); in test4083167()
674 if(U_FAILURE(status)) { in test4083167()
675 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4083167()
679 cal->setTime(firstDate,status); in test4083167()
680 int32_t hr = cal->get(UCAL_HOUR_OF_DAY, status); in test4083167()
681 int32_t min = cal->get(UCAL_MINUTE, status); in test4083167()
682 int32_t sec = cal->get(UCAL_SECOND, status); in test4083167()
683 int32_t msec = cal->get(UCAL_MILLISECOND, status); in test4083167()
690 cal->setTime(lastDate, status); in test4083167()
691 hr = cal->get(UCAL_HOUR_OF_DAY, status); in test4083167()
692 min = cal->get(UCAL_MINUTE, status); in test4083167()
693 sec = cal->get(UCAL_SECOND, status); in test4083167()
694 msec = cal->get(UCAL_MILLISECOND, status); in test4083167()
714 UErrorCode status = U_ZERO_ERROR; in test4086724() local
719 Locale::setDefault(Locale::getUK(),status); in test4086724()
722 date = new SimpleDateFormat(UnicodeString("dd MMM yyy (zzzz) 'is in week' ww"),status); in test4086724()
723 Calendar *cal = Calendar::createInstance(status); in test4086724()
724 if(U_FAILURE(status)) { in test4086724()
725 dataerrln("Error creating Calendar: %s", u_errorName(status)); in test4086724()
732 UDate now = cal->getTime(status); in test4086724()
737 now=cal->getTime(status); in test4086724()
740 now=cal->getTime(status); in test4086724()
743 now=cal->getTime(status); in test4086724()
747 Locale::setDefault(saveLocale,status); in test4086724()
762 UErrorCode status = U_ZERO_ERROR; in test4092362() local
763 GregorianCalendar *cal1 = new GregorianCalendar(1997, 10, 11, 10, 20, 40,status); in test4092362()
764 if (U_FAILURE(status)) { in test4092362()
765 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4092362()
776 logln( UnicodeString(" Cal1 = ") + cal1->getTime(status) ); in test4092362()
777 logln( UnicodeString(" Cal1 time in ms = ") + cal1->get(UCAL_MILLISECOND,status) ); in test4092362()
781 GregorianCalendar *cal2 = new GregorianCalendar(1997, 10, 11, 10, 20, 40,status); in test4092362()
789 logln( UnicodeString(" Cal2 = ") + cal2->getTime(status) ); in test4092362()
790 logln( UnicodeString(" Cal2 time in ms = ") + cal2->get(UCAL_MILLISECOND,status) ); in test4092362()
803 UErrorCode status = U_ZERO_ERROR; in test4095407() local
804 GregorianCalendar *a = new GregorianCalendar(1997,UCAL_NOVEMBER, 13,status); in test4095407()
805 if (U_FAILURE(status)) { in test4095407()
806 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4095407()
810 int32_t dow = a->get(UCAL_DAY_OF_WEEK, status); in test4095407()
822 UErrorCode status = U_ZERO_ERROR; in test4096231() local
827 Calendar *cal1 = new GregorianCalendar(*PST,status); in test4096231()
828 if (U_FAILURE(status)) { in test4096231()
829 dataerrln("Failure new GregorianCalendar: %s", u_errorName(status)); in test4096231()
835 cal1->setTime(880698639000.0,status); in test4096231()
841 logln(UnicodeString("PST 1 is: ") + (h1=cal1->get(UCAL_HOUR_OF_DAY, status))); in test4096231()
843 logln(UnicodeString("GMT 2 is: ") + (h2=cal1->get(UCAL_HOUR_OF_DAY, status))); in test4096231()
847 Calendar *cal2 = new GregorianCalendar(*GMT,status); in test4096231()
848 Calendar *cal3 = new GregorianCalendar(*PST,status); in test4096231()
852 cal2->set(cal1->get(UCAL_YEAR,status), in test4096231()
853 cal1->get(UCAL_MONTH,status), in test4096231()
854 cal1->get(UCAL_DATE,status), in test4096231()
855 cal1->get(UCAL_HOUR_OF_DAY,status), in test4096231()
856 cal1->get(UCAL_MINUTE,status), in test4096231()
857 cal1->get(UCAL_SECOND,status)); in test4096231()
860 logln(UnicodeString("RGMT 1 is: ") + (t1=cal2->getTime(status))); in test4096231()
862 logln(UnicodeString("RPST 1 is: ") + (t2=cal3->getTime(status))); in test4096231()
864 logln(UnicodeString("RGMT 2 is: ") + (t3=cal3->getTime(status))); in test4096231()
865 cal3->set(cal1->get(UCAL_YEAR,status), in test4096231()
866 cal1->get(UCAL_MONTH,status), in test4096231()
867 cal1->get(UCAL_DATE,status), in test4096231()
868 cal1->get(UCAL_HOUR_OF_DAY,status), in test4096231()
869 cal1->get(UCAL_MINUTE,status), in test4096231()
870 cal1->get(UCAL_SECOND,status)); in test4096231()
874 logln(UnicodeString("RGMT 3 is: ") + (t4=cal3->getTime(status))); in test4096231()
892 UErrorCode status = U_ZERO_ERROR; in test4096539() local
897 GregorianCalendar(1997,x,y[x], status); in test4096539()
898 if (U_FAILURE(status)) { in test4096539()
899 dataerrln("Fail new GregorianCalendar: %s", u_errorName(status)); in test4096539()
904 log(UnicodeString("") + (m1=gc->get(UCAL_MONTH,status)+1)+UnicodeString("/")+ in test4096539()
905 gc->get(UCAL_DATE,status)+"/"+gc->get(UCAL_YEAR,status)+ in test4096539()
908 gc->add(UCAL_MONTH, 1,status); in test4096539()
909 logln(UnicodeString("") + (m2=gc->get(UCAL_MONTH,status)+1)+UnicodeString("/")+ in test4096539()
910 gc->get(UCAL_DATE,status)+"/"+gc->get(UCAL_YEAR,status) in test4096539()
925 UErrorCode status = U_ZERO_ERROR; in test41003112() local
926 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in test41003112()
927 if(U_FAILURE(status)) { in test41003112()
928 dataerrln("Error creating calendar: %s", u_errorName(status)); in test41003112()
936 if (cal->get(UCAL_DAY_OF_YEAR, status) != 1) in test41003112()
946 UErrorCode status = U_ZERO_ERROR; in test4103271() local
947 SimpleDateFormat sdf(status); in test4103271()
950 GregorianCalendar *testCal = (GregorianCalendar*)Calendar::createInstance(status); in test4103271()
951 if(U_FAILURE(status)) { in test4103271()
952 dataerrln("Error creating calendar: %s", u_errorName(status)); in test4103271()
972 testCal->add(UCAL_DATE,1,status); in test4103271()
974 int32_t actWOY = testCal->get(UCAL_WEEK_OF_YEAR,status); in test4103271()
976 UDate d = testCal->getTime(status); in test4103271()
1005 int32_t woy = testCal->get(UCAL_WEEK_OF_YEAR,status); in test4103271()
1007 log(UnicodeString("") + sdf.format(testCal->getTime(status), str) + in test4103271()
1017 UDate save = testCal->getTime(status); in test4103271()
1022 if (testCal->getTime(status) != save) { in test4103271()
1025 sdf.format(testCal->getTime(status), str)); in test4103271()
1029 testCal->setTime(save,status); in test4103271()
1030 testCal->add(UCAL_DATE, 1,status); in test4103271()
1086 UDate got = testCal->getTime(status); in test4103271()
1095 testCal->setTime(exp, status); in test4103271()
1105 got = testCal->getTime(status); in test4103271()
1147 testCal->setTime(before,status); in test4103271()
1149 testCal->add(UCAL_WEEK_OF_YEAR, amount,status); in test4103271()
1151 testCal->roll(UCAL_WEEK_OF_YEAR, amount,status); in test4103271()
1152 UDate got = testCal->getTime(status); in test4103271()
1170 testCal->setTime(after,status); in test4103271()
1172 testCal->add(UCAL_WEEK_OF_YEAR, -amount,status); in test4103271()
1174 testCal->roll(UCAL_WEEK_OF_YEAR, -amount,status); in test4103271()
1175 got = testCal->getTime(status); in test4103271()
1196 UErrorCode status = U_ZERO_ERROR; in test4106136() local
1201 Locale::setDefault(locales[i], status); in test4106136()
1202 failure(status, "Locale::setDefault"); in test4106136()
1218 Locale::setDefault(saveLocale,status); in test4106136()
1227 UErrorCode status = U_ZERO_ERROR; in test4108764() local
1228 Calendar *cal = Calendar::createInstance(status); in test4108764()
1229 if(U_FAILURE(status)) { in test4108764()
1230 dataerrln("Error creating calendar %s", u_errorName(status)); in test4108764()
1240 cal->setTime(d11,status); in test4108764()
1243 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1244 if (cal->getTime(status) != d01) in test4108764()
1248 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1249 if (cal->getTime(status) != d00) in test4108764()
1252 cal->setTime(d11,status); in test4108764()
1254 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1255 if (cal->getTime(status) != d10) in test4108764()
1259 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1260 if (cal->getTime(status) != d00) in test4108764()
1264 logln(UnicodeString("") + cal->getTime(status)); in test4108764()
1265 if (cal->getTime(status) != epoch) in test4108764()
1276 UErrorCode status = U_ZERO_ERROR; in test4114578() local
1278 Calendar *cal = Calendar::createInstance(status); in test4114578()
1279 if(U_FAILURE(status)) { in test4114578()
1280 dataerrln("Error creating calendar %s", u_errorName(status)); in test4114578()
1311 cal->setTime(date,status); in test4114578()
1316 cal->add(UCAL_HOUR, amt,status); in test4114578()
1320 cal->roll(UCAL_HOUR, amt,status); in test4114578()
1324 log(UnicodeString("") + cal->getTime(status)); in test4114578()
1326 double change = cal->getTime(status) - date; in test4114578()
1345 UErrorCode status = U_ZERO_ERROR; in test4118384() local
1346 Calendar *cal = Calendar::createInstance(status); in test4118384()
1347 if(U_FAILURE(status)) { in test4118384()
1348 dataerrln("Error creating calendar %s", u_errorName(status)); in test4118384()
1354 cal->getActualMaximum(UCAL_HOUR,status) != 11) in test4118384()
1369 cal = Calendar::createInstance(Locale("th_TH@calendar=buddhist"),status); in test4118384()
1383 cal = Calendar::createInstance(Locale("ja_JP@calendar=japanese"),status); in test4118384()
1403 UErrorCode status = U_ZERO_ERROR; in test4125881() local
1404 GregorianCalendar *cal = (GregorianCalendar*) Calendar::createInstance(status); in test4125881()
1405 if(U_FAILURE(status)) { in test4125881()
1406 dataerrln("Error creating calendar %s", u_errorName(status)); in test4125881()
1410 DateFormat *fmt = new SimpleDateFormat(UnicodeString("MMMM d, yyyy G"),status); in test4125881()
1411 if(!assertSuccess("trying to construct", status))return; in test4125881()
1417 …logln(UnicodeString("") + y + UnicodeString(" = ") + fmt->format(cal->getTime(status), temp) + " "… in test4125881()
1433 UErrorCode status = U_ZERO_ERROR; in test4125892() local
1434 GregorianCalendar *cal = (GregorianCalendar*) Calendar::createInstance(status); in test4125892()
1435 if(U_FAILURE(status)) { in test4125892()
1436 dataerrln("Error creating calendar %s", u_errorName(status)); in test4125892()
1440 DateFormat *fmt = new SimpleDateFormat(UnicodeString("MMMM d, yyyy G"),status); in test4125892()
1441 if(!assertSuccess("trying to construct", status))return; in test4125892()
1447 cal->add(UCAL_DATE, 1,status); in test4125892()
1448 if(U_FAILURE(status)) in test4125892()
1450 if (cal->get(UCAL_DATE,status) != 29 || in test4125892()
1464 UErrorCode status = U_ZERO_ERROR; in test4141665() local
1465 GregorianCalendar *cal = new GregorianCalendar(status); in test4141665()
1466 if(U_FAILURE(status)) { in test4141665()
1467 dataerrln("Error creating calendar %s", u_errorName(status)); in test4141665()
1477 cal2->setGregorianChange(cut2,status); in test4141665()
1493 UErrorCode status = U_ZERO_ERROR; in test4142933() local
1494 GregorianCalendar *calendar = new GregorianCalendar(status); in test4142933()
1495 if(U_FAILURE(status)) { in test4142933()
1496 dataerrln("Error creating calendar %s", u_errorName(status)); in test4142933()
1501 calendar->roll((UCalendarDateFields)-1, TRUE, status); in test4142933()
1502 if(U_SUCCESS(status)) in test4142933()
1527 UErrorCode status = U_ZERO_ERROR; in test4145158() local
1528 GregorianCalendar *calendar = new GregorianCalendar(status); in test4145158()
1529 if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) { in test4145158()
1530 dataerrln("Error creating calendar %s", u_errorName(status)); in test4145158()
1537 calendar->setTime(makeDate(INT32_MIN),status); in test4145158()
1538 int32_t year1 = calendar->get(UCAL_YEAR,status); in test4145158()
1539 int32_t era1 = calendar->get(UCAL_ERA,status); in test4145158()
1541 calendar->setTime(makeDate(INT32_MAX),status); in test4145158()
1542 int32_t year2 = calendar->get(UCAL_YEAR,status); in test4145158()
1543 int32_t era2 = calendar->get(UCAL_ERA,status); in test4145158()
1566 UErrorCode status = U_ZERO_ERROR; in test4145983() local
1567 GregorianCalendar *calendar = new GregorianCalendar(status); in test4145983()
1568 if(U_FAILURE(status)) { in test4145983()
1569 dataerrln("Error creating calendar %s", u_errorName(status)); in test4145983()
1576 calendar->setTime(DATES[i], status); in test4145983()
1577 int32_t year = calendar->get(UCAL_YEAR,status); in test4145983()
1597 UErrorCode status = U_ZERO_ERROR; in test4147269() local
1598 GregorianCalendar *calendar = new GregorianCalendar(status); in test4147269()
1599 if(status == U_USING_FALLBACK_WARNING || U_FAILURE(status)) { in test4147269()
1600 dataerrln("Error creating calendar %s", u_errorName(status)); in test4147269()
1607 calendar->setTime(date,status); in test4147269()
1615 calendar->getTime(status); // Force time computation in test4147269()
1618 if(U_SUCCESS(status)) in test4147269()
1621 ", date after: " + calendar->getTime(status) + in test4147269()
1638 UErrorCode status = U_ZERO_ERROR; in Test4149677() local
1645 if(U_FAILURE(status)) { in Test4149677()
1652 GregorianCalendar *calendar = new GregorianCalendar(zones[i], status); in Test4149677()
1653 if(U_FAILURE(status)) { in Test4149677()
1654 dataerrln("Couldnt' create calendar.: %s", u_errorName(status)); in Test4149677()
1659 calendar->setTime(EARLIEST_SUPPORTED_MILLIS, status); in Test4149677()
1660 if(U_FAILURE(status)) in Test4149677()
1662 if (calendar->get(UCAL_ERA, status) != GregorianCalendar::BC || U_FAILURE(status)) { in Test4149677()
1665 calendar->setTime(LATEST_SUPPORTED_MILLIS, status); in Test4149677()
1666 if(U_FAILURE(status)) in Test4149677()
1668 if (calendar->get(UCAL_ERA, status) != GregorianCalendar::AD || U_FAILURE(status)) { in Test4149677()
1672 calendar->setGregorianChange(LATEST_SUPPORTED_MILLIS, status); in Test4149677()
1673 if(U_FAILURE(status)) in Test4149677()
1698 UErrorCode status = U_ZERO_ERROR; in Test4162587() local
1704 GregorianCalendar *cal = new GregorianCalendar(tz, status); in Test4162587()
1705 if(U_FAILURE(status)) { in Test4162587()
1706 dataerrln("Couldn't create calendar.: %s", u_errorName(status)); in Test4162587()
1716 d0 = cal->getTime(status); in Test4162587()
1717 if(U_FAILURE(status)) in Test4162587()
1724 dPlus = cal->getTime(status); in Test4162587()
1725 if(U_FAILURE(status)) in Test4162587()
1732 dMinus = cal->getTime(status); in Test4162587()
1733 if(U_FAILURE(status)) in Test4162587()
1755 UErrorCode status = U_ZERO_ERROR; in Test4165343() local
1756 GregorianCalendar *calendar = new GregorianCalendar(1996, UCAL_FEBRUARY, 29, status); in Test4165343()
1757 if(U_FAILURE(status)) { in Test4165343()
1758 dataerrln("Couldn't create calendar.: %s", u_errorName(status)); in Test4165343()
1761 UDate start = calendar->getTime(status); in Test4165343()
1762 if(U_FAILURE(status)) in Test4165343()
1765 calendar->add(UCAL_MONTH, 12, status); in Test4165343()
1766 if(U_FAILURE(status)) in Test4165343()
1768 UDate date1 = calendar->getTime(status); in Test4165343()
1769 if(U_FAILURE(status)) in Test4165343()
1772 calendar->setTime(start, status); in Test4165343()
1773 if(U_FAILURE(status)) in Test4165343()
1775 calendar->add(UCAL_YEAR, 1, status); in Test4165343()
1776 if(U_FAILURE(status)) in Test4165343()
1778 UDate date2 = calendar->getTime(status); in Test4165343()
1779 if(U_FAILURE(status)) in Test4165343()
1808 UErrorCode status = U_ZERO_ERROR; in Test4166109() local
1811 GregorianCalendar *calendar = new GregorianCalendar(Locale::getUS(), status); in Test4166109()
1812 if(U_FAILURE(status)) { in Test4166109()
1813 dataerrln("Couldn't create calendar.: %s", u_errorName(status)); in Test4166109()
1818 logln(UnicodeString("Date: ") + calendar->getTime(status)); // 888817448000 in Test4166109()
1820 int32_t firstInMonth = calendar->get(UCAL_DATE, status); in Test4166109()
1821 if(U_FAILURE(status)) in Test4166109()
1826 int32_t returned = calendar->getActualMaximum(field, status); in Test4166109()
1852 UErrorCode status = U_ZERO_ERROR; in Test4167060() local
1855 Locale::getUS(), status); in Test4167060()
1856 if(U_FAILURE(status)) { in Test4167060()
1857 dataerrln("Couldn't create SimpleDateFormat - %s", u_errorName(status)); in Test4167060()
1862 new GregorianCalendar(100, UCAL_NOVEMBER, 1, status), in Test4167060()
1863 new GregorianCalendar(-99 /*100BC*/, UCAL_JANUARY, 1, status), in Test4167060()
1864 new GregorianCalendar(1996, UCAL_FEBRUARY, 29, status), in Test4167060()
1866 if(U_FAILURE(status)) { in Test4167060()
1880 calendar->setGregorianChange(EARLIEST_SUPPORTED_MILLIS, status); in Test4167060()
1883 calendar->setGregorianChange(LATEST_SUPPORTED_MILLIS, status); in Test4167060()
1886 if(U_FAILURE(status)) in Test4167060()
1890 UDate dateBefore = calendar->getTime(status); in Test4167060()
1891 if(U_FAILURE(status)) in Test4167060()
1894 int32_t maxYear = calendar->getActualMaximum(field, status); in Test4167060()
1896 …(UnicodeString("maxYear: ") + maxYear + " for " + format->format(calendar->getTime(status), temp)); in Test4167060()
1905 UDate dateAfter = calendar->getTime(status); in Test4167060()
1906 if(U_FAILURE(status)) in Test4167060()
1908 int32_t newYear = calendar->get(field, status); in Test4167060()
1909 if(U_FAILURE(status)) in Test4167060()
1911 calendar->setTime(dateBefore, status); // restore calendar for next use in Test4167060()
1912 if(U_FAILURE(status)) in Test4167060()
1940 UErrorCode status = U_ZERO_ERROR; in Test4197699() local
1941 GregorianCalendar cal(status); in Test4197699()
1945 Locale::getUS(), status); in Test4197699()
1947 if (U_FAILURE(status)) { in Test4197699()
1948 dataerrln("Couldn't initialize test - %s", u_errorName(status)); in Test4197699()
1965 int32_t actWOY = cal.get(UCAL_WEEK_OF_YEAR, status); in Test4197699()
1967 logln(UnicodeString("Ok: ") + dfmt.format(cal.getTime(status), str.remove())); in Test4197699()
1969 errln(UnicodeString("FAIL: ") + dfmt.format(cal.getTime(status), str.remove()) in Test4197699()
1971 cal.add(UCAL_DATE, -8, status); in Test4197699()
1973 cal.add(UCAL_DATE, 1, status); in Test4197699()
1974 logln(dfmt.format(cal.getTime(status), str.remove())); in Test4197699()
1977 if (U_FAILURE(status)) { in Test4197699()
2004 UErrorCode status = U_ZERO_ERROR; in TestJ81() local
2007 GregorianCalendar cal(TimeZone::createTimeZone("GMT"), Locale::getUS(), status); in TestJ81()
2008 SimpleDateFormat fmt("HH:mm 'w'w 'd'D E d MMM yyyy", Locale::getUS(), status); in TestJ81()
2009 if (U_FAILURE(status)) { in TestJ81()
2010 dataerrln("Error: Cannot create calendar or format - %s", u_errorName(status)); in TestJ81()
2064 int32_t woy = cal.get(UCAL_WEEK_OF_YEAR, status); in TestJ81()
2065 int32_t doy = cal.get(UCAL_DAY_OF_YEAR, status); in TestJ81()
2066 int32_t dow = cal.get(UCAL_DAY_OF_WEEK, status); in TestJ81()
2067 if (U_FAILURE(status)) { in TestJ81()
2074 fmt.format(cal.getTime(status), temp.remove()) + in TestJ81()
2077 status = U_ZERO_ERROR; in TestJ81()
2081 fmt.format(cal.getTime(status), temp.remove())); in TestJ81()
2083 status = U_ZERO_ERROR; in TestJ81()
2090 int32_t dom = cal.get(UCAL_DATE, status); in TestJ81()
2091 if (U_FAILURE(status)) { in TestJ81()
2098 fmt.format(cal.getTime(status), temp.remove()) + in TestJ81()
2101 status = U_ZERO_ERROR; in TestJ81()
2108 dom = cal.get(UCAL_DATE, status); in TestJ81()
2109 if (U_FAILURE(status)) { in TestJ81()
2116 fmt.format(cal.getTime(status), temp.remove()) + in TestJ81()
2118 status = U_ZERO_ERROR; in TestJ81()
2121 status = U_ZERO_ERROR; in TestJ81()
2161 status = U_ZERO_ERROR; in TestJ81()
2167 cal.setTime(date, status); in TestJ81()
2168 if (U_FAILURE(status)) { in TestJ81()
2169 … errln((UnicodeString)"FAIL: setTime returned error code " + u_errorName(status)); in TestJ81()
2173 cal.add(DATA[i].field, amount, status); in TestJ81()
2175 cal.roll(DATA[i].field, amount, status); in TestJ81()
2177 if (U_FAILURE(status)) { in TestJ81()
2180 " returned error code " + u_errorName(status)); in TestJ81()
2183 UDate result = cal.getTime(status); in TestJ81()
2184 if (U_FAILURE(status)) { in TestJ81()
2185 … errln((UnicodeString)"FAIL: getTime returned error code " + u_errorName(status)); in TestJ81()
2395 UErrorCode status = U_ZERO_ERROR; in TestT6745() local
2396 Calendar *cal = Calendar::createInstance(Locale(testLocalePtr->locale), status); in TestT6745()
2397 if ( U_FAILURE(status) ) { in TestT6745()
2398 …L: Calendar::createInstance, locale " + testLocalePtr->locale + ", status " + u_errorName(status)); in TestT6745()
2403 status = U_ZERO_ERROR; in TestT6745()
2405 cal->add( testItemPtr->fieldToChange, testItemPtr->fieldDelta, status ); in TestT6745()
2406 if ( U_FAILURE(status) ) { in TestT6745()
2408 … testItemPtr->fieldToChange + "/" + testItemPtr->fieldDelta + ", status " + u_errorName(status)); in TestT6745()
2412 int32_t year = cal->get(UCAL_YEAR, status); in TestT6745()
2413 int32_t month = cal->get(UCAL_MONTH, status); in TestT6745()
2414 int32_t day = cal->get(UCAL_DATE, status); in TestT6745()
2415 …if ( U_FAILURE(status) || year != endYear || month != testItemPtr->endMonth || day != testItemPtr-… in TestT6745()
2417 … testItemPtr->fieldToChange + "/" + testItemPtr->fieldDelta + ", status " + u_errorName(status) + in TestT6745()
2663 UErrorCode status = U_ZERO_ERROR; in makeDate() local
2664 Calendar *cal = Calendar::createInstance(status); in makeDate()
2675 result = cal->getTime(status); in makeDate()
2684 UErrorCode status = U_ZERO_ERROR; in TestDeprecates() local
2685 Calendar *c1 = Calendar::createInstance("ja_JP@calendar=japanese",status); in TestDeprecates()
2686 Calendar *c2 = Calendar::createInstance("ja_JP_TRADITIONAL",status); in TestDeprecates()
2688 if(!c1 || !c2 || U_FAILURE(status)) { in TestDeprecates()
2689 dataerrln("Couldn't create calendars for roll of HOUR: %s", u_errorName(status)); in TestDeprecates()
2694 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2697 c1->roll(Calendar::HOUR,(int32_t)3,status); in TestDeprecates()
2698 c2->roll(UCAL_HOUR,(int32_t)3,status); in TestDeprecates()
2700 if(U_FAILURE(status)) { in TestDeprecates()
2706 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2707 c1->roll(Calendar::HOUR,(UBool)FALSE,status); in TestDeprecates()
2708 c2->roll(UCAL_HOUR,(UBool)FALSE,status); in TestDeprecates()
2710 if(U_FAILURE(status)) { in TestDeprecates()
2719 status = U_ZERO_ERROR; in TestDeprecates()
2721 c1 = Calendar::createInstance("th_TH_TRADITIONAL",status); in TestDeprecates()
2722 c2 = Calendar::createInstance("th_TH@calendar=buddhist",status); in TestDeprecates()
2724 if(!c1 || !c2 || U_FAILURE(status)) { in TestDeprecates()
2730 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2733 c1->add(Calendar::HOUR,(int32_t)1,status); in TestDeprecates()
2735 if(U_FAILURE(status)) { in TestDeprecates()
2736 errln("Error code when trying to add Calendar::HOUR - %s", u_errorName(status)); in TestDeprecates()
2739 c2->add(UCAL_HOUR,(int32_t)1,status); in TestDeprecates()
2741 if(U_FAILURE(status)) { in TestDeprecates()
2742 errln("Error code when trying to add - UCAL_HOUR %s", u_errorName(status)); in TestDeprecates()
2750 status = U_ZERO_ERROR; in TestDeprecates()
2752 c1 = Calendar::createInstance("es_ES",status); in TestDeprecates()
2753 c2 = Calendar::createInstance("es_ES",status); in TestDeprecates()
2755 if(!c1 || !c2 || U_FAILURE(status)) { in TestDeprecates()
2761 c1->setTime(c2->getTime(status),status); in TestDeprecates()
2764 c1->add(Calendar::YEAR,(int32_t)9,status); in TestDeprecates()
2765 c2->add(UCAL_YEAR,(int32_t)9,status); in TestDeprecates()
2767 if(U_FAILURE(status)) { in TestDeprecates()
2780 UErrorCode status = U_ZERO_ERROR; in TestT8057() local
2781 GregorianCalendar *cal = (GregorianCalendar*)Calendar::createInstance(status); in TestT8057()
2782 if(U_FAILURE(status)) { in TestT8057()
2783 errln("Error creating Calendar: %s", u_errorName(status)); in TestT8057()
2792 UDate t = cal->getTime(status); in TestT8057()
2793 if(U_FAILURE(status)) { in TestT8057()
2801 cal->add(UCAL_YEAR, 1, status); in TestT8057()
2802 t = cal->getTime(status); in TestT8057()
2803 if (U_SUCCESS(status)) { in TestT8057()