mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
fix leap year issues in testsuites
This commit is contained in:
parent
1a8479f7ea
commit
6c66d0b49e
@ -1225,7 +1225,7 @@ void DataTest::testDateAndTime()
|
||||
assert (dt.second() == t.second());
|
||||
|
||||
Date d1(2007, 6, 15);
|
||||
d1.assign(d.year() - 1, d.month(), d.day());
|
||||
d1.assign(d.year() - 1, d.month(), (d.month() == 2 && d.day() == 29) ? 28 : d.day());
|
||||
assert (d1 < d); assert (d1 != d);
|
||||
|
||||
d1.assign(d.year() - 1, 12, d.day());
|
||||
@ -1237,7 +1237,7 @@ void DataTest::testDateAndTime()
|
||||
assert (d1 < d); assert (d1 != d);
|
||||
}
|
||||
|
||||
d1.assign(d.year() + 1, d.month(), d.day());
|
||||
d1.assign(d.year() + 1, d.month(), (d.month() == 2 && d.day() == 29) ? 28 : d.day());
|
||||
assert (d1 > d); assert (d1 != d);
|
||||
|
||||
d1.assign(d.year() + 1, 1, d.day());
|
||||
|
@ -115,7 +115,7 @@ void HTTPCookieTest::testExpiryFuture()
|
||||
//1 year from now
|
||||
future.assign(future.year() + 1,
|
||||
future.month(),
|
||||
future.day(),
|
||||
(future.month() == 2 && future.day() == 29) ? 28 : future.day(),
|
||||
future.hour(),
|
||||
future.minute(),
|
||||
future.second(),
|
||||
@ -131,7 +131,7 @@ void HTTPCookieTest::testExpiryPast()
|
||||
// 1 year ago
|
||||
past.assign(past.year() - 1,
|
||||
past.month(),
|
||||
past.day(),
|
||||
(past.month() == 2 && past.day() == 29) ? 28 : past.day(),
|
||||
past.hour(),
|
||||
past.minute(),
|
||||
past.second(),
|
||||
|
Loading…
Reference in New Issue
Block a user