summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QAbstractProxyModel: port to new property systemIvan Solovev2021-05-042-2/+33
| | | | | | | | | | | | | | The biggest trick here is the getter (QAbstractProxyModel::sourceModel), which is returning nullptr, while internally using a global staticEmptyModel() instance. This lead to inconsistency while binding to a proxy model without source model. The bound object would point to staticEmptyModel() instance, while sourceModel() getter returns nullptr. To solve this issue a custom QBindableInterface is implemented. Task-number: QTBUG-85520 Change-Id: I597df891c7e425d51b55f50ccbacabdfe935cbac Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Blacklist and skip failing tests on macOS ARMTor Arne Vestbø2021-05-043-0/+7
| | | | | | Task-number: QTQAINFRA-4431 Change-Id: I4ae47bb461634d524995077501b54322f6beccf3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tst_moc: fix returning-reference-to-local warningMårten Nordheim2021-05-041-2/+2
| | | | | | | | | | | Although the code is never executed compilers still throw a warning because it's compiled. Amends 12b8283f899ebcf401d974927314b9531334a56e Pick-to: 5.15 6.1 Change-Id: Ib790d4bcb33c4b9f2a55a784b852275b59debde9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Test at some Android DPIs in additionMorten Johan Sørvig2021-05-041-4/+9
| | | | | | | | | | | | | Currently, we test at 1x, 2x, and mixed typical desktop DPI values. Add android DPI values, with scale factors in the 2.5 - 3.75 range. This test currently uses 96 as the base DPI (and so does the Android platform plugin), so we normalize the values to use that base DPI. Change-Id: I25b66f5e16d37c01758d5623b805e4141247a74a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove setting of Qt 5 high-dpi attributesMorten Johan Sørvig2021-05-041-10/+0
| | | | | | | This test is for Qt 6 now. Change-Id: I839c2733d505cb4119b1fe3ad85d3c8d94a6c964 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Ensure setDateTime clears status also when shortEdward Welbourne2021-05-041-0/+7
| | | | | | | | | | | Previously, if multiplication overflowed when trying to set the date and time of a formerly short-form QDateTime, its status didn't get set to reflect the failed validity check. Added a test that now correctly detects that it's produced an invalid date-time on overflow, where previously it produced a wrong valid date-time. Change-Id: Id46ca34d1e32e9b9b0630f3723cefd1c13b5761e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Moc: parse trailing return typeMårten Nordheim2021-05-044-0/+180
| | | | | | | Pick-to: 5.15 6.1 Fixes: QTBUG-71123 Change-Id: I1c3749f0892fddcc433c9afcb1d6d7c30c97c9d9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QProcess: increase wait time and remove ill-advised QCOMPAREThiago Macieira2021-05-031-2/+1
| | | | | | | The QCOMPARE made dead code of a more verbose QVERIFY2 below Change-Id: I26b8286f61534f88b649fffd166b67d8603280a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Q(Untyped)Bindable: Print warnings when operations failFabian Kosmale2021-05-031-0/+22
| | | | | | | | | Instead of silently failing, we now print an explanatory warning to aid with debugging. Task-number: QTBUG-89512 Change-Id: I36dd2ce452af12d0523c19286919095e366bd390 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QJniObject: add callStatic[Object]Method overloads for jmethodIDIvan Solovev2021-05-031-0/+167
| | | | | | | | | | | | This patch extends the QJniObject::callStatic[Object]Method functions with the overload which accepts a jmethodID parameter. This can be convenient when the method id is already cached and you do not want to query the method by its name and signature. Task-number: QTBUG-92952 Change-Id: Ib0852a5a27da2a244ac63112784751ef9e32cfa5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QJniEnvironment: extend APIIvan Solovev2021-05-032-0/+74
| | | | | | | | | | | | | | This patch adds some convenience methods to QJniEnvironment API: * an overload of registerNativeMethods() that accepts jclass instead of const char *className. * a findMethod() function is added to query a methodID of a static or nonstatic method by its name and signature. Task-number: QTBUG-92952 Change-Id: Ib1bc892decea97e625c4822888b6183af6edd6dc Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QSqlTableModel::orderByClause(): Quote the table nameFriedemann Kleint2021-05-031-24/+26
| | | | | | | | | | | This ensures correct handling of names with special characters. Pick-to: 5.15 6.1 Fixes: QTBUG-92584 Change-Id: I95c7c54d9c7ee00b221a55f3d07ef1ec3a3bd217 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Extend QT_SCREEN_SCALE_FACTORS testMorten Johan Sørvig2021-05-031-14/+39
| | | | | | | | | Test the name=factor format and various incorrect spec strings. We expect that the screen DPI is used if the scale factor specification is incorrect. Change-Id: Ia990e70cf71e370dd2bb4b1047a101dfe9e59cb0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port QVariantAnimation to the new property systemSona Kurazyan2021-04-302-0/+31
| | | | | | | | | | | | | | Skipped startValue/endValue properties, since they are computed and writable, which is not supported at the moment. Skipped currentValue, since its setter might be called inside the getter, which is not recommended. Task-number: QTBUG-85520 Change-Id: I1f872b4fcc7227ed91b6915891bbc66019151826 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSFPM: fix filterCaseSensitivityChanged signal emission logicIvan Solovev2021-04-301-0/+19
| | | | | | | | | | | | | | | | | | This patch amends bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea. It fixes the logic of filterCaseSensitivityChanged signal emission. The call to QRegularExpression overload of setFilterRegularExpression could change the filterCaseSensitivity, but the signal was never emitted. [ChangeLog][QtCore][QSortFilterProxyModel] A call to QRegularExpression overload of setFilterRegularExpression now emits a filterCaseSensitivityChanged signal, if required. Pick-to: 6.0 Pick-to: 6.1 Change-Id: Id4ef04227c1f8ed98153fa5107ec3fbe4c0c77fb Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Let the h2 test server both send and receive DATA framesMårten Nordheim2021-04-302-6/+17
| | | | | | | | | And use this in the authenticationRequired test. Pick-to: 6.1 6.0 5.15 Change-Id: I18e991eb67168214c2c4f829afaca5018568e989 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* uic/Python: Add comments for mypy to ignore star importsFriedemann Kleint2021-04-291-3/+3
| | | | | | | | | | Amends 2f975b39a967cd2ac1c234a200eb6b9c11d8b5b2. Pick-to: 6.1 5.15 Fixes: PYSIDE-1404 Change-Id: I534d78bdf44eb02bf80831a3d6c1d080a4e08698 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Revert "Add grabber context pointers"Shawn Rutledge2021-04-292-2/+2
| | | | | | | | | | | This reverts commit 40330b8f0a717098982d1f54f34a18a8262b1f55. It was a bad idea to use QFlatMap here, because it is a sorted map, but we need to keep the passive grabbers in the same order as the grabs happened. So need to go back to an earlier version of the patch that uses two parallel QLists. Pick-to: 6.1 Change-Id: I9e6013c2565986fe1eb9fd754f8259766f83bee5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use a more forgiving threshold for qFuzzyIsNull(qfloat16)Edward Welbourne2021-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis of problems with the new test for qFuzzyIsNull() revealed that, where its version for double uses approximately 4500 * epsilon and for float used 84 * epsilon as threshold, the qfloat16 version's value was barely more than epsilon, with the result that the test had to use a different value than the threshold to pass. (Converting the threshold from float to qfloat16 and back made it bigger; in effect, the threshold value was not <= itself.) Furthermore, comparison with qFuzzyCompare() implied a value of 1/102.5 should be used, roughly 10 * epsilon, for consistency. When 1/102.5 is rounded to three significant digits (the precision we use in QTest::toString(), for example), to give 0.00976f as threshold, we get a value that, after conversion to qfloat16 and back to float, does give a result <= what we started with. So change qFuzzyIsNull() and its test to use this as qfloat16's threshold value. [ChangeLog][QtCore][QFloat16] The qfloat16 threshold value for qFuzzyIsNull() has changed from 1e-3 to 9.76e-3, almost a factor of ten increase, for consistency with qFuzzyCompare()'s tolerance. Values between these would previously have had qFuzzyIsNull(f) false despite qFuzzyCompre(f, 1+f) being true. Change-Id: I35816dce78da34a3e2339c8bc42d5bd03714a3f6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tests for qFuzzyIsNull() to tst_QNumeric and tst_QFloat16Edward Welbourne2021-04-293-2/+69
| | | | | | | | | | | | | They were missing. I also wanted to verify that it's true for sub-normal values. At the same time, relocate qfloat16's implementation of qFuzzyIsNull() to between those of qFuzzyCompare() and qIsNull(), since its apparent absence initially confused me. Change-Id: I9637c0070e754d16744c76fc9f846596257c6a63 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert early return from QTimeZone on invalid IDEdward Welbourne2021-04-291-1/+1
| | | | | | | | | | | | | | This reverts commit ec8808c3020abbc436f1a2d90fecf3245fd6417b but retains its test, as the problem it fixed is now solved by having the TZ backend validate the ID it's passed, so that it now only accepts valid POSIX zone-descriptions and valid IANA IDs. The former were being excluded by this check. Amended a POSIX test to fail with the check in place; it passes now. Change-Id: I0d5e8c6e0a315ac2509f3d23bebb52aede8f79d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* HTTP/2 authentication requiredMårten Nordheim2021-04-293-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | With Qt 6 we made HTTP/2 default, which exposed missing handling of 401 Unauthorized (and 407 Proxy Authentication Required). In HTTP/1.* we would handle this after the response had finished, while handling the status code. For h2 this path isn't used since it is heavily reliant on the structure we have for HTTP/1.* (one request per channel). So we must handle the status code and header directly. Having that part fixed exposed another issue - when resetting/rewinding uploaded data we were not resetting the 'totallyUploadedData' counter in the reply (this, in turn, exposed another small issue). Because of that we did not actually send any data on the retry, only sending the content-length followed by no data. Finally, the small issue mentioned in the previous paragraph was how we check if we have uploaded all our data. It was only checking if the byte-device was atEnd(), which it was. But only because it had not yet prepared any data for us. Fixes: QTBUG-91284 Pick-to: 6.1 6.0 5.15 Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix namespace error of std::source_location under C++20Zhang Xiang2021-04-291-1/+11
| | | | | | | | | | | | | | | | | | | | With C++20 standard, src/corelib/kernel/qproperty.h of Qt Base cannot be compiled at line 100: QPropertyBindingSourceLocation( const std::experimental::source_location &cppLocation ) The reason is that source_location has been merged into namespace std since C++20, and the header file has also been change from <experimental/source_location> to <source_location>. The problem can be avoided by define a constant. Fixes: QTBUG-93270 Change-Id: I46b4daac6ea20f9623b43746880500d41396afb2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix compiler warning from int size mismatchVolker Hilsheimer2021-04-291-2/+2
| | | | | | | | Cast consistently to quint8, which is the type we are streaming out in the test. Change-Id: I44d360ca6b75f14e7a2b80962ad249a6f6b1cb31 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix comparison between nullptr and QWeakPointerVille Voutilainen2021-04-281-0/+15
| | | | | | | | | | | | | | | | | The comparison between nullptr and QWeakPointer was just bogus and ill-formed. The INTEGRITY compiler catches that even if nothing tries to use the comparison. It is an ill-formed, no diagnostic required case of a function template never being able to produce a valid specialization. And while we're at it, this patch makes the result of comparing a nullptr to a QWeakPointer or vice versa the same as asking .isNull() from the weak pointer, because it seems mind-boggling if those are not the same operation. Task-number: QTBUG-93093 Change-Id: I0cc80e795c9af2be1b76de05157aa458ef260f2e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Call updateHighDpiScaling() on screenAdded()Morten Johan Sørvig2021-04-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | QHighDpiScaling has two init/update functions: - initHighDpiScaling(): called once during QGuiApplication construction - updateHighDpiScaling(): called whenever (relevant) screen configuration changes Currently the calls to updateHighDpiScaling() are made from multiple places including platform code. Simplify by calling it from two locations: - QWindowSystemInterface::handleScreenAdded() - QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange() Replace comment about early calls to qt_defaultDpi with a test which calls qt_defaultDpiX/Y with no screens attached. (Looking at the qt_defaultDpiX() implementation, it is unlikely that there will be a problem as long as updateHighDpiScaling() is called before QGuiApplication::primaryScreen() starts returning a non-null value.) Change-Id: I447db42894617495843a5cb531a1322b000fed62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port QDBusServiceWatcher::watchedServices to bindable propertiesAndreas Buhr2021-04-282-1/+32
| | | | | | | | Fixes: QTBUG-92993 Change-Id: I379c67c75bc536e387889de5303b01aef9399fcd Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Add grabber context pointersShawn Rutledge2021-04-282-2/+2
| | | | | | | | | | | | | | In Qt Quick we now need to keep track of which QQDeliveryAgent is responsible when a point is grabbed, either passively or exclusively. When we re-deliver to that grabber, we need to do it via the same agent, so that the same scene transform is used, and the grabber will see the event in the correct coordinate system. It's easier to track this mapping here instead of in a separate map in Qt Quick. Pick-to: 6.1 Task-number: QTBUG-92944 Change-Id: I69f769c694d0da24885cdf4087e5032022bff629 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port QPropertyAnimation::targetObject to bindable propertiesAndreas Buhr2021-04-281-4/+19
| | | | | | | | | | | | | | | | | | This is one of the more complicated ports. The target object was represented by two variables in the past: A raw pointer and a QPointer. The QPointer is checked in some cases to check whether the target object still exists. This patch introduces a targetObjectDestroyed() slot and connects it to the destroyed(QObject*) signal of the target object. In this slot, the animation is stopped. The checks become obsolete thereby and it is sufficient to represent the target Object in one raw pointer. This raw pointer becomes a bindable property. Fixes: QTBUG-92992 Change-Id: I7e2ddb5d8aed007400fe74bea1becf7bdfbf2563 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix wrong C-style cast, use correct QTest::keyClick overloadVolker Hilsheimer2021-04-281-1/+1
| | | | | Change-Id: Ic1e170a5f63da76067a48c3775c47e202948b616 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix warnings from ignored [[nodiscard]] returnsVolker Hilsheimer2021-04-281-8/+8
| | | | | Change-Id: I1c7506c81f0d4d43a875c64120e93660de619610 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warnings from int/size_t mismatchesVolker Hilsheimer2021-04-282-4/+4
| | | | | | | | Cast size_t return from std::vector explicitly to int to silence compiler warnings. Change-Id: I0c425b3cec7feec0712e1173ab7e60b28695d6d7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix warnings from deprecated posix functionsVolker Hilsheimer2021-04-282-4/+6
| | | | | | | | | Windows wants ISO C++ _fileno and _unlink instead of posix fileno and unlink. For fileno we have the QT_FILENO macro in qplatformdefs.h, so use it. For unlink we don't have a macro in Qt, so declare one in the test. Change-Id: I56c5c3fb4e500769c744132c46107816f89bb2c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QAbstractAnimation to the new property systemSona Kurazyan2021-04-272-1/+92
| | | | | | | Task-number: QTBUG-85520 Change-Id: I2710c314b8c32b03fccb826fd78482ee7095fdda Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port of QItemSelectionModel::model to new property systemAndreas Buhr2021-04-272-1/+28
| | | | | | | | | | The property 'model' is ported to a bindable property. The properties hasSelection, selection, selectedIndexes, and currentIndex are left for later patches. Task-number: QTBUG-85520 Change-Id: Ia424ce99fc80c3d807c634c21d161a3ad94b27d2 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Android: unblock passing testsAssam Boudjelthia2021-04-277-36/+0
| | | | | | | | | | | | | | | | | | Those tests don't fail anymore and show in CI as BPASS, so we can safely, hopefully, unblock them Task-number: QTBUG-87429 Fixes: QTBUG-68974 Fixes: QTBUG-69166 Fixes: QTBUG-87403 Fixes: QTBUG-87411 Fixes: QTBUG-69083 Fixes: QTBUG-69084 Fixes: QTBUG-87426 Pick-to: 6.1 Change-Id: I831b955116c0f465319b9c5fc726dd98804d1c00 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make loop variables references in date benchmarkDavid Skoland2021-04-271-5/+5
| | | | | | | | This more accurately simulates real-world usage. Change-Id: Ib1b49d165b3cfaef2bef51e958a1830cc7f8c285 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Declare loop arg in benchmark unusedDavid Skoland2021-04-271-2/+2
| | | | | | | | Since these tests do not actually use the filename in the loops, add macros to declare them unused. Change-Id: I3362e0478ac6802b37f54f90ca377aa462570d8c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Check POSIX rules during QTzTimeZone creationEdward Welbourne2021-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | Previously, an apparent POSIX rule would be saved and any defects in it would only be discovered when trying to use it to generate transitions. Instead, check that it has the right form during the initial parsing of its data. In the process, since checking for DST in the process is trivial, implement a long-standing TODO to cache hasDaylightTime()'s answer. The array it scanned was in any case being scanned during construction, so detecting DST in init()'s scan is trivial; and its failure to check the POSIX rule mean it failed to notice when zones entirely specified by a POSIX rule have DST. Adapt a test using a POSIX-only rule to verify it does know the zone has DST; it did not, before this change. Change-Id: I690c013d3331600f7348dae61c35d41e5599da70 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of a POSIX zone rule describing permanent DSTEdward Welbourne2021-04-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The description necessarily has fake transitions at start and end of the year, potentially outside the year. These transitions should not be reported by QTzTimeZonePrivate as transitions, although its data() must find a "transition" whose data it can use (as in the permanent standard time case, which could potentially be represented the same way, although there's a saner way to do so, that the code already handles) to report the zone's properties. In the process, fix (and make more straightforward) the convoluted decision-making code that was deciding which transitions to include in the returned list. It was assuming invalidMSecs() would be set as the atMSecsSinceEpoch of a transition, although this is computed in a way that makes that value most unlikely, even when the result is invalid. It also rather confusingly mixed < 0 tests as tests for overflow with the one < 0 test that's about ignoring DST before 1970. Also added comments to clarify some of what's going on there. Expanded a recently-added test of a permanent DST zone to verify this now works correctly. Change-Id: Ia8d98f433fb1e479dba5479220a62196c30f0244 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Correct the parsing of POSIX rule day-of-year fieldsEdward Welbourne2021-04-271-0/+12
| | | | | | | | | | | | | | | | | There are two formats for such fields: one with a J prefix on a number in the range 1 to 365, the other with no prefix and a range from 0 to 365. The code mistakenly treated the latter as if its range were from 1 to 366. The J-form doesn't count Feb 29th, so March always starts on day 60; the code tried to take that into account, but adjusted in the wrong direction (and this mislead me, in a recent partial fix, into a fence-post error). Add a test-case based on the Africa/Casablanca POSIX rule seen on RHEL 8.2, which tripped over the off-by-one error without a J prefix. This incidentally also tests the J case. Change-Id: I692ca511e5c960f91a6c21073d3b2f037f5e445f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Skip tst_QUrl::testThreading() under QEMUAndrei Golubev2021-04-272-0/+5
| | | | | | | | | | | | It usually fails the test with "corrupted size vs. prev_size" message coming from malloc() or some other memory allocation routine (which signals about memory corruption probably) Task-number: QTBUG-93176 Change-Id: I5e34971267c52c63cda2489bef5b09bed739f532 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6d52d86b999088ec07e58c14197bddda043ef0aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add more tests for QList/QString/QBAAndrei Golubev2021-04-273-27/+483
| | | | | | | | | | | | | | | | The major part is stability tests for QList operations, Also added std::shared_ptr to the Custom type. shared_ptr accesses the memory which does not directly belong to QList, so using it inside a passed-to-qlist type is beneficial (e.g. ASan could catch extra issues) Basic prepend-aware cases added to QString/QBA tests Task-number: QTBUG-93019 Change-Id: I50e742bdf10ea9de2de66539a7dbb9abc4352f82 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit adb41bbe00b2b853d4dd26cd9ee77ae5ed541576) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add tests for QtPrivate::q_relocate_overlap_nAndrei Golubev2021-04-271-0/+281
| | | | | | | | | | | | | | | Test the relocation logic through the QADP::relocate() method which basically calls q_relocate_overlap_n inside and then ensures that the data pointers are in good state Running these locally in fact revealed a bug in the implementation, so these tests are definitely good to have Task-number: QTBUG-93019 Change-Id: I353ed46a31c5c77cd0c5fcacd3dfce46e5cf3e67 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 65d0f6829cc124f6d0d4003a17bedcb74dddf33b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Resurrect data moves in QListAndrei Golubev2021-04-272-16/+59
| | | | | | | | | | | | | | | | | Use the data moves to readjust the free space in the QList, which ultimately fixes the out-of-memory issues caused by cases like: forever { list.prepend(list.back()); list.removeLast(); } Task-number: QTBUG-91801 Task-number: QTBUG-91360 Task-number: QTBUG-93019 Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9)
* Resurrect tests for QSharedPointerVille Voutilainen2021-04-273-3/+16
| | | | | | Task-number: QTBUG-93093 Change-Id: I030c18db1ab9e48cbd3339bc2040ba0b46cd1370 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Fix tst_qaddpreroutine to work with static buildsAlexandru Croitor2021-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | DEFAULT_IF needs to be true so that in a static build the built plugin is automatically linked into the test executable using the special static plugin per-repo behavior in qt_internal_add_executable. The QtPostProcess routines are not executed for this test project because we don't use qt_build_repo. This means that no QtFooPluginCMakeConfig.cmake file is generated and thus there's no point in using qt6_import_plugins because the pulic plugin genexes won't know about this target anyway. Explicitly set the CLASS_NAME so that the name expected by the Q_IMPORT_PLUGIN macro matches the name of the plugin instance that moc generates in QT_MOC_EXPORT_PLUGIN. Amends 22e967c3049608f82abd32a0beb0b4b36ee134bf Task-number: QTBUG-87580 Task-number: QTBUG-90341 Pick-to: 6.1 6.0 Change-Id: I5ef361e7e2cebc46b35310c679f15c84cd61b4a5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fuzzing: Test different calendar systemsRobert Löhning2021-04-261-1/+5
| | | | | Change-Id: I61be9f09d4299674e9cf9daf1d4dbbf90f3d2d2d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Port of QTimeLine to new property systemAndreas Buhr2021-04-262-14/+290
| | | | | | | | | | | | | The six properties duration, updateInterval, currentTime, direction, loopCount and easingCurve have been ported to the new property system and are now bindable. Drive-by renamed a local variable to avoid shadowing. Task-number: QTBUG-85520 Change-Id: Ibabf106f5200d2dd4329a1e1f96112eccc29d6b1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix QTreeModel calling beginRemoveRows twiceLuca Beldi2021-04-261-0/+16
| | | | | | | | | | | | | For items that are children of other items, removeRows calls beginRemoveRows directly and then once again inside takeChild() The signal blocker that dates back to the monolitic import from Nokia prevents the model from emitting extra signals but the persistent indexes are corrupted nonetheless. Fixes: QTBUG-90030 Pick-to: 6.1 6.0 5.15 Change-Id: I5bc4b2598bf13247683b113faeec22471f1f04a4 Reviewed-by: David Faure <david.faure@kdab.com>