summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/collections
Commit message (Collapse)AuthorAgeFilesLines
* Use <type_traits> to properly have QVector<T>::parameter_typeThiago Macieira2019-12-081-23/+1
| | | | | | | | | | | | That allows us to pass by value for all fundamental and pointer types. This requires some magic to remove methods taking a T&& to avoid ambiguous overloads for QVector<int/qsizetype>. Remove them for all cases where parameter_type is T, as copying or moving will do exactly the same thing for those types. Change-Id: I8133fecd3ac29bb8f6ae57376e680bc3d616afbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Eradicate Q_FOREACHs over QVarLengthArrayMarc Mutz2019-11-051-6/+0
| | | | | | | | | | | There is no excuse for copying several KiBs of data just to iterate over it, yet that's exactly what Q_FOREACH does. Besides, this use of Q_FOREACH is being deprecated. In my tree, it's already a hard error. Change-Id: I07240c37626f7d284781e8c4be05eef3c7a54f39 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QT_STRICT_ITERATORSLars Knoll2019-11-041-1/+0
| | | | | | | | | | | The concept was a nice idea to avoid accidental detach() calls in implicitly shared containers, but it conflicts with a C++11 compatible API for them, with signatures for modifying methods taking a const_iterator as argument and returning an iterator (e.g. iterator erase(const_iterator)). Change-Id: Ia33124bedbd260774a0a66f49aedd84e19c9971b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make QList an alias to QVectorLars Knoll2019-10-301-17/+0
| | | | | | | | | | | | | This is almost 100% source compatible with Qt 5. Exceptions are * Stability of references for large or non movable types * taking a PMF for types that are now overloaded with r-value references in QVector * The missing prepend optimization in QVector (that is still planned to come for Qt 6) Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace usage of Q_DECL_ALIGN with C++11 alignas keywordVolker Hilsheimer2019-10-291-11/+2
| | | | | | | | | | | | | The macro is not documented, so can be considered private API. Pre-C++11 compilers that don't support alignas will no longer be supported with Qt 6. The macro definition for the standard case of compilers supporting the alignof keyword is left in place. Task-number: QTBUG-76414 Change-Id: I7d722e4faf09ae998a972d3ed914de808ab316d7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace Q_ALIGNOF usage in qtbase with C++11 alignof keywordVolker Hilsheimer2019-10-291-3/+3
| | | | | | | | | | | | | | | | The macro is not documented, so not part of the public Qt API. It is made obsolete by the alignof keyword in C++11. Remove the usage of the macro across qtbase, in particular the workarounds for compilers that didn't support alignof, and that will not be supported in Qt 6. The macro definition is left in place, no need to break existing code. Task-number: QTBUG-76414 Change-Id: I1cfedcd4dd748128696cdfb546d97aae4f98c3da Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-301-2/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qrandom.cpp src/corelib/io/qfileinfo.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/corelib/kernel/qeventdispatcher_win_p.h src/gui/text/qfontdatabase.cpp src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm src/plugins/platforms/windows/qwindowsglcontext.cpp src/testlib/qtestcase.cpp Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4893212471aa24be804c989a581810e2f714545c
| * Revert "BLACKLIST insert_remove_loop for msvc-2019"Friedemann Kleint2019-09-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | The error was due to a compiler optimization bug, which is fixed in 16.3.0. This reverts commit 305f2c3aa6a2405f8fdeaa33f5d8c684e425f4ee. Fixes: QTBUG-77239 Change-Id: Idfb86ad5c3ec026518f0713c41f7ad744ab4d5db Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-011-0/+2
|\| | | | | | | Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
| * BLACKLIST insert_remove_loop for msvc-2019Heikki Halmet2019-07-301-0/+2
| | | | | | | | | | | | Task-number: QTBUG-77239 Change-Id: Ie1a08db0b4c4e1bbcb7981f24bcf12d5e6d33e48 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* | Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of itMarc Mutz2019-07-121-0/+1
| | | | | | | | | | | | | | | | | | QLinkedList is still used in several tests. Add exceptions for these subdirs. Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Remove usages of deprecated APIs of corelibSona Kurazyan2019-07-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of deprecated APIs of corelib by corresponding alternatives in the library code and documentation. - Modified the tests to make them build when deprecated APIs disabled: * Made the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, added tests for the replacement. Task-number: QTBUG-76491 Task-number: QTBUG-76539 Task-number: QTBUG-76541 Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of itMarc Mutz2019-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | ... except for tests, which manually undefine the macro. Like QT_NO_FOREACH, this is a technical way to keep JSI-free modules JSI-free going forward. Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove usages of deprecated APIs from QtAlgorithmsSona Kurazyan2019-06-291-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-76491 Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Corelib tests: Fix out of bounds string accessFriedemann Kleint2019-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings: Using QCharRef with an index pointing outside the valid range of a QString. The corresponding behavior is deprecated, and will be changed in a future version of Qt. introduced by qtbase/c2d2757bccc68e1b981df059786c2e76f2969530 (5.14). Change-Id: Ie6f0e2e3bb198a95dd40e7416adc8ffb29f3b2ba Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | test: migrate collections test to QRegularExpressionSamuel Gaist2019-06-101-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. Task-number: QTBUG-72587 Change-Id: Iff9d4be685bf360ad921e29a82cb878ae5c46180 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Deprecate conversion functions between QList and QSetLars Knoll2019-05-071-4/+33
| | | | | | | | | | | | | | | | | | | | 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>
* | Don't use deprecated APILars Knoll2019-05-031-21/+21
| | | | | | | | | | Change-Id: Ic56c22a1be5e69b371991c3e9ad98a1106848e78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Replace qMove with std::moveAllan Sandfeld Jensen2019-04-061-1/+1
|/ | | | | | Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* implement non-member operator+ for iteratorsEric Lemanissier2018-03-061-0/+4
| | | | | | | | | all of these iterator classes already have a member operator+, which allows iter+int. This commits addes non-member operator+, which allows int+iter, and forwards to the member QList and QArrayData iterators now satisfy RandomAccessIterator concept Change-Id: I25c1dd8cea299e735d5a5e288dbe23dc1d7a1933 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_Collections for gcc/armSami Nurmenniemi2017-04-071-15/+27
| | | | | | | | | | | | | | | - Alignment test was not compiling or passing on GCC / arm - Using C++11 alignas() enforces maximum limit for the alignment, which at least on GCC / arm is __BIGGEST_ALIGNMENT__ multiplied by 8 - On GCC 6.2.0 / x86_84, maximum alignment accepted by alignas is 128 - On GCC 5.3.0 / arm, maximum alignment accepted by alignas is 64 - This change calculates biggest tested alignment on ARM targets and compilers supporting alignas() to the value calculated from __BIGGEST_ALIGNMENT__ Task-number: QTBUG-55492 Change-Id: If2b70000ff9cdc5ae8c5a00e39f79efcc6ba1221 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* tst_collections: "explicit instantiation of 'NS::QList' must occur in ↵Marc Mutz2015-12-231-0/+2
| | | | | | | | | | | namespace 'NS' Probably correct. The question is just why this code has survived for so many years. Change-Id: Iaf01850476f9b066243abebb9ee6c5928d7ada19 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Tests: Remove empty init/cleanup slots, constructors and destructors.Friedemann Kleint2015-12-101-24/+0
| | | | | | | | Move some code (like registrations of meta types) from init() to initTestCase() in the process. Change-Id: I57db5156647cfadab554fbed853b2e68b2815f3b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Tests: Use QCOMPARE() with QLatin1String() for QString values.Friedemann Kleint2015-10-141-67/+67
| | | | | | | Prefer QCOMPARE over QVERIFY for equality and use QLatin1String(). Change-Id: If226a0fc7b25be3e6774c7e36ca1e6f99234e5dd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Tests: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
| | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-011-1/+0
| | | | | Change-Id: I1955320e7639760b4383a53f37a506c8055933ef Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).Friedemann Kleint2015-07-271-1/+1
| | | | | | | | Preparing the replacement of Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) for non-boolean types. Change-Id: Iab6ec2f0a89a3adc79e18304573994965013dab5 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Fix assorted MSVC warnings in tests.Friedemann Kleint2015-01-171-1/+1
| | | | | | | | | | | | | | | | tst_collections.cpp tst_collections.cpp(3138) : warning C4305: 'argument' : truncation from 'size_t' to 'bool' tst_collections.cpp(3190) : see reference to function template instantiation 'void testContainerTypedefs<QVector<int>>(Container)' being compiled with[Container=QVector<int>] (repeated) tst_qringbuffer.cpp(297) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data tst_qringbuffer.cpp(300) : warning C4309: '=' : truncation of constant value tst_qringbuffer.cpp(306) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data tst_qrawfont.cpp(947) : warning C4309: 'argument' : truncation of constant value tst_qsslsocket_onDemandCertificates_member.cpp(217) : warning C4189: 'rootCertLoadingAllowed' : local variable is initialized but not referenced Change-Id: I6143d4ad121088a0d5bdd6dd2637eb3641a26096 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Stop using setSharable in the Java-style mutable iteratorsThiago Macieira2014-05-181-91/+1
| | | | | | | | | | | | | | | | | | | First and foremost, the STL-style iterators don't do this. Those don't provide a guarantee that the container won't get shared again while the iterator is active. Second, there's no protection against a second mutable iterator being created and resetting the sharable flag back to true. [ChangeLog][Important behavior changes] The mutable Java-style iterators like QListMutableIterator and QHashMutableIterator no longer set the parent container to unsharable mode. If you create a copy of the container being iterated on after the iterator, any changes done with the iterator might affect the copy too. Discussed-on: http://lists.qt-project.org/pipermail/development/2014-February/015724.html Change-Id: Iccfe411d5558c85ae459cff944215614c392388e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Remove unsused local variables from tst_collectionsJędrzej Nowacki2014-05-131-4/+0
| | | | | Change-Id: I4ca1862d29432ca83b90024664b548ea0eef26c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix gcc warning in tst_collections.Jędrzej Nowacki2014-05-131-29/+31
| | | | | | | warning: typedef 'Foo' locally defined but not used [-Wunused-local-typedefs] Change-Id: Ifb1213414feb3aa5a5e46dac163e51ccd4925498 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move tst_collections test to corelib/tools.Jędrzej Nowacki2014-05-133-0/+3772
There is no reason to have the test separated from other tools tests. Change-Id: Ie5b19961c383f5e4bc1ad4452cba7b92153fc303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>