summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add function to access QLockFile's file nameShantanu Tushar2020-10-181-0/+1
| | | | | | | | This is useful in cases like error handling when you need to print the name of the lock file. Change-Id: Ife4901ed53ae81d19e68cce7f1c173ef3745d56f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_containerapisymmetry: code tidiesGiuseppe D'Angelo2020-10-181-174/+18
| | | | | | | | We now require C++17 and thus C++11 features or standard headers should no longer be conditional. Change-Id: I6b72306e809f71ec77acf7ffb97e2ed2ccd96e9d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Swallow some runtime warnings from tst_qapplicationVolker Hilsheimer2020-10-181-0/+2
| | | | | Change-Id: I226c3b55a1666eb3ccd369a3307919d4c72a2600 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix compile warning from testing deprecated signalVolker Hilsheimer2020-10-181-7/+46
| | | | | | | Silence the warning, and test event delivery in addition. Change-Id: I59c49a2ac70ecd32429116b76643700a7ad5ce3e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Split QMutex and QRecursiveMutexLars Knoll2020-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | These classes should not inherit from each other anymore in Qt 6. The reason is that this makes the 95% case of using a non-recursive mutex much slower than it has to be. This way, QMutex can now inline the fast path and be pretty much as fast as QBasicMutex is in Qt 5. They actually use the same code paths now. The main difference is that QMutex allows calling tryLock() with a timeout, which that is not allowed for QBasicMutex. [ChangeLog][QtCore][QMutex] QMutex does not support recursive locking anymore. Use QRecursiveMutex for that purpose. QRecursiveMutex does not inherit QMutex anymore in Qt 6. Change-Id: I10f9bab6269a9181a2e9f534fb72ce65bc76d989 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refactor QMutexLocker to be able to handle recursive mutexesLars Knoll2020-10-172-4/+4
| | | | | | | | Since we're going to split QMutex and QRecursiveMutex into separate classes, make sure QMutexLocker is prepared for that. Change-Id: Id5e9a955d1db7c8ee663dd3811ad6448dad0aeae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cleanup remaining QVariant::Type uses in Qt SqlLars Knoll2020-10-175-243/+243
| | | | | Change-Id: Ibcaa678cd9f9c957392a75b477fa6821f9a69127 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qmake: Fix qHash-related integer conversion warningsFriedemann Kleint2020-10-171-1/+1
| | | | | | | Use size_t instead of uint. Change-Id: I1dc38f61653f9bfc4ddeddcc65b0271aa4ad1256 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix compile warnings from ignored return valueVolker Hilsheimer2020-10-171-2/+2
| | | | | | | | The return value can be ignored here, so make intention clear. Change-Id: I116869c47039b159db96f133b5850a2215873c2f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move file of test helpers out of directory for qtconcurrentmap testsAndreas Buhr2020-10-163-2/+2
| | | | | | | | | | | The test helpers are used both in the qtconcurrentmap tests and in the qtconcurrentfilter tests. In the future, they should also be used in generated tests. This patch moves the function out of the qtconcurrentmap folder as it is not specific to 'map'. Change-Id: Ie79a7ae3040a7eab7364a3aabf934158c7527b5a Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Test QImage move semanticsAllan Sandfeld Jensen2020-10-161-2/+33
| | | | | | | Tests the move semantics of QImage in Qt6. Change-Id: Ia4d95f0b88ca7dde0daf85a0f53049b42b5be1a5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix some compiler warnings from testsVolker Hilsheimer2020-10-162-3/+3
| | | | | | | | For iterators that return a value, don't use reference in ranged for, and cast numeric literal to correct size type for QCOMPARE. Change-Id: Idfd09dbc2ef3ab1bf025c7859ea6e2e9572bc9a1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QAbstractItemView: don't lose items if model only allows MoveActionVolker Hilsheimer2020-10-161-19/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a model only allows MoveAction, then calls in the view/widget subclasses' dropEvent implementation to set the event's drop action to CopyAction will fail. QAbstractItemView will then remove the item when QDrag::exec returns. Instead of abusing the event actions for this, store explicitly that the dropEvent implementation already moved the item. If the flag is set, don't remove the item. In QListView, which uses moveRow to move items in the dropEvent handler, handle the case that the model might not implement moveRows. In that case, or when dropping an item onto another item (to overwrite data), fall back to the default implementation of QAbstractItemView. Sadly, it is impossible to know whether a model doesn't implement moveRows, or whether the move failed for other reasons, so this requires a bit of extra special case handling. QListView in IconMode is particularly odd in that it moves the item in the view, but not in the model. This follows up on fd894fd68edf3d67975cda8eb9dda43646887b0d and fixes additional issues discovered during debugging. Extend the existing unit test; since drag'n'drop runs a modal, native event loop on most systems, it still only runs on the Xcb platform. Change-Id: I6c5377e2b097c8080001afe904d6d3e4aed33df4 Pick-to: 5.15 Fixes: QTBUG-87057 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fix warning in test: unused capture in lambdaVolker Hilsheimer2020-10-161-1/+1
| | | | | | | Change-Id: Ifa9bab843feb670f8400c26fd78f96db55bfd79e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* Rename QPromise starting and finishing methods to start and finishAndrei Golubev2020-10-162-36/+36
| | | | | | | | | Proposed during API review Change-Id: I9c43e1915c50803ab69bfe07a91c05d2224b86c4 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Make QPromise::addResult() return boolean status of operationAndrei Golubev2020-10-162-51/+51
| | | | | | | | | | | | | | | Changed QPromise::addResult() to return bool value. True is returned when result is added and false is returned when e.g. promise is in final state (canceled or finished) or when addResult() is called twice with the same index as argument (in which case new value is rejected) Updated QFutureInterface::reportFinished() that accepts optional result as argument to align with other result adding methods. This function is "internal" only (as of now), so no documentation update is needed Change-Id: I2d63069246e5e5c8cf04529c22bb296faaaae53d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QSslSocket (autotest) - defuse a time bombTimur Pocheptsov2020-10-161-13/+16
| | | | | | | | | | | Interesting, it only exploded now - initially we were too fast (faster than 500 ms) so never noticed. Now that more tests with the similar event loop handling were introduced, the last one was catching a single-shot timer signal, accessing long dead object). Fixes: QTBUG-87612 Change-Id: I52446fa7b08ef90a4742af3662da7837a8602941 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix warning: helper functions are only used on some platformsVolker Hilsheimer2020-10-161-2/+2
| | | | | | | | Tag them as [[maybe_unused]] to silence compiler on platforms where they are not used. Change-Id: I12243c0409c66863617f073f968e50f913c58a67 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Purge QDesktopWidgetVolker Hilsheimer2020-10-161-1/+0
| | | | | | | | | | | | It's no longer used; the only calls to QApplicationPrivate::desktop pass the default nullptr for QScreen, so all we need is a Qt::Desktop type toplevel widget. Include changes documentation about both the class and QApplication::desktop being gone in Qt 6. Change-Id: I22d6e93cabc6aaaefffe5e96942886a2ef4e0609 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QLocalSocket/Win: prevent writing to broken pipeAlex Trotsenko2020-10-151-0/+1
| | | | | | | | | | | | When a peer closes the connection, the device remains opened for reading purposes. However, we should disable writing on disconnected socket. Otherwise, if the user issues a write() call, a new pipe writer object will be created and the write call occurs with invalid handle value. Pick-to: 5.15 Change-Id: Id136798c7663df1fce7ed0aa4e3c6f5c65218a11 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Manual tablet test: Add a window showing the devicesFriedemann Kleint2020-10-151-0/+69
| | | | | | Task-number: QTBUG-46412 Change-Id: I9cb9bb3493728186e1e6b140308c292ca9662e55 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* rhi: Fix up vertex inputs with matricesLaszlo Agocs2020-10-144-19/+20
| | | | | | | | | | | | In order to prevent too much voodoo in backends like D3D11, the input layout is expected to specify the slice index for vecX that are part of an unrolled matrix. Also deoptimize the instancing manual test to exercise a matrix too instead of just vectors. Change-Id: If2dcbcbc483645ce2420b2f87dda765b95da6e80 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix compile time type normalization codeLars Knoll2020-10-143-5/+45
| | | | | | | | | | | | | | | | | | | | | Use a simpler constexpr to generate type name on gcc This works around an ICE on gcc in release mode when compiling with PCH enabled. As the type we're getting from Q_FUNC_INFO is already in a somewhat normalized form, this requires significanlty less processing and esp. not a recursive constexpr method which I suspect triggers the ICE. Fix integer type conversions to also properly normalize long long values (to q(u)longlong. Make sure the mapping also works on MSVC, where long long types get mapped to __int64. Also, normalize unsigned short and unsigned char to ushort and uchar, respectively, to follow the convention set by uint and ulong. Add some test cases to verify the mappings. Change-Id: I3dec5764450bf22ab6f066597803c3f46c2cd5ac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Schannel: TLS1.3 supportMårten Nordheim2020-10-141-20/+32
| | | | | | | | | | | | | | | | | | | | | | It's not possible to connect to microsoft.com with Schannel TLS 1.3 for some reason (also tested with Internet Explorer), but other sites work fine. Must be something they have to iron out for later. In my experience this needs a preview release of Windows. One of my machines is opted into the dev channel of Windows where they enabled TLS 1.3 by default, and it works well in my tests except for the part above. On my other machine, after enabling TLS 1.3 through the registry, I fail to complete the handshake with any site. So around March/April next year is when this code would activate for most people. MinGW apparently defines NTDDI_VERSION as the one for Windows Server 2003, so it currently doesn't build the new TLS 1.3 code. In Qt (as a project) we could consider setting this higher, but that's out of scope for this patch! Fixes: QTBUG-81294 Change-Id: If329959c3a30ecbfbb8c0d335cc39ccb6d012890 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tests: blacklist two tests on Ubuntu 20.04Liang Qi2020-10-142-0/+4
| | | | | | | | | | | | tst_QApplication::sendEventsOnProcessEvents() and tst_QItemDelegate::editorKeyPress() There is some issue with the glib event dispatcher. Task-number: QTBUG-87137 Pick-to: 5.15 Change-Id: I79a983192edef3c3560a4296cc9dea2dfc2ee1b0 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Get rid of all usage of QApplication:desktopVolker Hilsheimer2020-10-1411-57/+22
| | | | | | | | Use QScreen APIs instead. Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Reject overwrites by the same index in QPromise::addResult()Andrei Golubev2020-10-132-6/+195
| | | | | | | | | | | | One can call addResult(value, index) twice and consequently set the value twice by the same index. This seems rather strange and probably should not be allowed. This commit rejects setting results when there's already a valid result by that index. Consequently, this fixes memory leaks caused by N-times-called addResult(..., index) Fixes: QTBUG-86828 Change-Id: I77494f2cb73ce727ffad721cfcdcaa420899eb25 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Loosen the requirements on the container passed to QtConcurrent::map*Sona Kurazyan2020-10-131-2/+0
| | | | | | | | | | | | Using std::begin() and std::end() forces the user to have const begin() and end() member functions being defined for the passed container. This is because std::declval<T>() returns rvalue which forces the compiler to select std::{begin, end}()(const Container &c) overloads and an test for a presence of const {begin, end}() methods. Change-Id: I9d96d9f73891ece53224f1741a1334500f7b35ad Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove timeStep parameter from QAnimationDrive::advanceAnimationVolker Hilsheimer2020-10-131-2/+2
| | | | | | | | | | | | This reverts commit 7544c242cb935b5ff625e54c3facceea535c6ae5, which reverted the first removal of the parameter under the assumption that it caused flakiness in tests. The flakiness was instead caused by changes to the wait functions in QTest, so remove the parameter again. Change-Id: I98154d5d7268375aebbcb09de757e75d9b765c5f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qDebug: Avoid implicit QVariant conversionFabian Kosmale2020-10-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | This commit restricts operator<<(QDebug lhs, QVariant rhs) to only work if rhs is actually of type QVariant (instead of any type convertible to QVariant). This is especially important as a) we check in QMetaType whether (slightly simplified) QDebug{} << std::declval<T>() is valid, and if so, register a function which simply uses the operator. b) In QVariant, we ask the metatype system for the contained types registered debug function and then use it. If a type now does not have its own operator<< for QDebug, but is implicitly convertible to QVariant containing itself, this would lead to an infinite recursion, when trying to use qDebug with that type. The registered function in a) would just convert the type to QVariant, and then ask the QVariant to print itself. Disallowing implicit conversions in qDebug in general was considered (i.e. adding template<typename T> operator<<(T) = delete in QDebug ), but discarded as it breaks too much code relying on conversions. Fixes: QTBUG-87122 Change-Id: Ib709297670cbc6cc307efd0dfd8e5b0279df9414 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fallback to using the family when doing an exact matchAndy Shaw2020-10-121-0/+15
| | | | | | | | | | If the difference between the families sizes is just 1 where one of them is 0 in size then we can fallback to the family in that case. Pick-to: 5.15 Fixes: QTBUG-87267 Change-Id: I62b25b06c88000b4d7defe91871c07873b1fc792 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Enable some-of the QtConcurrent test casesSona Kurazyan2020-10-122-8/+9
| | | | | | | | | | | QtConcurrent::filtered test-cases for move-only containers were failing to compile, because it is assumed that the passed container should have value_type defined. Change-Id: I3e9e5ebc07704cb98a15b125ae8bd5b5a84d497a Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Temporarily disable QFuture::takeResult() methodSona Kurazyan2020-10-121-0/+8
| | | | | | | | | | | | QFuture::takeResult() currently returns std::vector instead of QList, because QList does not support move-only types. Disable this method until QList is fixed to work with move-only types in Qt 6.1. Also did minor doc-fixes. Change-Id: I87feaf75d9433a3b540edd00039c3e21d6994985 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Handle notifier list modification during iterationFabian Kosmale2020-10-121-0/+53
| | | | | | | | | | | | | | As propertyobservers can execute arbitrarily complex code, they can also modify the obsever list in multiple ways. To protect against list corruption resulting from this, we introduce a protection scheme which makes the list resilient against modification. A detailed description of the scheme can be found as a comment in QPropertyObserverPointer::notify. Task-number: QTBUG-87153 Change-Id: I9bb49e457165ddc1e4c8bbdf3d3c9fbf5ff27e94 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve QRectF::toRect()Allan Sandfeld Jensen2020-10-121-6/+6
| | | | | | | | | Implement the better rounding mechanism that was previously blocked by requiring C++14 to be constexpr. Change-Id: I4e5b179ce0703f5c0b41c3f0ea00d28dfe53740c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* rhi: Make the new direct buffer update available for non-uniform buffersLaszlo Agocs2020-10-122-2/+218
| | | | | | | | | | | | | | | | | The original restriction to UniformBuffer was due to the GL backend where there is no GL buffer object for QRhiBuffers with usage UniformBuffer. However, we can still implement this for cases when there is a true GL buffer object underneath. With other backends it should all work as-is already. This becomes useful when one has buffers with usage Vertex that need full updates every frame. (f.ex. instance data) Unfortunately this involves renaming the function. But while at it, add an autotest case as well. Change-Id: Iff59e4509a8bae06654cc92fe8428bd79eb012fb Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Regenerate shaders for some manual testsLaszlo Agocs2020-10-1110-1/+0
| | | | | | | The qsb files seem to be out of date for those two. Change-Id: Id832e872667cac4d364e13c440011109a6dbdc7f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Add a many cubes manual testLaszlo Agocs2020-10-1112-11/+290
| | | | | | | Draw 25000 cubes while doing a uniform buffer update for each. Change-Id: I2216641c8bf7c6ea147fe3edd679317b472e1f04 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Clear pending results in ResultStoreAndrei Golubev2020-10-091-0/+75
| | | | | | | | Pending results were never cleared by result store. This led to memory leaks when the results never transitioned to "visible" results Change-Id: I674302eb51542ad5f4d918da68d616428c73ae9f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Clean up tst_QLocale::testNames(), give better message on failureEdward Welbourne2020-10-091-27/+28
| | | | | | | | | | It was previously casting enum values to int, which produced unhelpful answers when a test failed. Better to have them as enum values that get printed as their names, which are actually informative. Change-Id: I1bf2971b1426bdbbc321bb48f45ee3e5799e76ec Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Check validity before adding to a QDateTimeEdward Welbourne2020-10-091-2/+44
| | | | | | | | | | | QDateTime's addDays(), addMonths() and addYears() neglected to check for validity before doing their job, with the result that they could produce "valid" (but wildly inappropriate) results if used on an invalid date-time. Added tests for this case (and the boundary). Change-Id: I7b0d638501cb5d875a678cde213547a83ed7529e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Check against {und,ov}erflow in more QDateTime methodsEdward Welbourne2020-10-091-18/+60
| | | | | | | | | | QDateTime's range of possible values is wider than anyone generally needs, but let's not do confusing things when someone does overflow it. Change-Id: Ifbaf7a0f02cd3afe7d3d13c829bf0887eba29f7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Check value is in range when setting a QDateTimeEdward Welbourne2020-10-091-11/+31
| | | | | | | | | | | | | | | | | | | Previously, a QDate representing more than about 0.3 gigayears before or after the epoch would overflow the millisecond count and produce a "valid" date-time that didn't represent the date and time passed to its constructor. Changed to detect such overflow and produce an invalid date-time instead, if it happens. Corrected some tests that wrongly expected to be able to represent extreme date-time values with every time-spec. The (milli)seconds since epoch are from UTC's epoch, so converting to another offset, zone or local time may give a value outside the actual range. Added some tests for the actual exact bounds. Task-number: QTBUG-68855 Change-Id: I866a4974aeb54bba92dbe7eab0a440baf02124f0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Avoid repeated date-time formatting in test data namingEdward Welbourne2020-10-091-14/+16
| | | | | | | | Also correct two comments which lied about the year being tested. Change-Id: I5be491a2b2c1e0c3b49d6ff9a8de852e17321cff Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QTcpSocket::connectToHostError - increase the timeoutTimur Pocheptsov2020-10-081-4/+5
| | | | | | | | | | | As suggested by the message from QTestLib. This, indeed, fixed the sadistic test. Also, make sure resources are not leaked. Pick-to: 5.15 Fixes: QTBUG-87009 Change-Id: Id693a5a562ea5ebacc853e5fc0ab9654ba851e72 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Allow getting a const pointer out of a variant containing pointerFawzi Mohamed2020-10-081-0/+12
| | | | | | | | | | | | | Currently A a; QVariant::fromValue(&a).value<const A*>() == nullptr; Still casting non const to const is safe, and worked in Qt5. After this change A a; QVariant::fromValue(&a).value<const A*>() == &a; Change-Id: I257049d084c712b00a338a2943d379aa478e0981 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QADP capacity functions use qsizetype instead of size_tAndrei Golubev2020-10-081-15/+15
| | | | | | | | | | | | | | | Change types returned and accepted by capacity-related QArrayDataPointer functions to qsizetype: 1) QArrayData (underlying d-ptr) works with qsizetype 2) QArrayDataPointer::size is of type qsizetype 3) All higher level classes that use QADP (e.g. containers) cast capacity to qsizetype in their methods Additionally, fixed newly appeared warnings through qtbase Change-Id: I899408decfbf2ce9d527be7e8b7f6382875148fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-07212-473/+477
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add unit tests to assure QtConcurrent works on move-only sequencesAndreas Buhr2020-10-073-78/+291
| | | | | | | | | Unit tests are added to make sure QtConcurrent works on move-only sequences. Change-Id: I1d066f75ceab9cef98832e96c5827103cbfd72a8 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Allow millisecond-overflow when the result remains validEdward Welbourne2020-10-072-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even before adding support for fractional hours, a fraction of a minute might potentially have represented a whole number of seconds by a fractional part that, due to rounding, was less than the whole number of seconds by less than half a millisecond. Previously, the parsing would have clipped the fractional part at 999 milliseconds, in the preceding second, instead of correctly rounding it up to the whole second. For QTime::fromString(), which can't represent 24:00, and for TextDate, which doesn't allow 24:00 as a synomym for the next day's 0:0, applying such rounding to 23:59:59.999999 would produce an invalid result from a string that does represent a valid time, so use the nearest representable time, as previously. Added some tests and amended others. [ChangeLog][QtCore][QDateTime] QDateTime and QTime, in fromString() with format ISODate or TextDate, now allow a fractional part of the hour, minute or seconds to round up to the next second (hence potentially into the next minute, etc.) when this is the closest representable value to the exact fractional part given. When rounding up would turn a valid result into an invalid one, however, the old behavior of clipping to 999 milliseconds is retained. Change-Id: I8104848d246cdb4545a12819fb4b6755da2b1372 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>