diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-13 16:04:56 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-27 13:26:52 +0100 |
commit | 4785e39156312c995c39e68c8f80f2efba71c49f (patch) | |
tree | 8d3f03590cc54263cc43b7a97373998093381088 /src | |
parent | 58afadc624cf284cfe93d6a5c85557ed6e4f9765 (diff) |
QCalendar: increase coverage by tests
Added tests for aliases and various calendar properties, ensured
dateToJulianDay()'s invalid date branch is exercised. Corrected
assertion when constructing from system and asserted calendarSystem()
is as expected.
Pick-to: 5.15
Task-number: QTBUG-88183
Change-Id: I510afcb5d9d115f68148d1f679f3224d712f92f4
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/time/qcalendar.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/time/qcalendar.cpp b/src/corelib/time/qcalendar.cpp index dc554e8b3f..29c17f82c7 100644 --- a/src/corelib/time/qcalendar.cpp +++ b/src/corelib/time/qcalendar.cpp @@ -747,7 +747,8 @@ QCalendar::QCalendar() QCalendar::QCalendar(QCalendar::System system) : d(QCalendarBackend::fromEnum(system)) { - Q_ASSERT(d); + // If system is valid, we should get a valid d for that system. + Q_ASSERT(uint(system) > uint(QCalendar::System::Last) || (d && d->calendarSystem() == system)); } QCalendar::QCalendar(QLatin1String name) |