Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: source/test/intltest/dtfmtrtts.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/intltest/dtfmrgts.cpp ('k') | source/test/intltest/dtfmttst.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/intltest/dtfmtrtts.cpp
diff --git a/source/test/intltest/dtfmtrtts.cpp b/source/test/intltest/dtfmtrtts.cpp
index b23aaebd90a07731a0cf05072b2978069aaadbd4..02391065ab345ccefa43d904de6bb82f4625a885 100644
--- a/source/test/intltest/dtfmtrtts.cpp
+++ b/source/test/intltest/dtfmtrtts.cpp
@@ -1,6 +1,6 @@
/***********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2014, International Business Machines Corporation
+ * Copyright (c) 1997-2015, International Business Machines Corporation
* and others. All Rights Reserved.
***********************************************************************/
@@ -436,6 +436,19 @@ void DateFormatRoundTripTest::test(DateFormat *fmt, const Locale &origLocale, UB
else if (hasZoneDisplayName && d[0] < 0) {
maxSmatch = 2;
}
+ else if (timeOnly && !isGregorian && hasZoneDisplayName && maxSmatch == 1) {
+ int32_t startRaw, startDst;
+ fmt->getTimeZone().getOffset(d[1], FALSE, startRaw, startDst, status);
+ failure(status, "TimeZone::getOffset");
+ // If the calendar type is not Gregorian and the pattern is time only,
+ // the calendar implementation may use a date before 1970 as day 0.
+ // In this case, time zone offset of the default year might be
+ // different from the one at 1970-01-01 in PST and string match requires
+ // one more iteration.
+ if (startRaw + startDst != -28800000) {
+ maxSmatch = 2;
+ }
+ }
}
/*
« no previous file with comments | « source/test/intltest/dtfmrgts.cpp ('k') | source/test/intltest/dtfmttst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698