summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qvarlengtharray
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-1/+1
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Cleanup QTypeInfoLars Knoll2020-08-261-3/+3
| | | | | | | | | | | | | | | Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6. Also remove sizeOf, it's unused, and we have QMetaType for that if required. Remove all typeinfo declaractions for trivial types, as the default template covers them correctly nowadays. Finally set up a better default for isPointer, and do some smaller cleanups all over the place. Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-1/+1
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-091-1/+1
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QVarLengthArray: add missing move special member functionsMarc Mutz2020-06-221-15/+77
| | | | | | | | | | | | | | | | A QVLA is copyable, so it should be movable, too. Added a helper function a la P1144's uninitialized_relocate_n to deal with the QTypeInfoQuery stuff. This way, the code is re-usable everywhere it's needed. The same cannot be said for QArrayDataOps, which only a parent can love... [ChangeLog][QtCore][QVarLengthArray] Added missing move constructor and move-assignment operator. Task-number: QTBUG-39111 Change-Id: If0dc2aa78eb29062d73dcd3dc4647ba345ae39e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use qsizetype for size related methods in QVarlengthArrayLars Knoll2020-03-141-4/+4
| | | | | Change-Id: Ib94b9a4e6e17da21f592e71a36fd1b97d42dfe62 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-191-1/+1
|\ | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * Eradicate Q_FOREACHs over QVarLengthArrayMarc Mutz2019-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Regenerate qtbase after wip/qt6 -> wip/cmake mergeAlexandru Croitor2019-10-141-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that android builds will be broken after this merge and regeneration, because we don't currently handle the minimum required changes that were brought in with the Android multi ABI support that comes from 5.14. This will have to be addressed in a separate change. For now the build on Android will fail while compiling due to incorrect generation of LIB_SUFFIX with QT_ARCH. Change-Id: Ia4a871f4b7ddd0da11caf5f34e10a599a97bb55d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-112-0/+31
|\| | | | | | | Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
| * QVector/QList/QLinkedList/QVarLengthArray/QSet: add missing deduction guidesMarc Mutz2019-08-072-0/+31
| | | | | | | | | | | | | | | | | | | | | | Amends 2e1763d83a1dacfc5b747934fb77fa7cec7bfe47. The new range ctors need deduction guides, since the compiler can't deduce the value_type from a pair of iterators. Change-Id: I3ec1e5f91305b317c443b6a70246be416b55bad9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-151-10/+27
|\| | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * QVarLengthArray: optimize pop_back()Marc Mutz2019-07-141-10/+27
| | | | | | | | | | | | | | | | | | | | Don't call realloc() with all its machinery when we know exactly what to do: destroy the last element and decrease the size by one. Extend the test, removing the unused Foo class for a new Tracker one. Change-Id: I568eef4f6335669689fb16fd23af92cb4d6464bd Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-0/+7
|\| | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * Make the default ctor of QVarLengthArray implicitUlf Hermann2019-07-021-0/+7
| | | | | | | | | | | | | | | | | | Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some compilers get confused about "QVarLengthArray()" this way. Task-number: QTBUG-76199 Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-06-031-4/+0
|\| | | | | | | | | | | Take 5. Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
| * Remove handling of missing Q_COMPILER_INITIALIZER_LISTSAllan Sandfeld Jensen2019-05-021-4/+0
| | | | | | | | | | | | Change-Id: Id65b39c787235a051262544932e6717d076f1ea0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+1
|/ | | | | | | | | | | | | | | Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* fixup oversight in rvalue overloads of operator+=() and operator<<()Eric Lemanissier2018-03-261-7/+52
| | | | | | | ammends 4dee5446bee9c7417bf6f5dc44294a0b7238a9ba Change-Id: Ia0ca27644eb71815a93d6e76681b8a9e61a4e7ab Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* add missing tests of rvalue overloads for QVarLengthArray and QVectorv5.11.0-beta2Eric Lemanissier2018-03-101-0/+9
| | | | | | | they were missing in dd58ddd5d97f0663d5fafb7e81bff4fc7db13ba7 Change-Id: I52a2f855ead7716f8fe887524b27d4bd258f43d3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tst_qvarlengtharray: Add missing includeOliver Wolff2018-01-261-0/+2
| | | | | | | | The include is needed for std::unique_ptr on winrt. Change-Id: I72a28bd0951cc947ac65877ccc35f464c757c444 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Add rvalue overload of insert/prepend to QVarLengthArray and QVectorAllan Sandfeld Jensen2018-01-201-9/+137
| | | | | | | | | | | | | | | | | Improves performance and STL compatibility by adding rvalue versions of prepend and insert. [ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads of prepend and insert. [ChangeLog][QtCore][QVector] Added rvalue overloads of prepend and insert. [ChangeLog][QtCore][QVarLengthArray] Can now contain movable but non-copyable types, such as std::unique_ptr. Change-Id: I6c946acc5b67502c91c52ac5dea67cedb1af93a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-021-2/+15
|\ | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * QVarLengthArray: fix appending an already-contained itemMarc Mutz2017-02-171-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the lvalue QVector::append() overload, when we reallocate, we need to take a copy of the function's argument because the reference will get stale upon reallocation. Add a test. [ChangeLog][QtCore][QVarLengthArray] Fixed a bug involving appending an item already in the container to the container again. Change-Id: I06eeed6cb383dd5924e47a302bb3d1666d04c8e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Tests: Fix Clang warnings about various unused variablesFriedemann Kleint2017-02-051-2/+0
|/ | | | | | | | | | tst_qpainter.cpp:400:26: warning: unused variable 'maskSource_data' [-Wunused-const-variable] tst_qpainter.cpp:422:26: warning: unused variable 'maskResult_data' [-Wunused-const-variable] tst_qfuture.cpp:1203:11: warning: unused variable 'resultCount' [-Wunused-const-variable] tst_qvarlengtharray.cpp:33:11: warning: unused variable 'N' [-Wunused-const-variable] Change-Id: Ic8891603089a877a5c69701c63c2c6fd20fa6a22 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* 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>
* Tests: Use QCOMPARE() with QLatin1String() for QString values.Friedemann Kleint2015-10-141-6/+6
| | | | | | | Prefer QCOMPARE over QVERIFY for equality and use QLatin1String(). Change-Id: If226a0fc7b25be3e6774c7e36ca1e6f99234e5dd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+1
| | | | | | | 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>
* Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-07-171-0/+16
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
| * QVarLengthArray: Unit-test that clear() preserves capacitySérgio Martins2015-07-081-0/+16
| | | | | | | | | | Change-Id: Ib2b798b93ce9a1b77bca09b2a8c27a568ebf8670 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-061-0/+20
|\| | | | | | | Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
| * QVLA: Add operator= for initializer listsKai Koehne2015-04-041-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a dedicated operator=(std::initializer_list) that first resizes the QCLA, and then replaces the elements one by one. This should be usually faster than creating a temporary QCLA and then copying it, except for the case where the new array does not fit into the allocated stack - but this is IMO nothing to optimize for. Task-number: QTBUG-45041 Change-Id: I147d6d01186b1ca3c635b2c8365d8f6e638ce6fe GPush-Base: 08de3113051e1289f0de0651ec5647c9ee6feb27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVarLengthArray: add {const_,reverse_iterator}, {c,}r{begin,end}()Marc Mutz2015-04-051-0/+16
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QVarLengthArray] Added rbegin(), crbegin(), rend(), crend(), and reverse_iterator and const_reverse_iterator typedefs. Task-number: QTBUG-25919 Change-Id: Ifda5d420802a3594c3181f54036279f16a7da16e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVarLengthArray: add relational operators <,<=,>,>=Marc Mutz2015-04-051-0/+44
|/ | | | | | | | | | std::vector has them, too. [ChangeLog][QtCore][QVarLengthArray] Added relational operators <, <=, >, >= if the element type supports operator<. Change-Id: I69e16d361fd4738a56b292ebfa78316d28871eda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVarLengthArray: Add initializer_list constructorKai Koehne2015-03-231-0/+62
| | | | | | | | | | | | | | | | | Implement an initializer_list constructor, which was probably just forgotten so far. Technically this is a SC incompatible change, since QVarLengthArray<int> array = {10}; will now create an array with one element 10, instead of an empty array with a reserved size of 10. Anyhow, keeping the inconsistency with the STL / other Qt containers here would certainly do more harm than good in the long run. Task-number: QTBUG-45047 Change-Id: I4675880f93e141181250939942fa32300916b0e3 Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
* 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>
* Add QVarLengthArray::{indexOf,lastIndexOf,contains} functionshjk2014-01-091-0/+65
| | | | | | | | | | [ChangeLog][QtCore][QVarLengthArray] Added the indexOf, lastIndexOf and contains functions to QVarLengthArray. These functions make the class more similar to QVector. Change-Id: I9bd2b22bd8b7151c2d17aede36e5f2126570600b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QVarLengthArray: add squeeze functionPeter Kümmel2013-01-281-0/+24
| | | | | | | Add function to move back data to the stack. Change-Id: Ic78a368459bce68629e29602e4eeae2e1afe398b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove out-of-memory test in QVarLengthArray.Christian Strømme2012-11-071-50/+0
| | | | | | | | | | | No reason to keep this test. If an application is trying to allocate too much memory it will fail, and its the users responsibility to provide sane values and catch exceptions to recover. Task-number: QTBUG-27361 Change-Id: I29d71745ab791b6e8a76f7b1f866ff4bd7024749 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Test: Split tst_QVarLengthArray::oldTestsCaroline Chao2012-09-271-46/+48
| | | | | | | | | | | | | | | The entire test is currently skipped while only the last part is causing problems. Move the out of memory test code to its own test function and skip only this function with the appropriate bug number. By allocating too much memory this test is causing a crash. Task-number: QTBUG-27361 Task-number: QTBUG-22342 Change-Id: Ia308099b7f12cf2c567b62063a7bbcc6fb38515b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Implement (and unit test) simple QVarLengthArray::first()/last().Robin Burchell2012-01-021-0/+46
| | | | | | | | | Pure syntactical sugar, to match up with what the other container classes offer. Change-Id: I0f97de011923d9d204cca0fa906b059dc5054a89 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add QVarLengthArray::length().Robin Burchell2011-12-121-0/+62
| | | | | | | | | | | This also adds a unit test for length()/count()/size(), since there wasn't one testing it explicitly. Change-Id: Ifb7f113aa97beef5f76e5fb246eb38495344b0ad Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Marco Schmidt <Marco.Schmidt@Taugamma.de> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>