Improve checks for dates range in wxQt wxCalendarCtrl

Account for the minimum and maximum dates supported by QDatePicker, both
in the code and in the test suite, which shouldn't rely on not having
any range restrictions in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1088
This commit is contained in:
chris2oph
2018-12-19 14:16:20 +00:00
committed by Vadim Zeitlin
parent 2a9462a260
commit 155a19a1a2
2 changed files with 23 additions and 5 deletions

View File

@@ -85,8 +85,13 @@ void DatePickerCtrlTestCase::Range()
// minimum as it doesn't support dates before 1601-01-01, hence don't rely
// on GetRange() returning false.
wxDateTime dtRangeStart, dtRangeEnd;
// Default end date for QT is 31/12/7999 which is considered valid,
// therefore we should omit this assertion for QT
#ifndef __WXQT__
m_datepicker->GetRange(&dtRangeStart, &dtRangeEnd);
CPPUNIT_ASSERT( !dtRangeEnd.IsValid() );
#endif
// After we set it we should be able to get it back.
const wxDateTime