mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 12:40:02 +00:00
ICU-1612 Fix SimpleTimeZone::setDSTSavings
X-SVN-Rev: 7437
This commit is contained in:
parent
1a9a17e498
commit
be02bc0060
2 changed files with 7 additions and 4 deletions
|
@ -186,7 +186,7 @@ void SimpleTimeZone::construct(int32_t rawOffsetGMT,
|
|||
|
||||
decodeRules(status);
|
||||
|
||||
if (savingsDST <= 0) {
|
||||
if (savingsDST < 0) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -654,9 +654,12 @@ SimpleTimeZone::setDSTSavings(int32_t millisSavedDuringDST)
|
|||
void
|
||||
SimpleTimeZone::setDSTSavings(int32_t millisSavedDuringDST, UErrorCode& status)
|
||||
{
|
||||
dstSavings = millisSavedDuringDST;
|
||||
if(dstSavings <= 0)
|
||||
if (millisSavedDuringDST < 0) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
}
|
||||
else {
|
||||
dstSavings = millisSavedDuringDST;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
|
|
|
@ -658,7 +658,7 @@ TimeZoneRegressionTest::Test4154525()
|
|||
|
||||
int32_t DATA [] = {
|
||||
1, GOOD,
|
||||
0, BAD,
|
||||
0, GOOD,
|
||||
-1, BAD,
|
||||
60*60*1000, GOOD,
|
||||
INT32_MIN, BAD,
|
||||
|
|
Loading…
Add table
Reference in a new issue