summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings & deprs in tst_qcoreapplication and tst_qguiapplicationShawn Rutledge2019-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | It's perhaps best to ensure that functions we are deprecating shall no longer be used in tests. Also, fix the "0 as nullptr" warnings. Change-Id: I2f22c9b9482e80fa120bcd728ec269198a36678f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QLatin1String, QStringView: add containsAnton Kudryavtsev2019-06-041-0/+124
| | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added contains(). [ChangeLog][QtCore][QStringView] Added contains(). Change-Id: I19fd2e155180edd8620c520f4e60a1f86f0603ac Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QCommandLineParser: add --help-all, to show Qt options as wellDavid Faure2019-05-151-5/+62
| | | | | | | | | | | Sample output at http://www.kdab.com/~dfaure/2019/help-all-example.txt Fixes: QTBUG-41802 Change-Id: I7a3350200761d41481fcb10ec4328e96e548d246 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qhashfunctions.h: add specializations of std::hash for some Qt typesMarc Mutz2019-05-291-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a problem. Our types don't play well with the std unordered containers, because they do not specialize std::hash. We therefore force our users to come up with an implementation, hindering interoperability, since any two developers are unlikely to come up with compatible implementations. So combining libraries written by different developers will result in ODR violations. Now that we depend on C++11, and thus the presence of std::hash, we still face the problem that the standard does not provide us with a means to compose new hash functions out of old ones. In particular, we cannot, yet, depend on C++17's std::hash<std::string_view> to implement std::hash<QByteArray>, say. There's also no std::hash for std::tuple, which would allow easy composition by using std::tie(). So piggy-back on the work we have done over the years on qHash() functions, and implement the std::hash specializations for Qt types using the existing qHash() functions, with a twist: The standard allows implementations to provide means against predictable hash values. Qt has this, too, but the seed is managed by the container and passed to the qHash() function as a separate argument. The standard does not have this explicit seed, so any protection must be implicit in the normal use of std::hash. To reap whatever protection that std library has on offer, if any, we calculate a seed value by hashing int(0). This will be subject to constant folding if there's no actual seed, but will produce a value dependent on the seed if there is one. Add some tests. A question that remains is how to document the specialization. Can we have a \stdhashable QDoc macro that does everything for us? Task-number: QTBUG-33428 Change-Id: Idfe775f1661f8489587353c4b148d76611ac76f3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev"Friedemann Kleint2019-05-273-2/+6
|\
| * Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-273-2/+6
| |\ | | | | | | | | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| | * Fix new[] delete mismatch in testAllan Sandfeld Jensen2019-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | QScopedPointer uses normal delete, but we need delete[]. Change-Id: Id62a2c55f75ef4aa60580f5e04c4bf306a6dd3c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix canonicalFilePath() for files with trailing slashesVolker Hilsheimer2019-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such files do not exist (as per QFileInfo::exists), but on some platforms that rely on realpath(), QFileInfo::canonicalFilePath did not return the empty string. Use the same logic on macOS as we already did on Android, and include a test case. Remove the unnecessary dynamic memory allocation and use a stack-allocated array instead, unless we use modern POSIX in which case realpath() will alloc the memory for the result for us. Change-Id: Ide987c68ebf00cbb7b1a66c2e9245a12c7807128 Fixes: QTBUG-44242 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-161-1/+3
| | |\ | | | | | | | | | | | | Change-Id: I1bdc28a3ae825ea35e83f20fe16d2409515e5a3d
| | | * Skip flaky qfloat16 1/inf == 0 test on QEMU/Arm64Edward Welbourne2019-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not clear why this test fails - and only does so sometimes - but fail it does, so we ned to skip it to let development keep going. As it happens, the same platform over-optimizes various computations using qfloat16; which can at least be used to test for this platform, since it wrongly distinguishes two qfloat16 values that theory and all other platfomrs agree should coincide. Fixes: QTBUG-75812 Change-Id: Ie9463d7dc21bca679337b475d13417b9f42bbf9b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | | Tests: Fix some warnings about deprecated functions not under testFriedemann Kleint2019-05-276-26/+28
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings like: baselineserver/shared/baselineprotocol.cpp:295:72: warning: ‘int QImage::byteCount() const’ is deprecated: Use sizeInBytes [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:17: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:39: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:8153:60: warning: ‘T* QWeakPointer<T>::data() const [with T = const QNetworkSession]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations]. ... st_qprinter.cpp:1318:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_qprinter.cpp:1362:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_largefile.cpp:492:85: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_largefile.cpp:498:91: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_qabstractitemmodel.cpp:312:25: warning: ‘void QAbstractItemModel::reset()’ is deprecated [-Wdeprecated-declarations] ... tst_qabstractitemmodel.cpp:1793:28: warning: ‘void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray>&)’ is deprecated [-Wdeprecated-declarations] ... tst_qcolor.cpp:1425:33: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations] tst_qcolor.cpp:1432:31: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations] tst_qprinterinfo.cpp:303:61: warning: 'QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const' is deprecated [-Wdeprecated-declarations] tst_qprinterinfo.cpp:304:65: warning: 'QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const' is deprecated [-Wdeprecated-declarations] tst_qtextdocumentfragment.cpp:947:52: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] tst_qtextlayout.cpp:2261:61: warning: ‘void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange>&)’ is deprecated: Use setFormats() [-Wdeprecated-declarations] tst_qtextlayout.cpp:2330:42: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] tst_qitemselectionmodel.cpp:2214:37: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] ... tst_qtextlist.cpp:317:68: warning: 'bool QTextList::isEmpty() const' is deprecated: Use count() instead [-Wdeprecated-declarations] tst_qpainter.cpp:373:32: warning: ‘void QPainter::setMatrixEnabled(bool)’ is deprecated: Use setWorldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:374:40: warning: ‘bool QPainter::matrixEnabled() const’ is deprecated: Use worldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:702:45: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] tst_qpainter.cpp:1573:29: warning: ‘void QPainter::drawRoundRect(const QRect&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:76:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:81:41: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:105:30: warning: ‘virtual void QPdfWriter::setMargins(const QPagedPaintDevice::Margins&)’ is deprecated: Use setPageMargins(QMarginsF(l, t, r, b), QPageLayout::Millimeter) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:172:37: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:258:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp:3980:54: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] tst_qlocale.cpp:434:26: warning: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] ... Change-Id: I77c1a934b27119eedeb26a77c913686314a2a5c7 Reviewed-by: David Faure <david.faure@kdab.com>
* | | tst_QVariant: Fix warnings about deprecated functions not under test —Friedemann Kleint2019-05-241-247/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | Silence a warnings flood about qVariantFromValue(), QString::null and QWeakPointer::data(). Change-Id: I73347190c0fa396b39b9efd00447cf24e48259a0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Tidy up in tst_QDateTimeEdward Welbourne2019-05-221-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | Use QCOMPARE rather than QVERIFY an equality; ditch a stray blank line. Change-Id: Ie828837919fb9d3cc774d82d0eebcf7728fed645 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | Long live Qt::SplitBehavior!Marc Mutz2019-05-211-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The is a copy of the QString::SplitBehavior enum, but scoped in the Qt namespace instead of inside QString, where it creates problems using it elsewhere (QStringView, in particular). Overload all QString{,Ref} functions taking QString::SplitBehavior with Qt::SplitBehavior. Make Qt::SplitBehavior a QFlags for easier future extensions (e.g. a hint to use Boyer-Moore searching). Added tests in QStringApiSymmetry. [ChangeLog][QtCore] Added new Qt::SplitBehavior. [ChangeLog][QtCore][QString/QStringRef] The split functions now optionally take Qt::SplitBehavior. Change-Id: I43a1f8d6b22f09af3709a0b4fb46fca61f9d1d1f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QFileSystemWatcher: lock autotest code away into a cold sectionMarc Mutz2019-05-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code contained a sizeable chunk of string parsing along with qDebug()s in the normal path of execution. That code, however, was only used for Qt's own autotests. The idea of this patch is, then, to not only move the autotest case into the cold text section (using Q_UNLIKELY), but also to completely exclude it, when QT_BUILD_INTERNAL is not set. Unfortunately, the structure of the function did not really lend itself to #ifdefing that part of the code out (production code was in the middle of non-production code), so I transformed the engine selection code into a lambda, replacing assignment with returns, and swapping the branches of the central if around to yield a single block of code that can be excluded from compilation with just one #ifdef. As a consequence, the runtime code is almost unaffected, and the function is much easier to read now. Since the test-specific code is only compiled into Qt now in developer builds, guard the tests that rely on this behavior with the same macro. Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QStateMachine: handle parallel child mode for state machinesErik Verbruggen2019-05-161-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the childMode property to ParallelStates will result in an invalid state machine. This is never checked (worse, we explicitly allow it and have a constructor to set it), but it results in findLCCA failing, which then results in a failing assert or crash. This fix in this patch is to handle this case separately. The proper fix would be to remove completely the ability to set the childMode on a QStateMachine, but that will have to wait until Qt6. Fixes: QTBUG-49975 Change-Id: I43692309c4d438ee1a9bc55fa4f65f8bce8e0a59 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-151-1/+26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| * | Add 'well-formated' JSON string valuesMichal Klocek2019-05-141-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for surrogate code points U+D800 through U+DFFF, represent them with JSON escape sequences. https://github.com/tc39/proposal-well-formed-stringify Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | tst_qrandomgenerator: replace QLinkedList with a std::listMarc Mutz2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation of deprecating QLinkedList. This actually simplifies the code, since std::list has a ctor from size, which QLinkedList lacks, and which the code worked around by using initializer_list. Change-Id: I07f9d590f863d9e4e00de73339cdfa27079f6e03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-132-6/+85
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-092-6/+85
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Fix integer overflows in QDeadlineTimerKonstantin Shegunov2019-05-081-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the deadline is far in the future, the conversions to nanoseconds or internal arithmetic may overflow and give an invalid object, thus the deadline may end up in the past. Added a test to the testlib selftest for sleep. [ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows leading to immediate timeouts. Task-number: QTBUG-69750 Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Update locale data to CLDR v35.1Edward Welbourne2019-05-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formatting of times in Norwegian has reverted to using dots in place of colons, as it did before v31 (commit 82deb0ad1), so reverted the tests to their state before that. Change-Id: I8a09ce253731bb0f0f3caca117f06ad568940a81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Support POSIX rules as $TZ valuesEdward Welbourne2019-05-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TZ environment variable can validly contain a POSIX rule, rather than an IANA ID, as described here: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 However, if TZ were set to such a value, leading to it being used as systemTimeZoneId(), it would be passed to QTzTimeZonePrivate::init(), which is a no-op unless it manages to open a zoneinfo/ file with the given ianaId as name. When the environment variable doesn't name a zoneinfo/ file, we would thus get an invalid time-zone. We can, instead, check whether the ianaId looks like a valid POSIX rule and, if it does, use it as m_posixRule, enabling us to correctly handle this case. Tweak parsing of POSIX rules so that a zone using name "UTC" or "GMT" with an offset other than 0 will be rejected as invalid. This avoids parsing a zone name such as "GMT+17" or "UTC+00:01" as a POSIX rule, where it should be understood as an offset from UTC (and only certain well-established offsets are supported). Added two test-cases to tst_QTimeZone::tzTest() for validity of a POSIX zone value - a simple one constructed during discussion of the bug, the other taken from an example in: http://leaf.sourceforge.net/doc/buci-tz3.html Task-number: QTBUG-75565 Change-Id: Ia5cb1cc56b13b0f6b56258e48be98d04d909e32a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QStringView, QLatin1String: add indexOf methodsAnton Kudryavtsev2019-05-101-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added indexOf(). [ChangeLog][QtCore][QStringView] Added indexOf(). Change-Id: I9f56e5b40030e39b29e50914a46beb58013b537b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Migrate Windows system libs to external dependenciesJoerg Bornemann2019-05-087-7/+7
| | | | | | | | | | | | | | | | | | Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Deprecate conversion functions between QList and QSetLars Knoll2019-05-072-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users should use range constructors instead to do the conversion. Keep conversion methods between QList and QVector as these will turn into a no-op in Qt 6, whereas forcing people to use range constructors would lead to deep copies of the data. Change-Id: Id9fc9e4d007044e019826da523e8418857c91283 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add swapItemsAt() to QVectorLars Knoll2019-05-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This closes one compatibility gap with QList, to make it easier to replace QList with QVector in Qt6. Change-Id: I5655bc4cd2150a6f09a1ed68c0742f3b42ca47e4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-072-2/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp src/corelib/kernel/qvariant.h src/corelib/tools/qlist.h Done-With: Milian Wolff <milian.wolff@kdab.com> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I6803f7239aa137a51a7467fab7cc7a01302a848d
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-05-022-2/+7
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.cpp Change-Id: I8ca1163a1fa8072dcd16ea4426c58219149599fd
| | * Ignore failing test for free space on APFSVolker Hilsheimer2019-04-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The file system appears to cache too aggressively, so if the reported storage size doesn't change after flushing to disk, ignore the failure. Change-Id: Iba7dce79591447fac296bfe92c2dc993d36d0c2a Fixes: QTBUG-69868 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Remove cruft from testProcessEOF.proJoerg Bornemann2019-04-301-2/+0
| | | | | | | | | | | | | | | | | | | | | TEMPLATE_PREFIX is gone since Qt 5.0.0. Change-Id: I181962b942191187baf62f13d0abd17e7ebdcce1 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | | Deprecate {to,from}Std{List,Vector}Lars Knoll2019-05-052-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | ask our users to use the range constructors instead. This will allow us to remove the include dependency towards <list> and <vector> in Qt 6. Change-Id: Id90f2058432e19941de1fa847100a7920432ad71 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Prefix QTextStream operators with Qt:: in testsLars Knoll2019-05-038-42/+42
| | | | | | | | | | | | | | | Change-Id: I852f016fcb619a9e634deee6efb1fe7930d974c8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Don't use deprecated APILars Knoll2019-05-032-23/+23
| | | | | | | | | | | | | | | Change-Id: Ic56c22a1be5e69b371991c3e9ad98a1106848e78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove handling of missing Q_COMPILER_INITIALIZER_LISTSAllan Sandfeld Jensen2019-05-0214-69/+1
| | | | | | | | | | | | | | | | | | Change-Id: Id65b39c787235a051262544932e6717d076f1ea0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-05-019-43/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove remaining handling of missing support for rvalue refs. Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add qobject_cast operators for std::shared_ptrGiuseppe D'Angelo2019-05-011-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mimicking what we currently have for QSharedPointer, but also adding * snake_case version (matching the ones in std) * rvalue-overloaded versions (matching the C++2a overloads). [ChangeLog][QtCore][QSharedPointer] Overloads of qSharedPointerObjectCast have been added to work on std::shared_ptr. Change-Id: I26ddffd82b000bf876e7c141fdce86a7b8c1d75a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QLineF: add intersects() as a replacement for intersect()Christian Ehrlicher2019-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLineF::intersect() does not follow the naming rules for functions. Therefore add a replacement function intersects() instead and also rename the return type from IntersectType to IntersectionType [ChangeLog][QtCore][QLineF] added QLineF::intersects() as a replacement for QLineF::intersect() Change-Id: I744b960ea339cb817facb12f296f78cca3e7d938 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
* | | QHash/QMultiHash: add range constructorsMarc Mutz2019-04-251-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMap and QMultiMap will go in a separate commit, due to QMap's insertion behavior that "reverses" the inserted elements. [ChangeLog][QtCore][QHash] Added range constructor. [ChangeLog][QtCore][QMultiHash] Added range constructor. Change-Id: Icfd0d0afde27792e8439ed6df3e8774696b134d3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add startOfDay() and endOfDay() methods to QDateEdward Welbourne2019-04-242-2/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These methods give the first and last QDateTime values in the given day, for a given time-zone or time-spec. These are usually the relevant midnight, or the millisecond before, except when time-zone transitions (typically DST changes) skip it, when care is needed to select the right moment. Adapted some code to make use of the new API, eliminating some old cruft from qdatetimeparser_p.h in the process. [ChangeLog][QtCore][QDate] Added startOfDay() and endOfDay() methods to provide a QDateTime at the start and end of a given date, taking account of any time skipped by transitions, e.g. a DST spring-forward, which can lead to a day starting at 01:00 or ending just before 23:00. Task-number: QTBUG-64485 Change-Id: I3dd7a34bedfbec8f8af00c43d13f50f99346ecd0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QtTestLib: handle float16 the same as double and floatEdward Welbourne2019-04-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QCOMPARE, handle NaNs and infinities the way tests want them handled, rather than by strict IEEE rules. In particular, if a test expects NaN, this lets it treat that just like any other expected value, despite NaN != NaN as float16 values. Likewise, format infinities and NaNs specially in toString() so that they're reported consistently. Enable the qfloat16 tests that depend on this QCOMPARE() behavior. Refise the testlib selftest's float test to test qfloat16 the same way it tests float and double (and format the test the same way). This is a follow-up to 37f617c405a. Change-Id: I433256a09b1657e6725d68d07c5f80d805bf586a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Implement qFpClassify(qfloat16)Edward Welbourne2019-04-241-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | This extends support for qfloat16 sufficiently for the things testlib needs in order to treat it as a first-class citizen. Extended tests for qfloat to check qFpClassify() on it. Change-Id: I906292afaf51cd9c94ba384ff5aaa855edd56da1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Implement std::numeric_limits<qfloat16>Edward Welbourne2019-04-241-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This shall make it more nearly a first-class numeric type; in particular, I need some of these for testlib's comparing and formatting of float16 to handle NaNs and infinities sensibly. Change-Id: Ic894dd0eb3e05653cd7645ab496463e7a884dff8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-244-8/+42
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/util/qshaderformat.cpp src/gui/util/qshaderformat_p.h src/widgets/graphicsview/qgraphicsitem_p.h Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
| * | Purge use of some deprecated methods from QDateTime testsEdward Welbourne2019-04-231-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTime's short names setUtcOffset() and utcOffset() have been deprecated since 5.2, in favor of setOffsetFromUtc() and offsetFromUtc(). QDate's shortDayName() and shortMOnthName() have been deprecated since 5.10, in favor of QLocale's dayName() and monthName(). Also, the tests that were using them are testing methods only present when the datestring feature is enabled; so condition them on that feature. Change-Id: Ibfd4b132523ca8fbc1cb163353a44e0500877fd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-04-163-1/+30
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale.qdoc tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Done-with: Edward Welbourne <edward.welbourne@qt.io> Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I88e0757b2d020f0a244714c87844631df4b3fd13
| | * corelib: invokeMethod: Allow non copyable functors to be usedHugo Beauzée-Luyssen2019-04-122-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QMetaObject] Non-copyable lambdas can now be used with invokeMethod(). For consistency reasons, the functor object is now always moved. Fixes: QTBUG-69683 Change-Id: I66ff5e21d6d1926f0f7c5f8c304bed1a90b69917 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix resolving NTFS symbolic links that point to UNC sharesVolker Hilsheimer2019-04-101-23/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this change, the target of a symbolic link that points to a UNC share would include UNC in the target path, and not be correctly made absolute. Add a relevant test case, and use the opportunity to factor out the helper code that creates NTFS symlinks into a function that takes care of error handling. The file created with the new test case only gets cleaned up correctly when passing the file path into QDir::rmdir, which is either way the right thing to do. [ChangeLog][QtCore][QFileInfo] Fixed resolving of symbolic links to UNC shares on NTFS file systems. Change-Id: I9ba75d627aedf7c4cc289f0cb71088d795d30d8a Fixes: QTBUG-73688 Task-number: QTBUG-63970 Task-number: QTBUG-30401 Task-number: QTBUG-20791 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>