summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* QDecompressHelper: Change order of encodingsUlf Hermann2020-08-121-0/+2
| | | | | | | | | Before the introduction of QDecompressHelper gzip was preferred over deflate. The change seems to be accidental. Amends commit 7b76379a89158f10780cbfc74965027246faec68. Change-Id: I70f33d551912465d63f49ea3db1ac3575d19a92d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QJsonDocument: fix comparison of valid vs defaultThiago Macieira2020-08-111-0/+61
| | | | | | | | | | | [ChangeLog][QtCore][QJsonDocument] Fixed a bug that caused QJsonDocument's equality operator to crash if one of the operands was default-constructed and the other wasn't. Pick-to: 5.15 Fixes: QTBUG-85969 Change-Id: I5e00996d7f4b4a10bc98fffd1629f835f570ef6b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove old CBOR-based format from QShaderLaszlo Agocs2020-08-112-75/+0
| | | | | | | | | We only support version 4 and 5 in Qt 6.0. 1 and 2 are already gone (due to being based on binary JSON), now we remove 3 as well. Task-number: QTBUG-81346 Change-Id: I3627dcc0587f1e36f11e93edf7172889e911d64e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Sort out the overflow cases in tst_QDateTimeEdward Welbourne2020-08-111-13/+12
| | | | | | | | | Use the actual minimum value, rather than minus the maximum, and adapt the overflow expectations so that they're correct west of Greenwich as well as east. Change-Id: I7a5f4510db0fdea3855b5b2bd4c4a86882030efd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of last second in 1969Edward Welbourne2020-08-111-0/+12
| | | | | | | | Due to a limitation of mktime(), we would have declared it invalid. Tidied up qt_mktime() slightly in the process. Change-Id: I25469e314afee6e0394e564bc69a98883005d4ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cmake support for tst_mocFabian Kosmale2020-08-103-6/+155
| | | | | | | | | | | | | We use qt_wrap_cpp instead of AUTOMOC so that we can easily find the json files. Getting autorcc to run only after json file has been generated was deemed too tricky. Therefore the test is slightly modified to check for the json files in its directory instead of the resource, if the qrc file does not exist. Change-Id: Id1aabb117c8bab3ff81156da1f66d64e796bf18b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QFileInfo: purge deprecated APIEdward Welbourne2020-08-071-7/+1
| | | | | | | | Since 5.10: created() Since 5.13: readLink() Change-Id: I9722f81750dd92315a67a1c38df41a95ae63e0db Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Purge QResource of some deprecated APIEdward Welbourne2020-08-071-47/+1
| | | | | | | | Removed isCompressed(), deprecated since 5.15, and (since 5.13) addSearchPath() and searchPath(). Change-Id: I4b6fb8077c02bbe322334e474eaf0a2a7caf0004 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_QStringConverter: fix some deprecation warningsEdward Welbourne2020-08-071-10/+11
| | | | | | | QString's fromUtf16() prefers char16_t data over ushort. Change-Id: Ib20c5afa09ceabb4e91fe434b6a057edb4739a53 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPolygon: streamline constructors and special member functionsGiuseppe D'Angelo2020-08-071-4/+27
| | | | | | | | | | | Employ RO0; inherit the constructors from the base class; and do some code tidies as a drive by. The inherited constructors bring in goodies like initializer_list support. Change-Id: Ia00a3f9b0ccbf182bf837bc65ba2305110c8dc60 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDecompressHelper: Add brotli supportMårten Nordheim2020-08-064-0/+27
| | | | | | Task-number: QTBUG-83269 Change-Id: If23b098ee76a4892e4c2c6ce5c635688d8d9138d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Properly handle CONFIG += thread aka Threads::ThreadsAlexandru Croitor2020-08-067-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mkspecs/features/qt.prf adds a dependency on the system threading library if the Qt Core thread feature is enabled. Because qt.prf is loaded by any public or internal Qt project, it's essentially a public dependency for any Qt consumer. To mimic that in CMake, we check if the thread feature is enabled, and and set the Threads::Threads library as a dependency of Qt6::Platform, which is a public target used by all Qt modules and plugins and Qt consumers. We also need to create a Qt6Dependencies.cmake file so we find_package(Threads) every time find_package(Qt6) is called. For the .prl files to be usable, we have to filter out some CMake implementation specific directory separator tokens 'CMAKE_DIRECTORY_ID_SEP' aka '::@', which are added because we call target_link_libraries() with a target created in a different scope (I think). As a result of this change, we shouldn't have to hardcode Threads::Threads in other projects, because it's now a global public dependency. Task-number: QTBUG-85801 Task-number: QTBUG-85877 Change-Id: Ib5d662c43b28e63f7da49d3bd77d0ad751220b31 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QMap: fix insert() rvalue overloadsGiuseppe D'Angelo2020-08-061-0/+97
| | | | | | | | Receiving an rvalue still requires to check whether the parameter is detached, otherwise we can't steal its backing std::map. Change-Id: Ie88dbf39fd777112ad7bb20a46d5c2d65be8eb3d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-064-76/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QFontDatabase member functions staticEskil Abrahamsen Blomfeldt2020-08-064-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | QFontDatabase is a singleton and all instances would share a single, mutex-protected global data pointer. But some functions were implemented as non-static functions. This caused a lot of code on the form QFontDatabase().families(...) since there was no static access. Other functions were implemented as static. To consolidate, we make all functions static. This should be source-compatible, but not binary compatible. [ChangeLog][QtGui][Fonts] Some functions in QFontDatabase were in principle static, but previously not implemented as such. All member functions have now been made static, so that constructing objects of QFontDatabase is no longer necessary to access certain functionality. Fixes: QTBUG-83284 Change-Id: Ifd8c15016281c71f631b53387402c942cd9c43f6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Add QPointerEvent::is[Press|Update|Release]Event accessorsShawn Rutledge2020-08-062-0/+49
| | | | | | | | | | QQuickPointerEvent had them, so despite how trivial they look, it's very convenient to keep using them in QQuickWindow rather than duplicating these kinds of checks in various places, and for multiple event types too. Change-Id: I32ad8110fd2361e69de50a679ddbdb2a2db7ecee Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Implement UTF-16 to UTF-8 case-insensitive compare and make publicThiago Macieira2020-08-051-2/+28
| | | | | Change-Id: Ied637aece2a7427b8a2dfffd16116cf3645c6359 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make use of QDecompressHelper for HTTP downloadsMårten Nordheim2020-08-051-2/+6
| | | | | | | | | | Changes are not too big for now. Just replaces use of the previous calls to the zlib decompression function. And initialize QDecompressHelper when we know the content-encoding. Task-number: QTBUG-83269 Change-Id: I41358feaef2e7ac5f48f14e3f95ec094e0c110b7 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Establish baseline for QIcon test on dpr > 1Morten Johan Sørvig2020-08-056-26/+71
| | | | | | | | | | | | | | | | | | | | | | After enabling Qt::AA_UseHighDpiPixmaps, QIcon::pixmap() now returns pixmaps larger than the requested size on devicePixelRatio > 1 screens. Adapt tests to account for this changed behavior. Skip tests where it’s unclear what the the expected behavior is, or where the test logic does not apply to dpr > 1. This gives a clearer indication of where we are (39 passed, 0 failed, 9 skipped), and enables using the qicon test to catch regressions also when running at dpr > 1. Remove the "lowdpi" testcase flags from the qmake and cmake project files. Change-Id: Ia7ce722ae356fc496a91b54e9f5d590d13b9df62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Privately introducing QDecompressHelper for network purposesMårten Nordheim2020-08-058-2/+2283
| | | | | | | | | To support streaming decompression in QNAM. Will also be used to refactor existing decompression code in QNAM. Task-number: QTBUG-83269 Change-Id: Iecf3e359734163f15686c949f75d41fa4794a00e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDebug: add operator<<(const char16_t *)Thiago Macieira2020-08-041-0/+41
| | | | | | | | | | | Avoids the conversion from UTF-8 for uses that are not dumping a string. Mass conversion of Qt sources left for future opportunity. Fixes: QTBUG-85811 Change-Id: I4ca4a35b687b46c39030fffd1626ae6c3294cacf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QNotifiedProperty: avoid crashFabian Kosmale2020-08-041-0/+29
| | | | | | | | | | | | We can end up in a situation where a (soon to be destroyed) observer is owned by a binding which is about to be deleted. If in that situation the binding is destroyed first, we end up with a dangling pointer and ensuing memory corruption. Instead, we now first transfer the ownership of the observer and only destroy the binding afterwards. Fixes: QTBUG-85824 Change-Id: I721c0319281ada981ae7896bd2e02e9a0cc901b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove const volatile qualifier on return type in testTor Arne Vestbø2020-08-041-6/+6
| | | | | | | | | | | | Fixes warning by Clang: warning: 'const volatile' type qualifiers on return type have no effect [-Wignored-qualifiers] const volatile unsigned long long * const volatile func_KVPKVull() {...} ^~~~~~~~~~~~~~~ Change-Id: Ia4aae6521c84f4a18d92ad5035af5b247d283140 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce swap functions for QPromise/QFutureInterfaceAndrei Golubev2020-08-032-6/+24
| | | | | | | | | | Made QPromise::swap public, added free standing swap() for QFutureInterface and QPromise. Updated QPromise special member functions. Extended tests Task-number: QTBUG-84977 Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Move-enable QByteDataBuffer::{append,prepend}Mårten Nordheim2020-08-011-1/+14
| | | | | Change-Id: I2fd342465475e3a694c8459a54957149f8b418a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: Add a append(QList &&) overloadMårten Nordheim2020-08-011-0/+195
| | | | | | | | We already had append(const QList &) and now there's an overload taking an rvalue reference. Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: do allow calling deleters on null pointersThiago Macieira2020-07-311-2/+31
| | | | | | | | | | | | | I don't know why std::shared_ptr allows this, but why not. [ChangeLog][Important Behavior Changes] QSharedPointer objects will now call custom deleters even when the pointer being tracked was null. This behavior is the same as std::shared_ptr. Fixes: QTBUG-85285 Pick-to: 5.15 Change-Id: I24006db8360041f598c5fffd161c260df0313b55 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QString::vasprintf: fix 't' modifier for integers on 64-bitThiago Macieira2020-07-311-25/+35
| | | | | | | | | | | | | ‘t’ Specifies that the argument is a ‘ptrdiff_t’. This modifier was introduced in ISO C99. We use qsizetype, which is the same width as ptrdiff_t, so it makes no difference in va_arg(). Change-Id: Iea47e0f8fc8b40378df7fffd16255730109413a5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove deprecated binary json featureEdward Welbourne2020-07-3134-239/+0
| | | | | | | | | Deprecated in 5.15 in favor of CBOR. Fixes: QTBUG-81239 Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add float->qfloat16 rounding and fix the testsAllan Sandfeld Jensen2020-07-311-32/+32
| | | | | | | | | | | | Our hardware optimized conversions of float to qfloat16 rounds to even where our table based conversion truncated to zero. The rounding is not in this patch exactly round to even like the hardware implementation but much closer. Change-Id: I4c5e72c15fef9079d3660680b2727ff7ba4e768a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCryptographicHash: Add BLAKE2b and BLAKE2s hashing algorithmsLinus Jahn2020-07-311-0/+106
| | | | | | | | | | | | | | | | | | | | BLAKE2 does not specify requirements about specific hash sizes and since QCryptographicHash does not support dynamic hash sizes, only the most common hash sizes could be covered by this. The supported hash sizes were chosen to match the ones supported by the Linux kernel. The new hashing algorithms for QCryptographicHash are: * BLAKE2b (160 bit, 256 bit, 384 bit, 512 bit) * BLAKE2s (128 bit, 160 bit, 224 bit, 256 bit) [ChangeLog][QtCore][QCryptographicHash] Added BLAKE2b and BLAKE2s hashing algorithms. Fixes: QTBUG-78198 Change-Id: Id9e0180a974093982fdf1cdd6180988a2e5e9f4f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove old qsb versions from qshader autotestLaszlo Agocs2020-07-317-26/+11
| | | | | | | | | | Only keep 3, 4, and 5 because 3 is the lowest version where binary JSON is not used anymore. Change-Id: Id0319e8eceb845017ed493d0ef6902b53050d5a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Expose QMetaTypeInterface::alignof in QMetaTypeFabian Kosmale2020-07-311-0/+38
| | | | | | | | | | We already have the information in the QMetaTypeInterface, and provide functions to access sizeof. Adding alignof support seems natural, and should make it easier to handle over-aligned types. This should also be helpful in QVariant. Change-Id: I166be76f4b7d2d2e524a3a1e513bd2f361e887c1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don't capture this explicitly in testsTor Arne Vestbø2020-07-292-5/+5
| | | | | | | Some compilers implicitly captures, and will warn about the unused capture. Change-Id: Ib5e1cc3956c7eb0dc87cee834cce8a2b3dd0d30b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QEventDispatcherWin32: redesign event notifiers activationAlex Trotsenko2020-07-291-0/+83
| | | | | | | | | | | | | | The previous implementation multiplexed callback-based event notification into a single proxy event (cf. 85403d0af), which was in turn object-waited for (this was the case since the beginning of public qt history). It makes more sense to multiplex into a posted message, because that also works with foreign event loops that do not know anything about our event objects. Task-number: QTBUG-64443 Change-Id: I97945ac8b5d7c8582701077134c0aef4f3b5a18f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Re-enable tst_qrhi on LinuxLaszlo Agocs2020-07-291-6/+1
| | | | | | | | Not sure why this was disabled in the first place. Change-Id: I66329b55fd46d03fd96818c6c7004718ddea5c79 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add missing override in tst_QSortFilterProxyModelTor Arne Vestbø2020-07-291-1/+1
| | | | | Change-Id: I8ffe92cd5a68bf86688e1d942d079ac6ff115d11 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix warning when comparing qsizetype to size_tTor Arne Vestbø2020-07-291-1/+1
| | | | | Change-Id: I4ea7ccb4daf05c735c831964f94c120d179521dd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix warnings about unused expression results in testsTor Arne Vestbø2020-07-293-16/+16
| | | | | Change-Id: I401ec8a3742a5bb51a1b8b291c53395c3880117c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix warnings about unused members in testsTor Arne Vestbø2020-07-293-7/+7
| | | | | Change-Id: I741cf08c26f8a2e297926cc01968ff09e70462a2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Disable deprecation warnings in some testsTor Arne Vestbø2020-07-298-0/+16
| | | | | | | | The tests are testing deprecated functionality, which we still want to test. Change-Id: Iad6ed35800896170c17fe019c7a6ecda22398ac3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add missing braces when constructing BigConvertible in tst_qvariantTor Arne Vestbø2020-07-291-1/+1
| | | | | Change-Id: Ia571e8950aa28721080dc7434921b79ffda913f4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add missing enumeration case in tst_QMacStyle::setSizeTor Arne Vestbø2020-07-291-0/+2
| | | | | Change-Id: Iade36b03c6f8bdaa8feb82ef89744a399f92e21d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make qfloat16 helper functions consistent with float/double versionsAllan Sandfeld Jensen2020-07-281-1/+1
| | | | | | | | | | Infinite is only when the mantissa is 0, everything else is NaN. std::isnormal returns false on zero. Pick-to: 5.15 Change-Id: I897fc0dc3b8a9c557bb1922ea7ca8df501e91859 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows QPA: Move mime-type related classes to the new interfaceFriedemann Kleint2020-07-283-2/+103
| | | | | | | | | | | | Move QWindowsMime (which was a public class in Qt 4 and moved to the QPA plugin in Qt 5) to the platform namespace and add register functions to the native application. Move in test code from QtWinExtras. Task-number: QTBUG-83252 Change-Id: Iaac440e2d5cb370110919921b1eeb779600b5b65 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QHostAddress: resolve API issues marked with ##Qt6Timur Pocheptsov2020-07-281-16/+0
| | | | | | | | Also, remove the deprecated function and its auto-test. Change-Id: If04a54c4b91e0f76523960c7b1a5bcb8fe883ac6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLine: purge deprecated APIEdward Welbourne2020-07-271-64/+1
| | | | | | | | Since 5.14: intersect(), angle(). Also removed definition of M_2PI from test, since its last use was in the tests being removed. Change-Id: Ie3a12247e3760e8bfdd3a659cd06245c86b198c2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Purge redundant recoding of URL fragments from QByteArrayEdward Welbourne2020-07-271-32/+0
| | | | | | | | | | | | | QUrl::fromEncodedComponent_helper() only existed to support some old methods deprecated since 5.0, that I recently removed. It was the only caller of qt_urlRecodeByteArray() aside from that function's own autotest. Both were private. Task-number: QTBUG-85700 Change-Id: I5d09fd44e768847ce51a1ae7043150922cb5314c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix misplaced nullptr, used for a flag valueEdward Welbourne2020-07-271-1/+1
| | | | | | Task-number: QTBUG-85700 Change-Id: I34b1aa8430842d96eb515d709b49de4e60976ac9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* tst_qicon: Enable lowdpi test using qt_add_test argumentTor Arne Vestbø2020-07-261-1/+1
| | | | | Change-Id: I98f850c668a45d127abb1c2af5915f2cbcbd1cdb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>