]> granicus.if.org Git - icu/commitdiff
ICU-12352 Updated TestTimeRoundTrip to test the end time always.
authorYoshito Umaoka <y.umaoka@gmail.com>
Thu, 5 May 2016 05:44:51 +0000 (05:44 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Thu, 5 May 2016 05:44:51 +0000 (05:44 +0000)
X-SVN-Rev: 38702

icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/TimeZoneFormatTest.java

index f0e64ed356bb11b69bcf5251278e5734baf9cdbb..92fb5213547ef2004a08fd99218f3d041b022889 100644 (file)
@@ -417,6 +417,7 @@ public class TimeZoneFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                     long t = START_TIME;
                     TimeZoneTransition tzt = null;
                     boolean middle = true;
+                    boolean last = false;
                     while (t < END_TIME) {
                         if (tzt == null) {
                             testTimes[0] = t;
@@ -483,11 +484,16 @@ public class TimeZoneFormatTest extends com.ibm.icu.dev.test.TestFmwk {
                             }
                             times[patidx] += System.currentTimeMillis() - timer;
                         }
-                        tzt = btz.getNextTransition(t, false);
-                        if (tzt == null) {
+
+                        if (last) {
                             break;
                         }
-                        if (middle) {
+
+                        tzt = btz.getNextTransition(t, false);
+                        if (tzt == null) {
+                            last = true;
+                            t = END_TIME - 1;
+                        } else if (middle) {
                             // Test the date in the middle of two transitions.
                             t += (tzt.getTime() - t)/2;
                             middle = false;