Fix wxPropertyGrid test case failing once every 4 years
Don't assume that the same date is valid in the previous year, as this is not the case for Feb 29.
This commit is contained in:
parent
a62d2dc9d9
commit
2464c900f5
1 changed files with 4 additions and 2 deletions
|
|
@ -819,9 +819,11 @@ TEST_CASE("PropertyGridTestCase", "[propgrid]")
|
|||
|
||||
#if wxUSE_DATETIME
|
||||
wxDateTime dt1 = wxDateTime::Now();
|
||||
dt1.SetYear(dt1.GetYear() - 1);
|
||||
if ( dt1.GetMonth() == wxDateTime::Feb && dt1.GetDay() == 29 )
|
||||
dt1.SetDay(28);
|
||||
|
||||
wxDateTime dt2 = wxDateTime::Now();
|
||||
wxDateTime dt2 = dt1;
|
||||
dt1.SetYear(dt1.GetYear() - 1);
|
||||
dt2.SetYear(dt2.GetYear() - 10);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue