qt5base-lts/tests/auto
Edward Welbourne 60deb69034 Distinguish invalid datetimes from others
A default-constructed QDateTime is invalid, but compared equal to a
valid one referencing the start of 1970.  This lead to date properties
in QML being initialized invalid but not getting an onChange if the
first value they're set to is the start of 1970.

Fixing that then lead to some tests failing. Indeed, the original
equality check involved using toMSecsSinceEpoch(), whose value is
undefined unless the datetime is valid, without a prior check on its
validity: so ensure all uses of toMSecsSinceEpoch() are guarded with
isValid() checks.

Reworked tst_QDateTime::toSecsSinceEpoch() to use its bool column
(previously unused, after separating from toTime_t(), which uses this
column for "out of time_t's range") for validity of the datetime.

[ChangeLog][QtCore][QDateTime] Invalid datetimes are now treated as
equal and less than all valid ones. They could previously be found
equal to valid datetimes.

Fixes: QTBUG-79006
Change-Id: Ie72deb8af4350a5e808144d0f6e42dc8eb3ff5ef
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 11:59:41 +02:00
..
bic/data Add binary compatibility files for Qt5.13.0 for QtBase 2019-08-15 04:19:39 +00:00
cmake CMake: Add support for auto-importing plugins in CMake 2019-08-12 18:23:58 +02:00
concurrent Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it 2019-07-12 14:26:30 +02:00
corelib Distinguish invalid datetimes from others 2019-10-11 11:59:41 +02:00
dbus unblacklist passing tests 2019-07-08 11:01:42 +00:00
gui Make QTextBlockFormat::MarkerType an enum class 2019-10-10 21:08:08 +02:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake
network Disable debug-and-release builds for MinGW 2019-09-18 06:28:16 +00:00
opengl Remove dead code from Qt 4 times 2019-08-20 22:27:46 +00:00
other Remove CFBundleGetInfoString from Info.plist templates 2019-10-04 13:09:34 +00:00
printsupport Remove the remaining usages of deprecated APIs of qtbase 2019-08-01 06:48:27 +02:00
shared Make tst_qwidget pass on High-DPI screens (Windows) 2019-06-03 10:41:08 +02:00
sql test: migrate QSqlDatabase test to QRegularExpression 2019-07-29 20:01:24 +02:00
testlib Fix crash when using signaldumper and sender is deleted 2019-09-23 08:27:18 +00:00
tools Make conflicting targets check less strict 2019-10-03 20:28:03 +02:00
widgets Merge remote-tracking branch 'origin/5.13' into 5.14 2019-09-30 14:43:02 +02:00
xml Convert uses of QTime as a timer to QElapsedTimer 2019-06-14 10:42:33 +02:00
auto.pro winrt: Skip network auto tests for now 2018-06-22 05:02:39 +00:00
network-settings.h test: migrate QNetworkReply test to QRegularExpression 2019-06-10 16:49:19 +02:00