Lines Matching refs:status

109     UErrorCode status = U_ZERO_ERROR;  in TestCalendar()  local
133 ucal_getAvailableTZIDs(offset, i, &status); in TestCalendar()
134 if(U_FAILURE(status)){ in TestCalendar()
135 log_err("FAIL: ucal_getAvailableTZIDs returned %s\n", u_errorName(status)); in TestCalendar()
137 log_verbose("%s\n", u_austrcpy(tempMsgBuf, ucal_getAvailableTZIDs(offset, i, &status))); in TestCalendar()
140 ucal_getAvailableTZIDs(offset, i, &status); in TestCalendar()
141 if(status != U_INDEX_OUTOFBOUNDS_ERROR){ in TestCalendar()
142 …err("FAIL:for TZID index >= count Expected INDEX_OUTOFBOUNDS_ERROR Got %s\n", u_errorName(status)); in TestCalendar()
144 status=U_ZERO_ERROR; in TestCalendar()
154 uenum = ucal_openTimeZones(&status); in TestCalendar()
158 uenum = ucal_openCountryTimeZones("US", &status); in TestCalendar()
162 uenum = ucal_openTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL, NULL, NULL, &status); in TestCalendar()
166 … uenum = ucal_openTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL_LOCATION, "CA", NULL, &status); in TestCalendar()
170 … uenum = ucal_openTimeZoneIDEnumeration(UCAL_ZONE_TYPE_ANY, NULL, &offsetMinus5, &status); in TestCalendar()
174 … uenum = ucal_openTimeZoneIDEnumeration(UCAL_ZONE_TYPE_ANY, "US", &offsetMinus5, &status); in TestCalendar()
177 if (U_FAILURE(status)) { in TestCalendar()
178 log_err_status(status, "FAIL: %s failed with %s\n", api, in TestCalendar()
179 u_errorName(status)); in TestCalendar()
183 count = uenum_count(uenum, &status); in TestCalendar()
186 …%s, got %d, expected at least 5 -> %s (Are you missing data?)\n", api, count, u_errorName(status)); in TestCalendar()
188 uenum_reset(uenum, &status); in TestCalendar()
189 if (U_FAILURE(status)){ in TestCalendar()
191 api, u_errorName(status)); in TestCalendar()
194 id = uenum_next(uenum, &len, &status); in TestCalendar()
195 if (U_FAILURE(status)){ in TestCalendar()
197 api, u_errorName(status)); in TestCalendar()
203 id = uenum_next(uenum, &len, &status); in TestCalendar()
213 status = U_ZERO_ERROR; in TestCalendar()
214 i = ucal_getDSTSavings(fgGMTID, &status); in TestCalendar()
215 if (U_FAILURE(status)) { in TestCalendar()
217 u_errorName(status)); in TestCalendar()
221 i = ucal_getDSTSavings(PST, &status); in TestCalendar()
222 if (U_FAILURE(status)) { in TestCalendar()
224 u_errorName(status)); in TestCalendar()
230 status = U_ZERO_ERROR; in TestCalendar()
231 i = ucal_getDefaultTimeZone(zone1, UPRV_LENGTHOF(zone1), &status); in TestCalendar()
232 if (U_FAILURE(status)) { in TestCalendar()
234 u_errorName(status)); in TestCalendar()
236 ucal_setDefaultTimeZone(EUROPE_PARIS, &status); in TestCalendar()
237 if (U_FAILURE(status)) { in TestCalendar()
239 u_errorName(status)); in TestCalendar()
241 i = ucal_getDefaultTimeZone(zone2, UPRV_LENGTHOF(zone2), &status); in TestCalendar()
242 if (U_FAILURE(status)) { in TestCalendar()
244 u_errorName(status)); in TestCalendar()
251 status = U_ZERO_ERROR; in TestCalendar()
252 ucal_setDefaultTimeZone(zone1, &status); in TestCalendar()
256 status = U_ZERO_ERROR; in TestCalendar()
257 tzver = ucal_getTZDataVersion(&status); in TestCalendar()
258 if (U_FAILURE(status)) { in TestCalendar()
259 log_err_status(status, "FAIL: ucal_getTZDataVersion() => %s\n", u_errorName(status)); in TestCalendar()
267 status = U_ZERO_ERROR; in TestCalendar()
269 canonicalID, UPRV_LENGTHOF(canonicalID), &isSystemID, &status); in TestCalendar()
270 if (U_FAILURE(status)) { in TestCalendar()
271 log_data_err("FAIL: error in ucal_getCanonicalTimeZoneID : %s\n", u_errorName(status)); in TestCalendar()
284 status = U_ZERO_ERROR; in TestCalendar()
287 caldef=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestCalendar()
288 if(U_FAILURE(status)){ in TestCalendar()
289 …_data_err("FAIL: error in ucal_open caldef : %s\n - (Are you missing data?)", u_errorName(status)); in TestCalendar()
292 caldef2=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestCalendar()
293 if(U_FAILURE(status)){ in TestCalendar()
294 …_data_err("FAIL: error in ucal_open caldef : %s - (Are you missing data?)\n", u_errorName(status)); in TestCalendar()
297 calfr=ucal_open(tzID, u_strlen(tzID), "fr_FR", UCAL_TRADITIONAL, &status); in TestCalendar()
298 if(U_FAILURE(status)){ in TestCalendar()
299 …g_data_err("FAIL: error in ucal_open calfr : %s - (Are you missing data?)\n", u_errorName(status)); in TestCalendar()
301 calit=ucal_open(tzID, u_strlen(tzID), "it_IT", UCAL_TRADITIONAL, &status); in TestCalendar()
302 if(U_FAILURE(status)) { in TestCalendar()
303 …g_data_err("FAIL: error in ucal_open calit : %s - (Are you missing data?)\n", u_errorName(status)); in TestCalendar()
307 calfrclone = ucal_clone(calfr, &status); in TestCalendar()
308 if(U_FAILURE(status)){ in TestCalendar()
309 …_data_err("FAIL: error in ucal_clone calfr : %s - (Are you missing data?)\n", u_errorName(status)); in TestCalendar()
344 datdef=udat_open(UDAT_FULL,UDAT_FULL ,NULL, NULL, 0,NULL,0,&status); in TestCalendar()
345 if(U_FAILURE(status)){ in TestCalendar()
346 …_err("FAIL: error in creating the dateformat : %s (Are you missing data?)\n", u_errorName(status)); in TestCalendar()
356 …ltlengthneeded=ucal_getTimeZoneDisplayName(caldef, UCAL_DST, "en_US", NULL, resultlength, &status); in TestCalendar()
358 if(status==U_BUFFER_OVERFLOW_ERROR) in TestCalendar()
360 status=U_ZERO_ERROR; in TestCalendar()
363 ucal_getTimeZoneDisplayName(caldef, UCAL_DST, "en_US", result, resultlength, &status); in TestCalendar()
365 if(U_FAILURE(status)) { in TestCalendar()
366 log_err("FAIL: Error in getting the timezone display name : %s\n", u_errorName(status)); in TestCalendar()
370 u_errorName(status), resultlengthneeded); in TestCalendar()
385 ucal_getTimeZoneDisplayName(caldef, UCAL_SHORT_DST, "en_US", result, resultlength, &status); in TestCalendar()
391 ucal_getTimeZoneDisplayName(caldef, UCAL_STANDARD, "en_US", result, resultlength, &status); in TestCalendar()
397 … ucal_getTimeZoneDisplayName(caldef, UCAL_SHORT_STANDARD, "en_US", result, resultlength, &status); in TestCalendar()
449 ucal_setDateTime(caldef, 1999, UCAL_MARCH, 3, 10, 45, 20, &status); in TestCalendar()
450 ucal_inDaylightTime(caldef, &status ); in TestCalendar()
451 if(U_FAILURE(status)) { in TestCalendar()
452 log_err("Error in ucal_inDaylightTime: %s\n", u_errorName(status)); in TestCalendar()
454 if(!ucal_inDaylightTime(caldef, &status)) in TestCalendar()
469 status = U_ZERO_ERROR; in TestCalendar()
470 … caldef = ucal_open(NULL, 0, ucalGetTypeTestPtr->locale, ucalGetTypeTestPtr->calType, &status); in TestCalendar()
471 if ( U_SUCCESS(status) ) { in TestCalendar()
472 const char * calType = ucal_getType(caldef, &status); in TestCalendar()
473 if ( U_SUCCESS(status) && calType != NULL ) { in TestCalendar()
504 UErrorCode status=U_ZERO_ERROR; in TestGetSetDateAPI() local
515 caldef=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestGetSetDateAPI()
516 caldef2=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestGetSetDateAPI()
517 caldef3=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestGetSetDateAPI()
522 datdef=udat_open(UDAT_DEFAULT,UDAT_DEFAULT ,"en_US",fgGMTID,-1,NULL,0, &status); in TestGetSetDateAPI()
523 if(U_FAILURE(status)) in TestGetSetDateAPI()
525 …g_data_err("error in creating the dateformat : %s (Are you missing data?)\n", u_errorName(status)); in TestGetSetDateAPI()
531 d1=ucal_getMillis(caldef, &status); in TestGetSetDateAPI()
532 if(U_FAILURE(status)){ in TestGetSetDateAPI()
533 log_err("Error in getMillis : %s\n", u_errorName(status)); in TestGetSetDateAPI()
538 ucal_setMillis(caldef, d2, &status); in TestGetSetDateAPI()
539 if(U_FAILURE(status)){ in TestGetSetDateAPI()
540 log_err("Error in setMillis : %s\n", u_errorName(status)); in TestGetSetDateAPI()
544 d1=ucal_getMillis(caldef, &status); in TestGetSetDateAPI()
559 ucal_setMillis(caldef3, testMillis, &status); in TestGetSetDateAPI()
560 if(U_FAILURE(status)){ in TestGetSetDateAPI()
561 …tly detected invalid value : for millis : %e : returned : %s\n", testMillis, u_errorName(status)); in TestGetSetDateAPI()
562 status = U_ZERO_ERROR; in TestGetSetDateAPI()
569 ucal_setMillis(caldef3, testMillis, &status); in TestGetSetDateAPI()
570 if(U_FAILURE(status)){ in TestGetSetDateAPI()
571 …tly detected invalid value : for millis : %e : returned : %s\n", testMillis, u_errorName(status)); in TestGetSetDateAPI()
572 status = U_ZERO_ERROR; in TestGetSetDateAPI()
574 dateBit = ucal_get(caldef2, UCAL_MILLISECOND, &status); in TestGetSetDateAPI()
587 ucal_setMillis(caldef3, testMillis, &status); in TestGetSetDateAPI()
588 if(U_FAILURE(status)){ in TestGetSetDateAPI()
589 …argument error as expected : for millis : %e : returned : %s\n", testMillis, u_errorName(status)); in TestGetSetDateAPI()
590 status = U_ZERO_ERROR; in TestGetSetDateAPI()
592 dateBit = ucal_get(caldef3, UCAL_DAY_OF_MONTH, &status); in TestGetSetDateAPI()
598 ctest_setTimeZone(NULL, &status); in TestGetSetDateAPI()
602 idLen = ucal_getTimeZoneID(caldef2, id, UPRV_LENGTHOF(id), &status); in TestGetSetDateAPI()
604 if (U_FAILURE(status)) { in TestGetSetDateAPI()
605 log_err("Error in getTimeZoneID : %s\n", u_errorName(status)); in TestGetSetDateAPI()
612 ucal_setMillis(caldef2, d2, &status); in TestGetSetDateAPI()
613 if(U_FAILURE(status)){ in TestGetSetDateAPI()
614 log_err("Error in getMillis : %s\n", u_errorName(status)); in TestGetSetDateAPI()
616 hour=ucal_get(caldef2, UCAL_HOUR_OF_DAY, &status); in TestGetSetDateAPI()
619 ucal_setTimeZone(caldef2,tzID, 3, &status); in TestGetSetDateAPI()
620 if(U_FAILURE(status)){ in TestGetSetDateAPI()
621 … log_err("Error in setting the time zone using ucal_setTimeZone(): %s\n", u_errorName(status)); in TestGetSetDateAPI()
626 idLen = ucal_getTimeZoneID(caldef2, id, UPRV_LENGTHOF(id), &status); in TestGetSetDateAPI()
627 if (U_FAILURE(status)) { in TestGetSetDateAPI()
628 log_err("Error in getTimeZoneID : %s\n", u_errorName(status)); in TestGetSetDateAPI()
635 if(hour == ucal_get(caldef2, UCAL_HOUR_OF_DAY, &status)) in TestGetSetDateAPI()
637 …else if((hour-8 + 1) != ucal_get(caldef2, UCAL_HOUR_OF_DAY, &status)) /*because it is not in dayli… in TestGetSetDateAPI()
645 ucal_setTimeZone(caldef2, tzID, 3, &status); in TestGetSetDateAPI()
646 if(U_FAILURE(status)){ in TestGetSetDateAPI()
647 … log_err("Error in setting the time zone using ucal_setTimeZone(): %s\n", u_errorName(status)); in TestGetSetDateAPI()
649 if(d2==ucal_getMillis(caldef2, &status)) in TestGetSetDateAPI()
654 zoneOffset = ucal_get(caldef2, UCAL_ZONE_OFFSET, &status); in TestGetSetDateAPI()
655 if(U_FAILURE(status)){ in TestGetSetDateAPI()
656 …getting the time zone using ucal_get() after using ucal_setTimeZone(): %s\n", u_errorName(status)); in TestGetSetDateAPI()
662 ucal_setTimeZone(caldef2, NULL, -1, &status); in TestGetSetDateAPI()
663 if(U_FAILURE(status)){ in TestGetSetDateAPI()
664 … log_err("Error in setting the time zone using ucal_setTimeZone(): %s\n", u_errorName(status)); in TestGetSetDateAPI()
666 if(ucal_getMillis(caldef2, &status)) in TestGetSetDateAPI()
671 zoneOffset = ucal_get(caldef2, UCAL_ZONE_OFFSET, &status); in TestGetSetDateAPI()
672 if(U_FAILURE(status)){ in TestGetSetDateAPI()
673 …getting the time zone using ucal_get() after using ucal_setTimeZone(): %s\n", u_errorName(status)); in TestGetSetDateAPI()
688 ucal_setDate(caldef,1971, UCAL_DECEMBER, 17, &status); in TestGetSetDateAPI()
689 if(U_FAILURE(status)){ in TestGetSetDateAPI()
690 log_err("error in setting the calendar date : %s\n", u_errorName(status)); in TestGetSetDateAPI()
693 d1=ucal_getMillis(caldef, &status); in TestGetSetDateAPI()
702 ucal_setDate(caldef, 1999, UCAL_JANUARY, 10, &status); in TestGetSetDateAPI()
704 ucal_setDate(caldef, 1999, UCAL_DECEMBER, 3, &status); in TestGetSetDateAPI()
706 ucal_setDate(caldef, 2000, UCAL_MAY, 3, &status); in TestGetSetDateAPI()
708 ucal_setDate(caldef, 1999, UCAL_AUGUST, 32, &status); in TestGetSetDateAPI()
710 ucal_setDate(caldef, 1999, UCAL_MARCH, 0, &status); in TestGetSetDateAPI()
712 ucal_setDate(caldef, 0, UCAL_MARCH, 12, &status); in TestGetSetDateAPI()
719 ucal_setDateTime(caldef,1972, UCAL_MAY, 3, 16, 30, 42, &status); in TestGetSetDateAPI()
720 if(U_FAILURE(status)){ in TestGetSetDateAPI()
721 log_err("error in setting the calendar date : %s\n", u_errorName(status)); in TestGetSetDateAPI()
724 d1=ucal_getMillis(caldef, &status); in TestGetSetDateAPI()
734 ucal_setDateTime(caldef, 1999, UCAL_OCTOBER, 10, 6, 45, 30, &status); in TestGetSetDateAPI()
736 ucal_setDateTime(caldef, 1999, UCAL_MARCH, 3, 15, 10, 55, &status); in TestGetSetDateAPI()
738 ucal_setDateTime(caldef, 1999, UCAL_MAY, 3, 25, 30, 45, &status); in TestGetSetDateAPI()
740 ucal_setDateTime(caldef, 1999, UCAL_AUGUST, 32, 22, 65, 40, &status); in TestGetSetDateAPI()
742 ucal_setDateTime(caldef, 1999, UCAL_MARCH, 12, 0, 0, 0,&status); in TestGetSetDateAPI()
744 ucal_setDateTime(caldef, 1999, UCAL_MARCH, 12, -10, -10,0, &status); in TestGetSetDateAPI()
766 UErrorCode status=U_ZERO_ERROR; in TestFieldGetSet() local
771 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestFieldGetSet()
772 if (U_FAILURE(status)) { in TestFieldGetSet()
773 log_data_err("ucal_open failed: %s - (Are you missing data?)\n", u_errorName(status)); in TestFieldGetSet()
776 datdef=udat_open(UDAT_SHORT,UDAT_SHORT ,NULL,fgGMTID,-1,NULL, 0, &status); in TestFieldGetSet()
777 if(U_FAILURE(status)) in TestFieldGetSet()
779 …g_data_err("error in creating the dateformat : %s (Are you missing data?)\n", u_errorName(status)); in TestFieldGetSet()
784 ucal_setDateTime(cal, 1999, UCAL_MARCH, 12, 5, 25, 30, &status); in TestFieldGetSet()
785 if(U_FAILURE(status)){ in TestFieldGetSet()
786 … log_data_err("error in the setDateTime() : %s (Are you missing data?)\n", u_errorName(status)); in TestFieldGetSet()
788 if(ucal_get(cal, UCAL_YEAR, &status)!=1999 || ucal_get(cal, UCAL_MONTH, &status)!=2 || in TestFieldGetSet()
789 ucal_get(cal, UCAL_DATE, &status)!=12 || ucal_get(cal, UCAL_HOUR, &status)!=5) in TestFieldGetSet()
790 … log_data_err("error in ucal_get() -> %s (Are you missing data?)\n", u_errorName(status)); in TestFieldGetSet()
791 …else if(ucal_get(cal, UCAL_DAY_OF_WEEK_IN_MONTH, &status)!=2 || ucal_get(cal, UCAL_DAY_OF_WEEK, &s… in TestFieldGetSet()
792 …|| ucal_get(cal, UCAL_WEEK_OF_MONTH, &status)!=2 || ucal_get(cal, UCAL_WEEK_OF_YEAR, &status)!= 11) in TestFieldGetSet()
818 status = U_ZERO_ERROR; in TestFieldGetSet()
824 d1 = ucal_getMillis(cal, &status); in TestFieldGetSet()
825 if (status != U_ILLEGAL_ARGUMENT_ERROR) { in TestFieldGetSet()
830 status = U_ZERO_ERROR; in TestFieldGetSet()
843 status = U_ZERO_ERROR; in TestFieldGetSet()
850 d1 = ucal_getMillis(cal,&status); in TestFieldGetSet()
851 if (status != U_ILLEGAL_ARGUMENT_ERROR){ in TestFieldGetSet()
856 status = U_ZERO_ERROR; in TestFieldGetSet()
872 d1 = ucal_getMillis(cal,&status); in TestFieldGetSet()
873 if (status != U_ILLEGAL_ARGUMENT_ERROR){ in TestFieldGetSet()
929 UErrorCode status = U_ZERO_ERROR; in TestAddRollExtensive() local
936 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_GREGORIAN, &status);; in TestAddRollExtensive()
937 if (U_FAILURE(status)) { in TestAddRollExtensive()
938 log_data_err("ucal_open() failed : %s - (Are you missing data?)\n", u_errorName(status)); in TestAddRollExtensive()
950 ucal_add(cal,UCAL_YEAR, 1, &status); in TestAddRollExtensive()
951 if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", u_errorName(status)); return; } in TestAddRollExtensive()
954 ucal_add(cal,UCAL_MONTH, 12, &status); in TestAddRollExtensive()
955 if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
958 ucal_add(cal,UCAL_DATE, 1, &status); in TestAddRollExtensive()
959 if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
962 ucal_add(cal,UCAL_DATE, 2, &status); in TestAddRollExtensive()
963 if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
966 ucal_add(cal,UCAL_DATE, 28, &status); in TestAddRollExtensive()
967 if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
970 ucal_add(cal, (UCalendarDateFields)-1, 10, &status); in TestAddRollExtensive()
971 if(status==U_ILLEGAL_ARGUMENT_ERROR) in TestAddRollExtensive()
974 log_err("Fail: No, illegal argument error as expected. Got....: %s\n", u_errorName(status)); in TestAddRollExtensive()
976 status=U_ZERO_ERROR; in TestAddRollExtensive()
981 ucal_roll(cal, UCAL_DATE, -1, &status); in TestAddRollExtensive()
982 if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
985 ucal_roll(cal, UCAL_MONTH, -2, &status); in TestAddRollExtensive()
986 if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
989 ucal_roll(cal, UCAL_DATE, 1, &status); in TestAddRollExtensive()
990 if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
993 ucal_roll(cal, UCAL_MONTH, -12, &status); in TestAddRollExtensive()
994 if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
996 ucal_roll(cal, UCAL_YEAR, -1, &status); in TestAddRollExtensive()
997 if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
1000 ucal_roll(cal, UCAL_DATE, 29, &status); in TestAddRollExtensive()
1001 if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", u_errorName(status) ); return; } in TestAddRollExtensive()
1004 ucal_roll(cal, (UCalendarDateFields)-1, 10, &status); in TestAddRollExtensive()
1005 if(status==U_ILLEGAL_ARGUMENT_ERROR) in TestAddRollExtensive()
1008 log_err("Fail: no illegal argument error got..: %s\n", u_errorName(status)); in TestAddRollExtensive()
1011 status=U_ZERO_ERROR; in TestAddRollExtensive()
1013 ucal_setDateTime(cal, 1999, UCAL_FEBRUARY, 28, 10, 30, 45, &status); in TestAddRollExtensive()
1014 if(U_FAILURE(status)){ in TestAddRollExtensive()
1015 log_err("error is setting the datetime: %s\n", u_errorName(status)); in TestAddRollExtensive()
1017 ucal_add(cal, UCAL_MONTH, 1, &status); in TestAddRollExtensive()
1019 ucal_add(cal, UCAL_MILLISECOND, 1000, &status); in TestAddRollExtensive()
1024 status=U_ZERO_ERROR; in TestAddRollExtensive()
1028 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); in TestAddRollExtensive()
1029 if (U_FAILURE(status)) { in TestAddRollExtensive()
1030 log_err("ucal_open failed: %s\n", u_errorName(status)); in TestAddRollExtensive()
1041 status=U_ZERO_ERROR; in TestAddRollExtensive()
1046 status = U_ZERO_ERROR; in TestAddRollExtensive()
1048 ucal_add(cal, e, 1, &status); in TestAddRollExtensive()
1049 if (U_FAILURE(status)) { limit = i; status = U_ZERO_ERROR; } in TestAddRollExtensive()
1052 ucal_add(cal, e, -1, &status); in TestAddRollExtensive()
1053 if (U_FAILURE(status)) { in TestAddRollExtensive()
1054 log_err("ucal_add -1 failed: %s\n", u_errorName(status)); in TestAddRollExtensive()
1063 status = U_ZERO_ERROR; in TestAddRollExtensive()
1065 ucal_roll(cal, e, 1, &status); in TestAddRollExtensive()
1066 if (U_FAILURE(status)) { in TestAddRollExtensive()
1068 status = U_ZERO_ERROR; in TestAddRollExtensive()
1072 ucal_roll(cal, e, -1, &status); in TestAddRollExtensive()
1073 if (U_FAILURE(status)) { in TestAddRollExtensive()
1074 log_err("ucal_roll -1 failed: %s\n", u_errorName(status)); in TestAddRollExtensive()
1085 status=U_ZERO_ERROR; in TestAddRollExtensive()
1087 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_GREGORIAN, &status); in TestAddRollExtensive()
1088 if (U_FAILURE(status)) { in TestAddRollExtensive()
1089 log_err("ucal_open failed for zone %s: %s\n", itemPtr->zone, u_errorName(status)); in TestAddRollExtensive()
1092 … ucal_setDateTime(cal, itemPtr->year, itemPtr->month, itemPtr->day, itemPtr->hour, 0, 0, &status); in TestAddRollExtensive()
1093 ucal_add(cal, UCAL_DATE, 1, &status); in TestAddRollExtensive()
1094 hr = ucal_get(cal, UCAL_HOUR_OF_DAY, &status); in TestAddRollExtensive()
1095 if ( U_FAILURE(status) ) { in TestAddRollExtensive()
1096 …al_add failed adding day across transition for zone %s: %s\n", itemPtr->zone, u_errorName(status)); in TestAddRollExtensive()
1100 ucal_add(cal, UCAL_DATE, -1, &status); in TestAddRollExtensive()
1101 hr = ucal_get(cal, UCAL_HOUR_OF_DAY, &status); in TestAddRollExtensive()
1102 if ( U_FAILURE(status) ) { in TestAddRollExtensive()
1103 …d failed subtracting day across transition for zone %s: %s\n", itemPtr->zone, u_errorName(status)); in TestAddRollExtensive()
1119 UErrorCode status = U_ZERO_ERROR; in TestGetLimits() local
1124 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_GREGORIAN, &status);; in TestGetLimits()
1125 if (U_FAILURE(status)) { in TestGetLimits()
1126 … gregorian calendar failed in TestGetLimits: %s - (Are you missing data?)\n", u_errorName(status)); in TestGetLimits()
1134 ucal_setDate(cal, 1999, UCAL_MARCH, 5, &status); /* Set the date to be March 5, 1999 */ in TestGetLimits()
1135 val = ucal_get(cal, UCAL_DAY_OF_WEEK, &status); in TestGetLimits()
1136 min = ucal_getLimit(cal, UCAL_DAY_OF_WEEK, UCAL_MINIMUM, &status); in TestGetLimits()
1137 max = ucal_getLimit(cal, UCAL_DAY_OF_WEEK, UCAL_MAXIMUM, &status); in TestGetLimits()
1146 val = ucal_get(cal, UCAL_DAY_OF_WEEK_IN_MONTH, &status); in TestGetLimits()
1147 min = ucal_getLimit(cal, UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_MINIMUM, &status); in TestGetLimits()
1148 max = ucal_getLimit(cal, UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_MAXIMUM, &status); in TestGetLimits()
1158 min=ucal_getLimit(cal, UCAL_MONTH, UCAL_MINIMUM, &status); in TestGetLimits()
1159 max=ucal_getLimit(cal, UCAL_MONTH, UCAL_MAXIMUM, &status); in TestGetLimits()
1160 gr_min=ucal_getLimit(cal, UCAL_MONTH, UCAL_GREATEST_MINIMUM, &status); in TestGetLimits()
1161 le_max=ucal_getLimit(cal, UCAL_MONTH, UCAL_LEAST_MAXIMUM, &status); in TestGetLimits()
1162 ac_min=ucal_getLimit(cal, UCAL_MONTH, UCAL_ACTUAL_MINIMUM, &status); in TestGetLimits()
1163 ac_max=ucal_getLimit(cal, UCAL_MONTH, UCAL_ACTUAL_MAXIMUM, &status); in TestGetLimits()
1164 if(U_FAILURE(status)){ in TestGetLimits()
1165 log_err("Error in getLimits: %s\n", u_errorName(status)); in TestGetLimits()
1172 ucal_setDateTime(cal, 1999, UCAL_MARCH, 5, 4, 10, 35, &status); in TestGetLimits()
1173 val=ucal_get(cal, UCAL_HOUR_OF_DAY, &status); in TestGetLimits()
1174 min=ucal_getLimit(cal, UCAL_HOUR_OF_DAY, UCAL_MINIMUM, &status); in TestGetLimits()
1175 max=ucal_getLimit(cal, UCAL_HOUR_OF_DAY, UCAL_MAXIMUM, &status); in TestGetLimits()
1176 gr_min=ucal_getLimit(cal, UCAL_MINUTE, UCAL_GREATEST_MINIMUM, &status); in TestGetLimits()
1177 le_max=ucal_getLimit(cal, UCAL_MINUTE, UCAL_LEAST_MAXIMUM, &status); in TestGetLimits()
1178 ac_min=ucal_getLimit(cal, UCAL_MINUTE, UCAL_ACTUAL_MINIMUM, &status); in TestGetLimits()
1179 ac_max=ucal_getLimit(cal, UCAL_SECOND, UCAL_ACTUAL_MAXIMUM, &status); in TestGetLimits()
1192 val=ucal_getLimit(cal, UCAL_SECOND, (UCalendarLimitType)99, &status); in TestGetLimits()
1196 status=U_ZERO_ERROR; in TestGetLimits()
1217 UErrorCode status = U_ZERO_ERROR; in TestDOWProgression() local
1222 cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status);; in TestDOWProgression()
1223 if (U_FAILURE(status)) { in TestDOWProgression()
1224 log_data_err("ucal_open failed: %s - (Are you missing data?)\n", u_errorName(status)); in TestDOWProgression()
1228 datfor=udat_open(UDAT_MEDIUM,UDAT_MEDIUM ,NULL, fgGMTID,-1,NULL, 0, &status); in TestDOWProgression()
1229 if(U_FAILURE(status)){ in TestDOWProgression()
1230 …g_data_err("error in creating the dateformat : %s (Are you missing data?)\n", u_errorName(status)); in TestDOWProgression()
1234 ucal_setDate(cal, 1999, UCAL_JANUARY, 1, &status); in TestDOWProgression()
1238 initialDOW = ucal_get(cal, UCAL_DAY_OF_WEEK, &status); in TestDOWProgression()
1239 …if (U_FAILURE(status)) { log_data_err("ucal_get() failed: %s (Are you missing data?)\n", u_errorNa… in TestDOWProgression()
1244 date1=ucal_getMillis(cal, &status); in TestDOWProgression()
1245 … if(U_FAILURE(status)){ log_err("ucal_getMiilis() failed: %s\n", u_errorName(status)); return;} in TestDOWProgression()
1248 ucal_add(cal,UCAL_DAY_OF_WEEK, delta, &status); in TestDOWProgression()
1249 if (U_FAILURE(status)) { log_err("ucal_add() failed: %s\n", u_errorName(status)); return; } in TestDOWProgression()
1251 newDOW = ucal_get(cal, UCAL_DAY_OF_WEEK, &status); in TestDOWProgression()
1252 if (U_FAILURE(status)) { log_err("ucal_get() failed: %s\n", u_errorName(status)); return; } in TestDOWProgression()
1254 date1=ucal_getMillis(cal, &status); in TestDOWProgression()
1255 … if(U_FAILURE(status)){ log_err("ucal_getMiilis() failed: %s\n", u_errorName(status)); return;} in TestDOWProgression()
1290 UErrorCode status = U_ZERO_ERROR; in testZones() local
1295 gmtcal=ucal_open(tzID, 3, "en_US", UCAL_TRADITIONAL, &status);; in testZones()
1296 if (U_FAILURE(status)) { in testZones()
1297 log_data_err("ucal_open failed: %s - (Are you missing data?)\n", u_errorName(status)); in testZones()
1301 cal = ucal_open(tzID, 3, "en_US", UCAL_TRADITIONAL, &status); in testZones()
1302 if (U_FAILURE(status)) { in testZones()
1303 log_err("ucal_open failed: %s\n", u_errorName(status)); in testZones()
1307 datfor=udat_open(UDAT_MEDIUM,UDAT_MEDIUM ,NULL, fgGMTID,-1,NULL, 0, &status); in testZones()
1308 if(U_FAILURE(status)){ in testZones()
1309 …g_data_err("error in creating the dateformat : %s (Are you missing data?)\n", u_errorName(status)); in testZones()
1312 ucal_setDateTime(gmtcal, yr, mo - 1, dt, hr, mn, sc, &status); in testZones()
1313 if (U_FAILURE(status)) { in testZones()
1314 log_data_err("ucal_setDateTime failed: %s (Are you missing data?)\n", u_errorName(status)); in testZones()
1318 date1 = ucal_getMillis(gmtcal, &status); in testZones()
1319 if (U_FAILURE(status)) { in testZones()
1320 log_err("ucal_getMillis failed: %s\n", u_errorName(status)); in testZones()
1326 ucal_setMillis(cal, date1, &status); in testZones()
1327 if (U_FAILURE(status)) { in testZones()
1328 log_err("ucal_setMillis() failed: %s\n", u_errorName(status)); in testZones()
1332 offset = ucal_get(cal, UCAL_ZONE_OFFSET, &status); in testZones()
1333 offset += ucal_get(cal, UCAL_DST_OFFSET, &status); in testZones()
1335 if (U_FAILURE(status)) { in testZones()
1336 log_err("ucal_get() failed: %s\n", u_errorName(status)); in testZones()
1342 utc = ((ucal_get(cal, UCAL_HOUR_OF_DAY, &status) * 60 + in testZones()
1343 ucal_get(cal, UCAL_MINUTE, &status)) * 60 + in testZones()
1344 ucal_get(cal, UCAL_SECOND, &status)) * 1000 + in testZones()
1345 ucal_get(cal, UCAL_MILLISECOND, &status) - offset; in testZones()
1346 if (U_FAILURE(status)) { in testZones()
1347 log_err("ucal_get() failed: %s\n", u_errorName(status)); in testZones()
1378 UErrorCode status = U_ZERO_ERROR; in checkDateTime() local
1379 if (ucal_get(c, UCAL_YEAR, &status) != y || in checkDateTime()
1380 ucal_get(c, UCAL_MONTH, &status) != m || in checkDateTime()
1381 ucal_get(c, UCAL_DATE, &status) != d || in checkDateTime()
1382 ucal_get(c, UCAL_HOUR, &status) != hr || in checkDateTime()
1383 ucal_get(c, UCAL_MINUTE, &status) != min || in checkDateTime()
1384 ucal_get(c, UCAL_SECOND, &status) != sec || in checkDateTime()
1385 ucal_get(c, UCAL_MILLISECOND, &status) != ms) { in checkDateTime()
1388 ucal_get(c, UCAL_YEAR, &status), in checkDateTime()
1389 ucal_get(c, UCAL_MONTH, &status) + 1, in checkDateTime()
1390 ucal_get(c, UCAL_DATE, &status), in checkDateTime()
1391 ucal_get(c, UCAL_HOUR, &status), in checkDateTime()
1392 ucal_get(c, UCAL_MINUTE, &status) + 1, in checkDateTime()
1393 ucal_get(c, UCAL_SECOND, &status), in checkDateTime()
1394 ucal_get(c, UCAL_MILLISECOND, &status) ); in checkDateTime()
1396 if (U_FAILURE(status)){ in checkDateTime()
1397 log_err("ucal_get failed: %s\n", u_errorName(status)); in checkDateTime()
1410 UErrorCode status = U_ZERO_ERROR; in checkDate() local
1411 if (ucal_get(c,UCAL_YEAR, &status) != y || in checkDate()
1412 ucal_get(c, UCAL_MONTH, &status) != m || in checkDate()
1413 ucal_get(c, UCAL_DATE, &status) != d) { in checkDate()
1416 ucal_get(c, UCAL_YEAR, &status), in checkDate()
1417 ucal_get(c, UCAL_MONTH, &status) + 1, in checkDate()
1418 ucal_get(c, UCAL_DATE, &status) ); in checkDate()
1420 if (U_FAILURE(status)) { in checkDate()
1421 log_err("ucal_get failed: %s\n", u_errorName(status)); in checkDate()
1438 UErrorCode status = U_ZERO_ERROR; in verify1() local
1439 if (ucal_get(c, UCAL_YEAR, &status) == year && in verify1()
1440 ucal_get(c, UCAL_MONTH, &status) == month && in verify1()
1441 ucal_get(c, UCAL_DATE, &status) == day) { in verify1()
1442 if (U_FAILURE(status)) { in verify1()
1443 log_err("FAIL: Calendar::get failed: %s\n", u_errorName(status)); in verify1()
1447 d1=ucal_getMillis(c, &status); in verify1()
1448 if (U_FAILURE(status)) { in verify1()
1449 log_err("ucal_getMillis failed: %s\n", u_errorName(status)); in verify1()
1456 d1=ucal_getMillis(c, &status); in verify1()
1457 if (U_FAILURE(status)) { in verify1()
1458 log_err("ucal_getMillis failed: %s\n", u_errorName(status) ); in verify1()
1473 UErrorCode status = U_ZERO_ERROR; in verify2() local
1476 if (ucal_get(c, UCAL_YEAR, &status) == year && in verify2()
1477 ucal_get(c, UCAL_MONTH, &status) == month && in verify2()
1478 ucal_get(c, UCAL_DATE, &status) == day && in verify2()
1479 ucal_get(c, UCAL_HOUR, &status) == hour && in verify2()
1480 ucal_get(c, UCAL_MINUTE, &status) == min && in verify2()
1481 ucal_get(c, UCAL_SECOND, &status) == sec && in verify2()
1482 ucal_get(c, UCAL_AM_PM, &status) == am_pm ){ in verify2()
1483 if (U_FAILURE(status)) { in verify2()
1484 log_err("FAIL: Calendar::get failed: %s\n", u_errorName(status)); in verify2()
1488 d1=ucal_getMillis(c, &status); in verify2()
1489 if (U_FAILURE(status)) { in verify2()
1490 log_err("ucal_getMillis failed: %s\n", u_errorName(status)); in verify2()
1497 d1=ucal_getMillis(c, &status); in verify2()
1498 if (U_FAILURE(status)) { in verify2()
1499 log_err("ucal_getMillis failed: %s\n", u_errorName(status)); in verify2()
1579 UErrorCode status = U_ZERO_ERROR; in TestGetKeywordValuesForLocale() local
1588 … UEnumeration *ALL = ucal_getKeywordValuesForLocale("calendar", uloc_getDefault(), FALSE, &status); in TestGetKeywordValuesForLocale()
1589 if (U_SUCCESS(status)) { in TestGetKeywordValuesForLocale()
1594 pref = ucal_getKeywordValuesForLocale("calendar", loc, TRUE, &status); in TestGetKeywordValuesForLocale()
1601 if (U_SUCCESS(status) && uenum_count(pref, &status) == EXPECTED_SIZE[i]) { in TestGetKeywordValuesForLocale()
1604 … if ((value = uenum_next(pref, &valueLength, &status)) != NULL && U_SUCCESS(status)) { in TestGetKeywordValuesForLocale()
1623 all = ucal_getKeywordValuesForLocale("calendar", loc, FALSE, &status); in TestGetKeywordValuesForLocale()
1625 size = uenum_count(all, &status); in TestGetKeywordValuesForLocale()
1627 if (U_SUCCESS(status) && size == uenum_count(ALL, &status)) { in TestGetKeywordValuesForLocale()
1631 … if ((value = uenum_next(all, &valueLength, &status)) != NULL && U_SUCCESS(status)) { in TestGetKeywordValuesForLocale()
1651 …log_err_status(status, "Failed to get ALL keyword values for default locale %s: %s.\n", uloc_getDe… in TestGetKeywordValuesForLocale()
1760 UErrorCode status = U_ZERO_ERROR; in TestWeekend() local
1761 UCalendar * cal = ucal_open(NULL, 0, testDatesPtr->locale, UCAL_GREGORIAN, &status); in TestWeekend()
1763 if (U_SUCCESS(status)) { in TestWeekend()
1772 weekendDatesPtr->hour, 0, 0, &status); in TestWeekend()
1773 dateToTest = ucal_getMillis(cal, &status) + weekendDatesPtr->millisecOffset; in TestWeekend()
1774 isWeekend = ucal_isWeekend(cal, dateToTest, &status); in TestWeekend()
1785 if ( U_FAILURE(status) ) { in TestWeekend()
1786 …ale %s date %s isWeekend() status %s\n", testDatesPtr->locale, fmtDateBytes, u_errorName(status) ); in TestWeekend()
1787 status = U_ZERO_ERROR; in TestWeekend()
1796 …for locale %s failed: %s - (Are you missing data?)\n", testDatesPtr->locale, u_errorName(status) ); in TestWeekend()
1804 UErrorCode status = U_ZERO_ERROR; in TestWeekend() local
1805 UCalendar * cal = ucal_open(NULL, 0, testDaysPtr->locale, UCAL_GREGORIAN, &status); in TestWeekend()
1807 if (U_SUCCESS(status)) { in TestWeekend()
1811 … UCalendarWeekdayType dayType = ucal_getDayOfWeekType(cal, daysOfWeekPtr->dayOfWeek, &status); in TestWeekend()
1813 transition = ucal_getWeekendTransition(cal, daysOfWeekPtr->dayOfWeek, &status); in TestWeekend()
1815 if ( U_FAILURE(status) ) { in TestWeekend()
1816 …DayOfWeekType() status %s\n", testDaysPtr->locale, daysOfWeekPtr->dayOfWeek, u_errorName(status) ); in TestWeekend()
1817 status = U_ZERO_ERROR; in TestWeekend()
1826 … for locale %s failed: %s - (Are you missing data?)\n", testDaysPtr->locale, u_errorName(status) ); in TestWeekend()
1889 UErrorCode status = U_ZERO_ERROR; in TestFieldDifference() local
1890 … UCalendar* ucal = ucal_open(tfdItemPtr->timezone, -1, tfdItemPtr->locale, UCAL_DEFAULT, &status); in TestFieldDifference()
1891 if (U_FAILURE(status)) { in TestFieldDifference()
1892 …rr("FAIL: for locale \"%s\", ucal_open had status %s\n", tfdItemPtr->locale, u_errorName(status) ); in TestFieldDifference()
1896 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1897 yDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_YEAR, &status); in TestFieldDifference()
1898 MDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_MONTH, &status); in TestFieldDifference()
1899 dDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_DATE, &status); in TestFieldDifference()
1900 HDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_HOUR, &status); in TestFieldDifference()
1901 mDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_MINUTE, &status); in TestFieldDifference()
1902 sDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_SECOND, &status); in TestFieldDifference()
1903 if (U_FAILURE(status)) { in TestFieldDifference()
1905 … tfdItemPtr->locale, tfdItemPtr->start, tfdItemPtr->target, u_errorName(status) ); in TestFieldDifference()
1918 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1919 yDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_YEAR, &status); in TestFieldDifference()
1920 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1921 MDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_MONTH, &status); in TestFieldDifference()
1922 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1923 dDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_DATE, &status); in TestFieldDifference()
1924 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1925 HDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_HOUR, &status); in TestFieldDifference()
1926 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1927 mDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_MINUTE, &status); in TestFieldDifference()
1928 if (U_FAILURE(status)) { in TestFieldDifference()
1930 … tfdItemPtr->locale, tfdItemPtr->start, tfdItemPtr->target, u_errorName(status) ); in TestFieldDifference()
1941 ucal_setMillis(ucal, tfdItemPtr->start, &status); in TestFieldDifference()
1942 sDf = ucal_getFieldDifference(ucal, tfdItemPtr->target, UCAL_SECOND, &status); in TestFieldDifference()
1944 if (U_FAILURE(status)) { in TestFieldDifference()
1946 … tfdItemPtr->locale, tfdItemPtr->start, tfdItemPtr->target, u_errorName(status) ); in TestFieldDifference()
1951 } else if (!U_FAILURE(status)) { in TestFieldDifference()
1962 UErrorCode status = U_ZERO_ERROR; in TestAmbiguousWallTime() local
1968 ucal = ucal_open(tzID, -1, NULL, UCAL_DEFAULT, &status); in TestAmbiguousWallTime()
1969 if (U_FAILURE(status)) { in TestAmbiguousWallTime()
1985 ucal_setDateTime(ucal, 2011, 11-1, 6, 1, 30, 0, &status); in TestAmbiguousWallTime()
1986 t = ucal_getMillis(ucal, &status); in TestAmbiguousWallTime()
1988 if (U_FAILURE(status)) { in TestAmbiguousWallTime()
1989 …"FAIL: Calculating time 2011-11-06 01:30:00 with UCAL_WALLTIME_FIRST - %s\n", u_errorName(status)); in TestAmbiguousWallTime()
1990 status = U_ZERO_ERROR; in TestAmbiguousWallTime()
1998 ucal_setDateTime(ucal, 2011, 11-1, 6, 1, 30, 0, &status); in TestAmbiguousWallTime()
1999 t = ucal_getMillis(ucal, &status); in TestAmbiguousWallTime()
2001 if (U_FAILURE(status)) { in TestAmbiguousWallTime()
2002 …("FAIL: Calculating time 2011-11-06 01:30:00 with UCAL_WALLTIME_LAST - %s\n", u_errorName(status)); in TestAmbiguousWallTime()
2003 status = U_ZERO_ERROR; in TestAmbiguousWallTime()
2011 ucal_setDateTime(ucal, 2011, 3-1, 13, 2, 30, 0, &status); in TestAmbiguousWallTime()
2012 t = ucal_getMillis(ucal, &status); in TestAmbiguousWallTime()
2014 if (U_FAILURE(status)) { in TestAmbiguousWallTime()
2015 …"FAIL: Calculating time 2011-03-13 02:30:00 with UCAL_WALLTIME_FIRST - %s\n", u_errorName(status)); in TestAmbiguousWallTime()
2016 status = U_ZERO_ERROR; in TestAmbiguousWallTime()
2024 ucal_setDateTime(ucal, 2011, 3-1, 13, 2, 30, 0, &status); in TestAmbiguousWallTime()
2025 t = ucal_getMillis(ucal, &status); in TestAmbiguousWallTime()
2027 if (U_FAILURE(status)) { in TestAmbiguousWallTime()
2028 …("FAIL: Calculating time 2011-03-13 02:30:00 with UCAL_WALLTIME_LAST - %s\n", u_errorName(status)); in TestAmbiguousWallTime()
2029 status = U_ZERO_ERROR; in TestAmbiguousWallTime()
2037 ucal_setDateTime(ucal, 2011, 3-1, 13, 2, 30, 0, &status); in TestAmbiguousWallTime()
2038 t = ucal_getMillis(ucal, &status); in TestAmbiguousWallTime()
2040 if (U_FAILURE(status)) { in TestAmbiguousWallTime()
2041 …: Calculating time 2011-03-13 02:30:00 with UCAL_WALLTIME_NEXT_VALID - %s\n", u_errorName(status)); in TestAmbiguousWallTime()
2042 status = U_ZERO_ERROR; in TestAmbiguousWallTime()
2050 ucal_setDateTime(ucal, 2011, 3-1, 13, 2, 30, 0, &status); in TestAmbiguousWallTime()
2051 t = ucal_getMillis(ucal, &status); in TestAmbiguousWallTime()
2052 if (U_SUCCESS(status)) { in TestAmbiguousWallTime()
2055 status = U_ZERO_ERROR; in TestAmbiguousWallTime()
2095 UErrorCode status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds() local
2096 UCalendar *ucalTest = ucal_open(zoneGMT, -1, eraTestItemPtr->locale, UCAL_DEFAULT, &status); in TestAddRollEra0AndEraBounds()
2097 if ( U_SUCCESS(status) ) { in TestAddRollEra0AndEraBounds()
2100 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2104 yrBefore = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2105 ucal_add(ucalTest, UCAL_YEAR, 1, &status); in TestAddRollEra0AndEraBounds()
2106 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2107 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2109 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2115 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2119 yrBefore = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2120 ucal_roll(ucalTest, UCAL_YEAR, 1, &status); in TestAddRollEra0AndEraBounds()
2121 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2122 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2124 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2130 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2135 … ucal_roll(ucalTest, UCAL_YEAR, 1, &status); /* roll forward in time to era 0 boundary */ in TestAddRollEra0AndEraBounds()
2136 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2137 eraAfter = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2138 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2140 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2149 const char * calType = ucal_getType(ucalTest, &status); in TestAddRollEra0AndEraBounds()
2150 ucal_roll(ucalTest, UCAL_YEAR, -2, &status); in TestAddRollEra0AndEraBounds()
2151 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2152 eraAfter = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2153 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2155 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2162 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2165 int32_t eraMin = ucal_getLimit(ucalTest, UCAL_ERA, UCAL_MINIMUM, &status); in TestAddRollEra0AndEraBounds()
2166 const char * calType = ucal_getType(ucalTest, &status); in TestAddRollEra0AndEraBounds()
2168 …ns minimum era %d (should be 0) for calType %s, error %s\n", eraMin, calType, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2172 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2176 eraMax = ucal_getLimit(ucalTest, UCAL_ERA, UCAL_MAXIMUM, &status); in TestAddRollEra0AndEraBounds()
2177 if ( U_SUCCESS(status) && eraMax > 0 ) { in TestAddRollEra0AndEraBounds()
2179 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2183 yrBefore = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2184 ucal_add(ucalTest, UCAL_YEAR, 1, &status); in TestAddRollEra0AndEraBounds()
2185 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2186 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2188 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2193 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2197 yrBefore = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2198 ucal_roll(ucalTest, UCAL_YEAR, 1, &status); in TestAddRollEra0AndEraBounds()
2199 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2200 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2202 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2207 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2211 …yrMax = ucal_getLimit(ucalTest, UCAL_YEAR, UCAL_ACTUAL_MAXIMUM, &status); /* max year value for er… in TestAddRollEra0AndEraBounds()
2212 … ucal_roll(ucalTest, UCAL_YEAR, -1, &status); /* roll down which should pin or wrap to end */ in TestAddRollEra0AndEraBounds()
2213 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2214 eraAfter = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2215 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2217 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2229 … ucal_roll(ucalTest, UCAL_YEAR, 1, &status); /* now roll up which should wrap to beginning */ in TestAddRollEra0AndEraBounds()
2230 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2231 eraAfter = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2232 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2234 eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2242 ucal_setMillis(ucalTest, ucal_getNow(), &status); in TestAddRollEra0AndEraBounds()
2243 eraNow = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2244 if ( U_SUCCESS(status) && eraNow > 1 ) { in TestAddRollEra0AndEraBounds()
2245 status = U_ZERO_ERROR; in TestAddRollEra0AndEraBounds()
2249 …yrMax = ucal_getLimit(ucalTest, UCAL_YEAR, UCAL_ACTUAL_MAXIMUM, &status); /* max year value for th… in TestAddRollEra0AndEraBounds()
2250 ucal_roll(ucalTest, UCAL_YEAR, -1, &status); in TestAddRollEra0AndEraBounds()
2251 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2252 eraAfter = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2253 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2255 eraNow, eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2267 … ucal_roll(ucalTest, UCAL_YEAR, 1, &status); /* now roll up which should wrap to beginning */ in TestAddRollEra0AndEraBounds()
2268 yrAfter = ucal_get(ucalTest, UCAL_YEAR, &status); in TestAddRollEra0AndEraBounds()
2269 eraAfter = ucal_get(ucalTest, UCAL_ERA, &status); in TestAddRollEra0AndEraBounds()
2270 if (U_FAILURE(status)) { in TestAddRollEra0AndEraBounds()
2272 eraNow, eraTestItemPtr->locale, u_errorName(status)); in TestAddRollEra0AndEraBounds()
2316 UErrorCode status = U_ZERO_ERROR; in TestGetTZTransition() local
2317 UCalendar * ucal = ucal_open(zoneGMT, -1, "en", UCAL_GREGORIAN, &status); in TestGetTZTransition()
2318 if ( U_SUCCESS(status) ) { in TestGetTZTransition()
2322 ucal_setTimeZone(ucal, itemPtr->zoneName, -1, &status); in TestGetTZTransition()
2323 ucal_setDateTime(ucal, itemPtr->year, itemPtr->month, itemPtr->day, 12, 0, 0, &status); in TestGetTZTransition()
2324 curMillis = ucal_getMillis(ucal, &status); in TestGetTZTransition()
2326 if ( U_SUCCESS(status) ) { in TestGetTZTransition()
2330 … result = ucal_getTimeZoneTransitionDate(ucal, UCAL_TZ_TRANSITION_PREVIOUS, &transition1, &status); in TestGetTZTransition()
2331 if (U_FAILURE(status) || result != itemPtr->hasPrev) { in TestGetTZTransition()
2333 itemPtr->descrip, u_errorName(status), itemPtr->hasPrev, result); in TestGetTZTransition()
2335 ucal_setMillis(ucal, transition1, &status); in TestGetTZTransition()
2336 …ucal_getTimeZoneTransitionDate(ucal, UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE, &transition2, &status); in TestGetTZTransition()
2337 if (U_FAILURE(status) || !result || transition2 != transition1) { in TestGetTZTransition()
2339 … itemPtr->descrip, u_errorName(status), result, transition1, transition2); in TestGetTZTransition()
2342 status = U_ZERO_ERROR; in TestGetTZTransition()
2344 … result = ucal_getTimeZoneTransitionDate(ucal, UCAL_TZ_TRANSITION_NEXT, &transition1, &status); in TestGetTZTransition()
2345 if (U_FAILURE(status) || result != itemPtr->hasNext) { in TestGetTZTransition()
2347 itemPtr->descrip, u_errorName(status), itemPtr->hasNext, result); in TestGetTZTransition()
2349 ucal_setMillis(ucal, transition1, &status); in TestGetTZTransition()
2350 …t = ucal_getTimeZoneTransitionDate(ucal, UCAL_TZ_TRANSITION_NEXT_INCLUSIVE, &transition2, &status); in TestGetTZTransition()
2351 if (U_FAILURE(status) || !result || transition2 != transition1) { in TestGetTZTransition()
2353 … itemPtr->descrip, u_errorName(status), result, transition1, transition2); in TestGetTZTransition()
2356 status = U_ZERO_ERROR; in TestGetTZTransition()
2359 itemPtr->descrip, u_errorName(status)); in TestGetTZTransition()
2360 status = U_ZERO_ERROR; in TestGetTZTransition()
2365 log_data_err("FAIL setup: ucal_open status %s\n", u_errorName(status)); in TestGetTZTransition()
2381 UErrorCode status; in TestGetWindowsTimeZoneID() local
2386 status = U_ZERO_ERROR; in TestGetWindowsTimeZoneID()
2387 … = ucal_getWindowsTimeZoneID(tzNewYork, u_strlen(tzNewYork), winID, UPRV_LENGTHOF(winID), &status); in TestGetWindowsTimeZoneID()
2388 if (U_FAILURE(status)) { in TestGetWindowsTimeZoneID()
2389 … log_data_err("FAIL: Windows ID for America/New_York, status %s\n", u_errorName(status)); in TestGetWindowsTimeZoneID()
2395 status = U_ZERO_ERROR; in TestGetWindowsTimeZoneID()
2396 …en = ucal_getWindowsTimeZoneID(tzTronto, u_strlen(tzTronto), winID, UPRV_LENGTHOF(winID), &status); in TestGetWindowsTimeZoneID()
2397 if (U_FAILURE(status)) { in TestGetWindowsTimeZoneID()
2398 log_data_err("FAIL: Windows ID for America/Toronto, status %s\n", u_errorName(status)); in TestGetWindowsTimeZoneID()
2404 status = U_ZERO_ERROR; in TestGetWindowsTimeZoneID()
2405 … len = ucal_getWindowsTimeZoneID(sBogus, u_strlen(sBogus), winID, UPRV_LENGTHOF(winID), &status); in TestGetWindowsTimeZoneID()
2406 if (U_FAILURE(status)) { in TestGetWindowsTimeZoneID()
2407 log_data_err("FAIL: Windows ID for Bogus, status %s\n", u_errorName(status)); in TestGetWindowsTimeZoneID()
2415 UErrorCode status; in TestGetTimeZoneIDByWindowsID() local
2420 status = U_ZERO_ERROR; in TestGetTimeZoneIDByWindowsID()
2421 … len = ucal_getTimeZoneIDForWindowsID(winEastern, -1, NULL, tzID, UPRV_LENGTHOF(tzID), &status); in TestGetTimeZoneIDByWindowsID()
2422 if (U_FAILURE(status)) { in TestGetTimeZoneIDByWindowsID()
2423 … log_data_err("FAIL: TZ ID for Eastern Standard Time, status %s\n", u_errorName(status)); in TestGetTimeZoneIDByWindowsID()
2429 status = U_ZERO_ERROR; in TestGetTimeZoneIDByWindowsID()
2430 …TimeZoneIDForWindowsID(winEastern, u_strlen(winEastern), "US", tzID, UPRV_LENGTHOF(tzID), &status); in TestGetTimeZoneIDByWindowsID()
2431 if (U_FAILURE(status)) { in TestGetTimeZoneIDByWindowsID()
2432 … log_data_err("FAIL: TZ ID for Eastern Standard Time - US, status %s\n", u_errorName(status)); in TestGetTimeZoneIDByWindowsID()
2438 status = U_ZERO_ERROR; in TestGetTimeZoneIDByWindowsID()
2439 …TimeZoneIDForWindowsID(winEastern, u_strlen(winEastern), "CA", tzID, UPRV_LENGTHOF(tzID), &status); in TestGetTimeZoneIDByWindowsID()
2440 if (U_FAILURE(status)) { in TestGetTimeZoneIDByWindowsID()
2441 … log_data_err("FAIL: TZ ID for Eastern Standard Time - CA, status %s\n", u_errorName(status)); in TestGetTimeZoneIDByWindowsID()
2448 status = U_ZERO_ERROR; in TestGetTimeZoneIDByWindowsID()
2449 len = ucal_getTimeZoneIDForWindowsID(sBogus, -1, NULL, tzID, UPRV_LENGTHOF(tzID), &status); in TestGetTimeZoneIDByWindowsID()
2450 if (U_FAILURE(status)) { in TestGetTimeZoneIDByWindowsID()
2451 log_data_err("FAIL: TZ ID for Bogus, status %s\n", u_errorName(status)); in TestGetTimeZoneIDByWindowsID()