mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 14:31:31 +00:00
ICU-5624 Updated DateFormatRoundTripTest to support the case when the test date falls in the LMT era. Before 64bit time zone data support, PST uses -8:00 offset for dates before Nov 18, 1883.
X-SVN-Rev: 27675
This commit is contained in:
parent
d9908563d0
commit
d8aaf83b90
1 changed files with 12 additions and 4 deletions
|
@ -381,10 +381,18 @@ void DateFormatRoundTripTest::test(DateFormat *fmt, const Locale &origLocale, UB
|
|||
int maxSmatch = 1;
|
||||
if (dmatch > maxDmatch) {
|
||||
// Time-only pattern with zone information and a starting date in PST.
|
||||
if(timeOnly && hasZoneDisplayName
|
||||
&& fmt->getTimeZone().inDaylightTime(d[0], status) && ! failure(status, "TimeZone::inDST()")) {
|
||||
maxDmatch = 3;
|
||||
maxSmatch = 2;
|
||||
if(timeOnly && hasZoneDisplayName) {
|
||||
int32_t startRaw, startDst;
|
||||
fmt->getTimeZone().getOffset(d[0], FALSE, startRaw, startDst, status);
|
||||
failure(status, "TimeZone::getOffset");
|
||||
// if the start offset is greater than the offset on Jan 1, 1970
|
||||
// in PST, then need one more round trip. There are two cases
|
||||
// fall into this category. The start date is 1) DST or
|
||||
// 2) LMT (GMT-07:52:58).
|
||||
if (startRaw + startDst > -28800000) {
|
||||
maxDmatch = 3;
|
||||
maxSmatch = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue