Home | History | Annotate | Download | only in intltest

Lines Matching refs:status

54 TimeZoneRegressionTest::failure(UErrorCode status, const char* msg)
56 if(U_FAILURE(status)) {
57 errln(UnicodeString("FAIL: ") + msg + " failed, error " + u_errorName(status));
88 UErrorCode status = U_ZERO_ERROR;
89 UBool startsInDST = tz.inDaylightTime(min, status);
90 if (failure(status, "SimpleTimeZone::inDaylightTime")) return 0;
91 if (tz.inDaylightTime(max, status) == startsInDST) {
95 if (failure(status, "SimpleTimeZone::inDaylightTime")) return 0;
98 if (tz.inDaylightTime(mid, status) == startsInDST) {
103 if (failure(status, "SimpleTimeZone::inDaylightTime")) return 0;
109 UErrorCode status = U_ZERO_ERROR;
110 UBool startsInDST = tz.inDaylightTime(min, status);
111 if (failure(status, "SimpleTimeZone::inDaylightTime")) return 0;
113 if (tz.inDaylightTime(min, status) != startsInDST) {
116 if (failure(status, "SimpleTimeZone::inDaylightTime")) return 0;
128 UErrorCode status = U_ZERO_ERROR;
133 z->setStartRule(UCAL_FEBRUARY, 1, UCAL_SUNDAY, 0, status);
134 failure(status, "z->setStartRule()");
135 z->setEndRule(UCAL_MARCH, -1, UCAL_SUNDAY, 0, status);
136 failure(status, "z->setStartRule()");
140 GregorianCalendar cal(1997, UCAL_JANUARY, 31, status);
141 if(U_FAILURE(status)) {
142 dataerrln("Error creating calendar %s", u_errorName(status));
145 failure(status, "new GregorianCalendar");
148 SimpleDateFormat sdf((UnicodeString)"E d MMM yyyy G HH:mm", status);
149 if(U_FAILURE(status)) {
150 dataerrln("Error creating date format %s", u_errorName(status));
154 failure(status, "new SimpleDateFormat");
158 UBool indt = z->inDaylightTime(jan31=cal.getTime(status), status);
159 failure(status, "inDaylightTime or getTime call on Jan 31");
164 indt = z->inDaylightTime(mar1=cal.getTime(status), status);
165 failure(status, "inDaylightTime or getTime call on Mar 1");
168 sdf.format(cal.getTime(status), str);
169 failure(status, "getTime");
173 indt = z->inDaylightTime(mar31=cal.getTime(status), status);
174 failure(status, "inDaylightTime or getTime call on Mar 31");
181 UDate dec31 = cal.getTime(status);
182 failure(status, "getTime");
208 UErrorCode status = U_ZERO_ERROR;
212 1997, UCAL_OCTOBER, 26, UCAL_SUNDAY, (2*60*60*1000), status);
214 1997, UCAL_OCTOBER, 26, UCAL_SUNDAY, (2*60*60*1000)-1, status);
217 1997, UCAL_OCTOBER, 26, UCAL_SUNDAY, (1*60*60*1000), status);
219 1997, UCAL_OCTOBER, 26, UCAL_SUNDAY, (1*60*60*1000)-1, status);
226 1997, UCAL_APRIL, 6, UCAL_SUNDAY, (2*60*60*1000), status);
228 1997, UCAL_APRIL, 6, UCAL_SUNDAY, (2*60*60*1000)-1, status);
230 1997, UCAL_APRIL, 6, UCAL_SUNDAY, (3*60*60*1000), status);
232 1997, UCAL_APRIL, 6, UCAL_SUNDAY, (3*60*60*1000)-1, status);
234 1997, UCAL_APRIL, 6, UCAL_SUNDAY, (1*60*60*1000), status);
236 1997, UCAL_APRIL, 6, UCAL_SUNDAY, (1*60*60*1000)-1, status);
242 ERR_IF_FAIL(U_FAILURE(status))
310 UErrorCode status = U_ZERO_ERROR;
311 GregorianCalendar *testCal = (GregorianCalendar*)Calendar::createInstance(status);
312 if(U_FAILURE(status)) {
313 dataerrln("Error creating calendar %s", u_errorName(status));
317 failure(status, "Calendar::createInstance");
335 while(testCal->getTime(status) < end) {
336 testCal->setTime(t, status);
352 UErrorCode status = U_ZERO_ERROR;
360 UDate millis = testCal->get(UCAL_MILLISECOND, status) +
361 1000.0 * (testCal->get(UCAL_SECOND, status) +
362 60.0 * (testCal->get(UCAL_MINUTE, status) +
363 60.0 * (testCal->get(UCAL_HOUR_OF_DAY, status)))) -
364 testCal->get(UCAL_DST_OFFSET, status);
371 int32_t date = testCal->get(UCAL_DATE, status);
372 int32_t dow = testCal->get(UCAL_DAY_OF_WEEK, status);
384 tzOffset = testTZ->getOffset((uint8_t)testCal->get(UCAL_ERA, status),
385 testCal->get(UCAL_YEAR, status),
386 testCal->get(UCAL_MONTH, status),
390 status);
395 UDate testDate = testCal->getTime(status);
397 UBool inDaylightTime = testTZ->inDaylightTime(testDate, status);
398 SimpleDateFormat *sdf = new SimpleDateFormat((UnicodeString)"MM/dd/yyyy HH:mm", status);
452 UErrorCode status = U_ZERO_ERROR;
453 Calendar *cal = Calendar::createInstance(status);
454 if(U_FAILURE(status)) {
455 dataerrln("Error creating calendar %s", u_errorName(status));
459 failure(status, "Calendar::createInstance");
465 status))
466 dataerrln("We're not in Daylight Savings Time and we should be. - %s", u_errorName(status));
469 int32_t era = cal->get(UCAL_ERA, status);
470 int32_t year = cal->get(UCAL_YEAR, status);
471 int32_t month = cal->get(UCAL_MONTH, status);
472 int32_t day = cal->get(UCAL_DATE, status);
473 int32_t dayOfWeek = cal->get(UCAL_DAY_OF_WEEK, status);
474 int32_t millis = cal->get(UCAL_MILLISECOND, status) +
475 (cal->get(UCAL_SECOND, status) +
476 (cal->get(UCAL_MINUTE, status) +
477 (cal->get(UCAL_HOUR, status) * 60) * 60) * 1000) -
478 cal->get(UCAL_DST_OFFSET, status);
480 failure(status, "cal->get");
481 int32_t offset = tz->getOffset((uint8_t)era, year, month, day, (uint8_t)dayOfWeek, millis, status);
552 UErrorCode status = U_ZERO_ERROR;
554 SimpleTimeZone *tz1 = new SimpleTimeZone(0, "1", 0, 0, 0, 0, 2, 0, 0, 0, status);
555 SimpleTimeZone *tz2 = new SimpleTimeZone(0, "2", 1, 0, 0, 0, 3, 0, 0, 0, status);
557 SimpleTimeZone *tza = new SimpleTimeZone(0, "a", 0, 1, 0, 0, 3, 2, 0, 0, status);
558 SimpleTimeZone *tzA = new SimpleTimeZone(0, "A", 0, 1, 0, 0, 3, 2, 0, 0, status);
560 SimpleTimeZone *tzb = new SimpleTimeZone(0, "b", 0, 1, 0, 0, 3, 1, 0, 0, status);
562 if(U_FAILURE(status))
629 UErrorCode status = U_ZERO_ERROR;
633 zone->setStartRule(month, day, dayOfWeek, time, status);
637 if (U_SUCCESS(status) != shouldBeGood) {
646 status = U_ZERO_ERROR;
647 zone->setEndRule(month, day, dayOfWeek, time, status);
651 if (U_SUCCESS(status) != shouldBeGood) {
661 status = U_ZERO_ERROR;
665 GOOD_TIME,status);
669 if (U_SUCCESS(status) != shouldBeGood) {
679 status = U_ZERO_ERROR;
683 (int8_t)month, (int8_t)day, (int8_t)dayOfWeek, time,status);
687 if (U_SUCCESS(status) != shouldBeGood) {
718 UErrorCode status = U_ZERO_ERROR;
731 savings, status); // <- what we're interested in
736 z->setDSTSavings(savings, status);
740 if(U_FAILURE(status)) {
742 errln(UnicodeString("Fail: DST savings of ") + savings + " to " + method + " gave " + u_errorName(status));
745 logln(UnicodeString("Pass: DST savings of ") + savings + " to " + method + " gave " + u_errorName(status));
756 status = U_ZERO_ERROR;
804 UErrorCode status = U_ZERO_ERROR;
812 DATA[i+4], (uint8_t)DATA[i+5], DATA[i+6], status);
816 if(good != U_SUCCESS(status)) {
819 errMsg = (UnicodeString(") threw ") + u_errorName(status));
829 status = U_ZERO_ERROR; // reset
842 UErrorCode status = U_ZERO_ERROR;
843 SimpleDateFormat *fmt = new SimpleDateFormat("z", Locale::getUS(), status);
844 if(U_FAILURE(status)) {
845 dataerrln("Error creating calendar %s", u_errorName(status));
853 UCAL_MARCH, 1, 0 /*DOM*/, 0*ONE_HOUR, 1*ONE_HOUR, status);
879 UCAL_OCTOBER, 1, 0 /*DOM*/, 0*ONE_HOUR, 1*ONE_HOUR, status);
921 UErrorCode status = U_ZERO_ERROR;
924 z1->setDSTSavings(45 * 60000, status); // 0:45
928 z2->setDSTSavings(45 * 60000, status); // 0:45
929 z2->setStartRule(UCAL_JANUARY, 1, 0, status);
930 z2->setEndRule(UCAL_JULY, 1, 0, status);
933 DateFormat* fmt1 = new SimpleDateFormat(UnicodeString("z"), status);
934 if (U_FAILURE(status)) {
935 dataerrln("Failure trying to construct: %s", u_errorName(status));
939 DateFormat* fmt2 = new SimpleDateFormat(UnicodeString("z"), status);
940 if(!assertSuccess("trying to construct", status))return;
942 Calendar* tempcal = Calendar::createInstance(status);
945 UDate dst = tempcal->getTime(status); // Time in DST
947 UDate std = tempcal->getTime(status); // Time in standard
991 UErrorCode status = U_ZERO_ERROR;
996 //~z.setDSTSavings(0, status); // Must do this!
997 z.setStartRule(UCAL_FEBRUARY, 1, UCAL_SUNDAY, 0, status);
998 failure(status, "setStartRule()");
1005 z.setEndRule(UCAL_MARCH, -1, UCAL_SUNDAY, 0, status);
1006 failure(status, "setStartRule()");
1027 UErrorCode status = U_ZERO_ERROR;
1044 GregorianCalendar calWith(*zoneWith, status);
1045 GregorianCalendar calWithout(*zoneWithout, status);
1046 SimpleDateFormat fmt("MMM d yyyy hh:mm a zzz", loc, status);
1047 if (U_FAILURE(status)) {
1106 UErrorCode status = U_ZERO_ERROR;
1108 1997, UCAL_OCTOBER, 26, UCAL_SUNDAY, (2*60*60*1000), status);
1109 failure(status, "getOffset() failed");
1113 1997, UCAL_OCTOBER, 26, UCAL_SUNDAY, (2*60*60*1000), 31, status);
1114 failure(status, "getOffset() failed");
1121 1997, UCAL_FIELD_COUNT+1, 26, UCAL_SUNDAY, (2*60*60*1000), status);
1122 if(U_SUCCESS(status))
1125 status = U_ZERO_ERROR;
1126 cst->setDSTSavings(60*60*1000, status);
1127 failure(status, "setDSTSavings() failed");
1142 UErrorCode status = U_ZERO_ERROR;
1143 zone = new SimpleTimeZone(0, "A", 0, -1, 0, 0, 0, 0, 0, 0, status);
1144 if(U_SUCCESS(status)){
1147 logln("(a) " + UnicodeString( u_errorName(status)));
1149 status = U_ZERO_ERROR;
1152 zone = new SimpleTimeZone(0, "A", 0, 0, 0, 0, 0, -1, 0, 0, status);
1153 if(U_SUCCESS(status)){
1156 logln("(b) " + UnicodeString(u_errorName(status)));
1158 status = U_ZERO_ERROR;
1161 zone = new SimpleTimeZone(0, "A", 0, -1, 0, 0, 0, 0, 0, 1000, status);
1162 if(U_SUCCESS(status)){
1165 logln("(c) " + UnicodeString(u_errorName(status)));
1167 status = U_ZERO_ERROR;
1169 zone = new SimpleTimeZone(0, "A", 0, 0, 0, 0, 0, -1, 0, 0, 1000, status);
1170 if(U_SUCCESS(status)){
1173 logln("(d) " + UnicodeString(u_errorName(status)));
1175 status = U_ZERO_ERROR;
1178 zone = new SimpleTimeZone(0, "A", 0, 1, 0, 0, 0, 1, 0, 0, status);
1180 zone->setStartRule(0, -1, 0, 0, status);
1181 if(U_SUCCESS(status)){
1184 logln("(e) " + UnicodeString(u_errorName(status)));
1186 zone->setStartRule(0, -1, 0, status);
1187 if(U_SUCCESS(status)){
1190 logln("(f) " + UnicodeString(u_errorName(status)));
1193 zone->setEndRule(0, -1, 0, 0, status);
1194 if(U_SUCCESS(status)){
1197 logln("(g) " + UnicodeString(u_errorName(status)));
1200 zone->setEndRule(0, -1, 0, status);
1201 if(U_SUCCESS(status)){
1204 logln("(h) " + UnicodeString(u_errorName(status)));