mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-05 16:26:27 +01:00
fix leap year issues in testsuites
This commit is contained in:
parent
9fef0338ce
commit
634fc133b6
@ -1265,7 +1265,7 @@ void DataTest::testDateAndTime()
|
|||||||
assert (dt.second() == t.second());
|
assert (dt.second() == t.second());
|
||||||
|
|
||||||
Date d1(2007, 6, 15);
|
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);
|
assert (d1 < d); assert (d1 != d);
|
||||||
|
|
||||||
d1.assign(d.year() - 1, 12, d.day());
|
d1.assign(d.year() - 1, 12, d.day());
|
||||||
@ -1277,7 +1277,7 @@ void DataTest::testDateAndTime()
|
|||||||
assert (d1 < d); assert (d1 != d);
|
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);
|
assert (d1 > d); assert (d1 != d);
|
||||||
|
|
||||||
d1.assign(d.year() + 1, 1, d.day());
|
d1.assign(d.year() + 1, 1, d.day());
|
||||||
|
@ -115,7 +115,7 @@ void HTTPCookieTest::testExpiryFuture()
|
|||||||
//1 year from now
|
//1 year from now
|
||||||
future.assign(future.year() + 1,
|
future.assign(future.year() + 1,
|
||||||
future.month(),
|
future.month(),
|
||||||
future.day(),
|
(future.month() == 2 && future.day() == 29) ? 28 : future.day(),
|
||||||
future.hour(),
|
future.hour(),
|
||||||
future.minute(),
|
future.minute(),
|
||||||
future.second(),
|
future.second(),
|
||||||
@ -131,7 +131,7 @@ void HTTPCookieTest::testExpiryPast()
|
|||||||
// 1 year ago
|
// 1 year ago
|
||||||
past.assign(past.year() - 1,
|
past.assign(past.year() - 1,
|
||||||
past.month(),
|
past.month(),
|
||||||
past.day(),
|
(past.month() == 2 && past.day() == 29) ? 28 : past.day(),
|
||||||
past.hour(),
|
past.hour(),
|
||||||
past.minute(),
|
past.minute(),
|
||||||
past.second(),
|
past.second(),
|
||||||
|
Loading…
Reference in New Issue
Block a user