fix leap year issues in testsuites

This commit is contained in:
Guenter Obiltschnig 2016-02-29 10:18:11 +01:00
parent 1a8479f7ea
commit 6c66d0b49e
2 changed files with 4 additions and 4 deletions

View File

@ -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());

View File

@ -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(),