Home | History | Annotate | Download | only in intltest

Lines Matching refs:rbtz

14 #include "unicode/rbtz.h"
147 * Compare SimpleTimeZone with equivalent RBTZ
191 errln("FAIL: couldn't complete RBTZ 1.");
212 errln("FAIL: couldn't complete RBTZ 2");
233 errln("FAIL: couldn't complete RBTZ 3");
424 * Test equivalency between OlsonTimeZone and custom RBTZ representing the
431 // Compare to America/New_York with equivalent RBTZ
434 //RBTZ
436 RuleBasedTimeZone *rbtz = new RuleBasedTimeZone("EST5EDT", ir);
445 rbtz->addTransitionRule(tzr, status);
453 rbtz->addTransitionRule(tzr, status);
462 rbtz->addTransitionRule(tzr, status);
470 rbtz->addTransitionRule(tzr, status);
478 rbtz->addTransitionRule(tzr, status);
486 rbtz->addTransitionRule(tzr, status);
494 rbtz->addTransitionRule(tzr, status);
502 rbtz->addTransitionRule(tzr, status);
507 rbtz->complete(status);
509 errln("FAIL: couldn't complete RBTZ.");
517 if (!ny->hasEquivalentTransitions(*rbtz, jan1_1967, jan1_2010, TRUE, status)) {
518 dataerrln("FAIL: The RBTZ must be equivalent to America/New_York between 1967 and 2010");
521 errln("FAIL: error returned from hasEquivalentTransitions for ny/rbtz 1967-2010");
523 if (ny->hasEquivalentTransitions(*rbtz, jan1_1950, jan1_2010, TRUE, status)) {
524 errln("FAIL: The RBTZ must not be equivalent to America/New_York between 1950 and 2010");
527 errln("FAIL: error returned from hasEquivalentTransitions for ny/rbtz 1950-2010");
530 // Same with above, but calling RBTZ#hasEquivalentTransitions against OlsonTimeZone
531 if (!rbtz->hasEquivalentTransitions(*ny, jan1_1967, jan1_2010, TRUE, status)) {
532 dataerrln("FAIL: The RBTZ must be equivalent to America/New_York between 1967 and 2010 ");
535 errln("FAIL: error returned from hasEquivalentTransitions for rbtz/ny 1967-2010");
537 if (rbtz->hasEquivalentTransitions(*ny, jan1_1950, jan1_2010, TRUE, status)) {
538 errln("FAIL: The RBTZ must not be equivalent to America/New_York between 1950 and 2010");
541 errln("FAIL: error returned from hasEquivalentTransitions for rbtz/ny 1950-2010");
545 if (ny->hasSameRules(*rbtz) || rbtz->hasSameRules(*ny)) {
548 RuleBasedTimeZone *rbtzc = (RuleBasedTimeZone*)rbtz->clone();
549 if (!rbtz->hasSameRules(*rbtzc) || !rbtz->hasEquivalentTransitions(*rbtzc, jan1_1950, jan1_2010, TRUE, status)) {
553 errln("FAIL: error returned from hasEquivalentTransitions for rbtz/rbtzc 1950-2010");
570 rbtz->getOffset(times[i], FALSE, offset1, dst1, status);
572 errln("FAIL: rbtz->getOffset failed");
579 dataerrln("FAIL: Incompatible time zone offset/dstSavings for ny and rbtz");
583 if (rbtz->inDaylightTime(times[i], status) != ny->inDaylightTime(times[i], status)) {
584 dataerrln("FAIL: Incompatible daylight saving time for ny and rbtz");
592 delete rbtz;
632 * Check if an OlsonTimeZone and its equivalent RBTZ have the exact same
665 RuleBasedTimeZone *rbtz = new RuleBasedTimeZone(*tzid, initial->clone());
670 rbtz->addTransitionRule(trsrules[i]->clone(), status);
672 errln((UnicodeString)"FAIL: failed to add a transition rule at index " + i + " to the RBTZ for " + *tzid);
675 rbtz->complete(status);
677 errln((UnicodeString)"FAIL: complete() failed for the RBTZ for " + *tzid);
683 // Compare the original OlsonTimeZone with the RBTZ starting the startTime for 20 years
686 compareTransitionsAscending(*tz, *rbtz, start, until, FALSE);
688 compareTransitionsAscending(*tz, *rbtz, start + 1, until, TRUE);
690 compareTransitionsDescending(*tz, *rbtz, start, until, FALSE);
692 compareTransitionsDescending(*tz, *rbtz, start + 1, until, TRUE);
695 delete rbtz;
1164 // Create an RBTZ from the rules and compare the offsets at the date
1165 RuleBasedTimeZone *rbtz = new RuleBasedTimeZone(*tzid, initial);
1167 rbtz->addTransitionRule(std, status);
1171 rbtz->addTransitionRule(dst, status);
1176 rbtz->complete(status);
1178 errln("FAIL: couldn't complete rbtz for " + *tzid);
1186 rbtz->getOffset(testTimes[i], FALSE, raw1, dst1, status);
1188 errln("FAIL: couldn't get offsets from rbtz for " + *tzid);
1191 errln("FAIL: rbtz created by simple rule does not match the original tz for tzid " + *tzid);
1193 delete rbtz;
2628 RuleBasedTimeZone *rbtz = new RuleBasedTimeZone(id, initialRule);
2632 rbtz->addTransitionRule(atzRule, status);
2636 rbtz->addTransitionRule(atzRule, status);
2640 rbtz->addTransitionRule(atzRule, status);
2644 rbtz->addTransitionRule(atzRule, status);
2645 rbtz->complete(status);
2651 rbtz->getOffset(1293822000000.0 /* 2010-12-31 19:00:00 UTC */, FALSE, raw, dst, status);
2659 delete rbtz;