summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix storing of QDateTime timespec for SqliteJoni Poikelin2018-08-171-0/+38
| | | | | | | | | | | | | | | Commit 9e64fc9e1cebf1e11694c4f536881128f5aee288 caused a regression which stored all QDateTime entries as if they were in localtime, which causes them to be offset by the amount of local timezone offset. This is fixed by adding "Z" if the time should be in UTC or using "+/-hh:mm" if it should use fixed UTC offset or specific timezone. Task-number: QTBUG-57138 Change-Id: Ie60905dfb3a517db442b636ca41daf8348753d84 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 0a5f71c6062d575602ff041fb1b88ec2d8ad92bc)
* Blacklist tst_QOpenGL autotest in Windows 7Tony Sarajärvi2018-05-231-0/+2
| | | | | | | | | | Task-number: QTBUG-63122 Change-Id: I32e809f449a089306db0e28ae23ed25090f598ec Reviewed-by: Joni Jäntti <joni.jantti@qt.io> Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> (cherry picked from commit ba1b73175b5b47ff0565c58f0d6c51d515c21831) (cherry picked from commit 9909ff108e942ea0cd233d2cd3715f830c2ad89b) Reviewed-by: Liang Qi <liang.qi@qt.io>
* QJsonDocument: Avoid overflow of string lengthsJüri Valdmann2018-05-172-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The added test case contains the binary JSON equivalent of ["ž"] with the modification that the string's length has been set to INT_MAX. In Value::usedStorage this length is used through the pointer d like so s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d); Because 2 * INT_MAX is UINT_MAX-1, the expression as a whole evaluates to 2, which is considered a valid storage size. However, when converting this binary JSON into ordinary JSON we will attempt to construct a QString of length INT_MAX. Fixed by using String::isValid instead of Value::usedStorage. This method already takes care to avoid the overflow problem. Additionally, I've tried in this patch to clarify the behavior of Value::isValid a bit by writing it in a style that is hopefully more amenable to structural induction. Finally, the test case added in my previous patch had the wrong file extension and is renamed in this one. Task-number: QTBUG-61969 Change-Id: I45d891f2467a71d8d105822ef7eb1a73c3efa67a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 8e47474baf06b3884e9173302395dd25fc09eba9) Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f24bd1b8183ec9cc4e239dc560072d3896ec61a1)
* QJsonDocument: Validate also zero-length objectsJüri Valdmann2018-05-171-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The added test case is the binary JSON equivalent of {"a":{"š":null}} with two modifications. First, the length of the string "š" has been corrupted to 0xFFFFFF00. Second and more import, the Base::size field of the inner object has been reset to 0. On its own the first modification would normally trigger a validation error. However, due to the second modification the Value::usedStorage for the inner object evaluates to 0, completely disabling all further validation of the object's contents. Attempting to convert this binary JSON into standard JSON will lead to the JSON writer trying to construct a QString of length 0xFFFFFF00. Fixed by validating also objects with usedStorage == 0. Task-number: QTBUG-61969 Change-Id: I5e59383674dec9be89361759572c0d91d4e16e01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 93e0ff037e3e4d72d404c26b8e957092d5f88652) Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 60a7d578c8add335900d4d1006b3b2c49f141873)
* QJsonDocument: Reject objects containing themselves in binary JSONJüri Valdmann2018-05-171-0/+0
| | | | | | | | | | | | | The added test case is a binary JSON file describing an array which contains itself. This file passes validation even though attempting to convert it to plain JSON leads to an infinite loop. Fixed by rejecting it in validation. Task-number: QTBUG-61969 Change-Id: Ib4472e9777d09840c30c384b24294e4744b02045 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 3fc5500b4f2a8431ac013520e9faf606e893b39a) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7dcb413858dfea8487c2f44b5c64f160b85cd5a0)
* QJsonDocument::fromRawData: Fix out-of-bounds accessJüri Valdmann2018-05-172-0/+1
| | | | | | | | | | | | | | | | This method takes a pointer+size pair, but begins reading through the pointer without first checking the size parameter. Fixed by checking the size parameter. A new test case is added with an empty binary json file. Although the test does not fail under normal conditions, the problem can be detected using valgrind or AddressSanitizer. Task-number: QTBUG-61969 Change-Id: Ie91cc9a56dbc3c676472c614d4e633d7721b8481 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d3935cbd71171e1d8f3742cc3235ca0c38313ec8) (cherry picked from commit 961b8f51a2e8198fce12e8784b1edae6b3f6f67b)
* Stop depending on test.macieira.orgThiago Macieira2017-11-282-3/+3
| | | | | | | | | We have had test.qt-project.org for close to 3 years now. Change-Id: I71488efd29b645f7b228fffd14fadf4627288243 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> (cherry picked from commit 5f66f871816d083da9795d71f746413d6f6118f7) Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* tst_qlocale::macDefaultLocale - remove flaky/incorrect testTimur Pocheptsov2017-11-131-2/+0
| | | | | | | | | | | | | | | | currencySymbol == "$" does not mean negative currency values will be formatted as "($value)". With all locales I have on my mac machines (10.11/10.12) the result is different from what this test expects. Also, the results are very different for different locales. Apparently, we never saw this problem before since in our CI "macs" we never have US Dollar/en_US selected in System Preferences. Task-number: QTBUG-58784 Change-Id: Ic2c3a3172bf1e715e99092ddee8f461b216d995a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 5542e772d6e0690b7d8b3ac0ae591331401e871a) Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Revert "QCryptographicHash: make SHA3 calculate SHA3, not Keccak"Thiago Macieira2017-08-311-102/+64
| | | | | | | | | | | | | This reverts commit a647004d9f349e0edc4254dcfe672ccf18f98ea7 (which is a backport of 88a8feeacb9bdaff9ee06164424e407eb904cd10). After the 5.9.0 release, we've found that changing the algorithm is a bad idea. It's true that Qt hasn't calculated SHA-3, but it's calculated something and people may be using it. Keeping a consistent calculation is better for the 5.6 LTS. Discussed-on: http://lists.qt-project.org/pipermail/development/2017-August/030786.html Change-Id: I38341f8155354cc4a776fffd14dfdbcdc7d0f039 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "tst_qwidget::activation expect fail on Win 10"Joni Jäntti2017-08-311-6/+0
| | | | | | | | | | | | | This reverts commit 85612817685f8b64307276a2ce9ef79d9e048be4. This change needs to be reverted because Windows 10 Creator's Update doesn't fail on this test anymore during CI runs. Reason for this is unknown. Change-Id: Ice250ecedb14ac96fb3693b2d9884ef452a91cc2 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commit e938150412d22e61926fe16791158805b71268bb) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Revert "tst_qgraphicswidget expect fail on Win 10"Joni Jäntti2017-08-301-7/+0
| | | | | | | | | | | | This reverts commit 3d5bf00f18b5b9d1f5de4ff610ad15d5d0ed8c3d. This change needs to be reverted because Windows 10 Creator's Update doesn't fail on this test anymore during CI runs. Reason for this is unknown. (cherry picked from commit de6d6eb13ebfeefc6e628cc46d695d7693d364ec) Change-Id: I8b0e61ca4c3711d818508cb1094a57272d9ac11f Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* tst_qgraphicswidget expect fail on Win 10Joni Jäntti2017-08-151-0/+7
| | | | | | | | | | tst_qgraphicswidget::checkReason_ActiveWindow fails on Windows 10 Creators Update. Added expect fail for Windows platform. Task-number: QTBUG-62244 Change-Id: I71868a496659e7136af9a5b74684ba39edaf03ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 3d5bf00f18b5b9d1f5de4ff610ad15d5d0ed8c3d)
* tst_qwidget::activation expect fail on Win 10Joni Jäntti2017-08-151-0/+6
| | | | | | | | This test fails on Windows 10 x64 Creators Update CI builds for unknown reasons. Change-Id: I766bccfd4dea9ea195c68403018b419e800a7b3b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 85612817685f8b64307276a2ce9ef79d9e048be4)
* tst_qfocusevent activateWindow for Win 10Joni Jäntti2017-08-151-0/+9
| | | | | | | | | | This workaround was created to make tst_qfocusevent test pass on Windows 10 x64 Creators Update. Task-number: QTBUG-61467 Change-Id: I63eb149ae850174fb5de99761a6001e000a151a2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit b091472f44546446b82efe7c9e69de570deeda8d)
* Fix failing network cookie jar testsSimon Hausmann2017-08-071-4/+4
| | | | | | | | | | | | | | The test verifies that a cookie with a date in the future is not "expired" and will be sent to the server. This test started failing on August 7th 2017 when the test case "0003" with it's cookie expiring August 7th 2017 started ... expiring ;-) Bumped all suspicious cookie test cases by a hundred years. Change-Id: I7c09069ec4999e2ea0aae7b2a2819cced0fd6a99 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> (cherry picked from commit b75bc0f75c09b192dba68449b009cdf175519dbd) Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Ignore failure of tst_qmenu::submenuTearOffDontClose on macOS 10.11Simon Hausmann2017-07-041-0/+2
| | | | | | | | | The test is failing inexplicably on macOS 10.11. Task-number: QTQAINFRA-1315 Change-Id: Ia0162768b6d4fdd016bce62b92c3df0b5d4ed8d0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 3e67f727b84a06c0742aad0abbec027b57fef657)
* Ignore tst_qwidget::showMinimizedKeepsFocus on macOS 10.11Simon Hausmann2017-07-041-0/+1
| | | | | | | | | | It's failing for inexplicable reasons not only on 10.10 but also 10.11. Task-number: QTQAINFRA-1317 Change-Id: Id316764443dfe9e0ae30e2d25d8bae73fa255617 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> (cherry picked from commit 666f5dbb153c5d7e4d739923a2a4f557883c3060) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Ignore tst_macNativeEvents::testPushButtonPressRelease on macOS 10.11Simon Hausmann2017-07-031-0/+3
| | | | | | | Task-number: QTQAINFRA-1292 Change-Id: I1047b797380820d2636f4d514b41b621c7794486 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> (cherry picked from commit 0c7e4b97a7990b29255abaf4568f62b6a6b6c470)
* Skip the threaded systemProxyForQuery test on Windows 7Simon Hausmann2017-07-031-1/+4
| | | | | | | | | | | | Under qemu/kvm the systemProxyForQuery call - when initiated from a secondary thread - never completes. Consequently the thread hangs, test fails and the crashes due to the inability to cleanly terminate the test thread. Task-number: QTQAINFRA-1200 Change-Id: I9bd4ed163d215fadd8532a03bbdccd80fc8d9cb1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> (cherry picked from commit f17554fce1d693cfd58bd568d2e43e977b3a6507)
* Ignore tst_QOpenGLWidget::clearAndGrab failures on UbuntuSimon Hausmann2017-07-031-0/+2
| | | | | | | | | | | The test fails for unknown reasons when using the mesa swrast when using qemu/kvm (as opposed to when using the vmware mesa driver). Task-number: QTQAINFRA-1318 Change-Id: Ib7e9d894cd368b8c2c12d83ec1e4862622781fe6 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 5628d47291eb5fcf3ef771cfbd5c2cfcab687de6)
* Fix Angle check in QGLBuffer auto-testSimon Hausmann2017-06-291-1/+1
| | | | | | | | | | Ammends commit 5c13acd3c953dd9f8fd9b17d7a1be7c3f5e4004f by correcting the #ifdef for Windows. Task-number: QTQAINFRA-1199 Change-Id: I6789e4f1726bab0d4f9d4c8f91383b8ef850ec5b Reviewed-by: Joni Jäntti <joni.jantti@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Ignore tst_qglbuffer vertexBuffer and indexBuffer failures with AngleSimon Hausmann2017-06-221-0/+7
| | | | | | | | | | Together with the Angle version we're shipping in, the results we're getting from the read do not match. The test works in Qt 5.9 and onwards, and it passes in 5.6 with QT_OPENGL=software. Task-number: QTQAINFRA-1199 Change-Id: I92eff44441b0f03dc5126467dd13ed46648b6abd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Blacklist AAAA related DNS lookup tests on Windows 7/8.1Simon Hausmann2017-06-212-0/+10
| | | | | | | | | | | | These are failing in Qt 5.6 when using qemu/kvm and the tests are skipped in 5.9 as Qt thinks IPv6 is not supported. The tests are skipped when running under vmware (with vmxnet) for the same reason. The actual reason for why the trip-A lookups are not working is unknown. They do work when using nslookup in a command shell. Task-number: QTQAINFRA-1201 Change-Id: I224f167be7d4657646ffcd16940cabec02f9d4e4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Ignore test failures of linkLocalIPv6 on RHEL 6.6 in the CISimon Hausmann2017-06-161-1/+2
| | | | | | | | | | | | | | | | The test fails as sendmsg() on the socket trying to deliver a packet to the IPv6 link-local fe80 address returns with -ENETDOWN. This happens always when RHEL 6.6 is run under qemu/kvm and only sometimes under VMware. More details are in the task, but meanwhile the result of this test is ignored. This affects only RHEL 6.6, it passes on RHEL 7.2. Change-Id: I4ade5cd249dd0d1901368ab571dad324e0fd10c2 Task-number: QTQAINFRA-1042 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> (cherry picked from commit b598cd0483d28282179ab46cb27e42d44b8f2b7b) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix crash when calling QWidget::grab() on a QOpenGLWidgetSérgio Martins2017-06-081-0/+2
| | | | | | | | | | | | | | | By avoiding unneeded nested QPainters. Crash was: ASSERT: "s" in file /data/sources/qt/qt5/qtbase/src/gui/painting/qpaintengine_raster.cpp, line 2239 s was nullptr because the inner QPainter had called updateState(0), which is then dereferenced by the outer QPainter. Task-number: QTBUG-61036 Change-Id: I7aad648f805f1abac4d38dfbefa2292da8b52af4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 0265a23bb02b68534bb3c86514cc93bc45a7444f)
* Skip failures of task232085_spinBoxLineEditBg with the real Gtk styleSimon Hausmann2017-06-081-0/+2
| | | | | | | | | | The test mysteriously fails once we run it not under vmware (where vmware-tools somehow ended up messing with fontconfig and styles) but under a plain Ubuntu-14.04 in qemu/kvm. Change-Id: I15604ff88fbdbfdc22458ba43844546428174d3c Task-number: QTQAINFRA-1241 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Autotests: Blacklist "utun" interfaces on DarwinThiago Macieira2017-06-082-0/+22
| | | | | | | | | | | | | Packets sent to to link-local addresses on it are never received. We don't know why this happens, as the tooling provided by Apple for development is close to useless. So we just ignore this interface. Task-number: QTBUG-61041 Change-Id: Ia608df1fff6bdee5238e107d8a50292a1f9e5c03 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry-picked from commits e579c822c5bedf5e626e4eb72db3b49a4a4015dc and 74111ce590ec8b40ee48e828c238bbfb1bf41aaa) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove some more register keywordsMarc Mutz2017-05-091-1/+1
| | | | | | | | They're deprecated since C++11 and removed in C++17. Change-Id: Ia2acd9312707bfee96838743645a04ae1780e5dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b92267cd4c4a7c88aab950ad519943d85add1da2)
* QHash/QMultiHash: fix operator==Giuseppe D'Angelo2017-05-091-2/+67
| | | | | | | | | | | | | The existing QHash::operator== does not work when the same keys appear in different order between the two hashes being compared. However, relying on iteration order on a QHash is (as usual) a bad idea and one should never do it. Task-number: QTBUG-60395 Change-Id: Ifb39a6779230e26bbd6fdba82ccc0247b9cdc6ed Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit dbd55cdaf367bdc9d6774bcb9927cbe19f18065f) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUrl: fix IDN conversion when the ACE form is invalidThiago Macieira2017-05-041-0/+25
| | | | | | | | | | | | | | | | | We guarded against the Unicode form being invalid and did not produce an encoded form. But we did not guard against proper Punycode sequences that decode to forms that had not passed the proper Nameprep stage. So check for that and, if it fails, just keep the label in the form we found it in (it's valid STD3 anyway). [ChangeLog][QtCore][QUrl] Fixed a bug that caused certain domain names that look like Internationalized Domain Names to become corrupt in decoded forms of QUrl, notably toString() and toDisplayString(). Task-number: QTBUG-60364 Change-Id: Iadfecb6f28984634979dfffd14b833142cca8d0d Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 9e2c6899e0a07edf525945a182d2537086441268)
* QUrl: fix IDN whitelist checking when the TLD is in UnicodeThiago Macieira2017-05-041-0/+8
| | | | | | | | | | | The whitelist is kept in ACE form, so if the TLD came in Unicode, we need to run ToASCII before we can check the whitelist. This is slightly inefficient because we'll run the same operation later in this domain. Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org> (cherry picked from commit 21dd5d314a75c09250448e5d59dfb9af88c0f7d5)
* Windows: Fix tst_QFileDialog2::completionOnLevelAfterRoot()Friedemann Kleint2017-05-021-1/+1
| | | | | | | | | Change the check for the unambiguous match to be case insensitive. Task-number: QTBUG-60466 Change-Id: Iaa019cc803a56b015f45309fb1b3a7a8a3d82ee4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 425986acf32a60288a8a2ed9b3b2b180f60b5514)
* QMatrix4x4: fix aliasing problem in operator*=Marc Mutz2017-04-141-0/+4
| | | | | | | | | | | | When multiplying a QMatrix4x4 by itself, we were clobbering the very matrix we read from. Employ read-caching to avoid this aliasing problem. [ChangeLog][QtGui][QMatrix4x4] operator*=() now calculates the correct result even if the RHS and LHS are the same object. Change-Id: I8534d56cfdd62c336577125127f05173fcec2873 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> (cherry picked from commit 5662234afaf23d88e1f3fa4bee2a59b61bd0c267)
* QCryptographicHash: make SHA3 calculate SHA3, not KeccakGiuseppe D'Angelo2017-03-311-64/+102
| | | | | | | | | | | | | | | | | | | | The SHA3 family is a modified version of Keccak. We were incorrectly calculating Keccak (and even *testing* Keccak!), but claiming it was SHA3. To actually calculate SHA3, we need invoke Keccak on the original message followed by the two bits sequence 0b01, cf. §6.1 [1]. [1] http://dx.doi.org/10.6028/NIST.FIPS.202 [ChangeLog][QtCore][QCryptographicHash] QCryptographicHash now properly calculates SHA3 message digests. Before, when asked to calculate a SHA3 digest, it calculated a Keccak digest instead. Task-number: QTBUG-59770 Change-Id: Iae694d1a1668aa676922e3e00a292cddc30d3e0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 88a8feeacb9bdaff9ee06164424e407eb904cd10)
* tst_QMimeDatabase: increase update-mime-database timeout to 4minsMarc Mutz2017-03-221-1/+6
| | | | | | | | | in the vain hope to get the CI unstuck again. Change-Id: I1b01bb1d59a8850f68d1d80838f5606f4159bcbd Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> (cherry picked from commit 1b73d1397555b99385c03eba8b5e6347b49d27f9) Reviewed-by: David Faure <david.faure@kdab.com>
* QDir::mkpath: don't try to mkdir in automount filesystemsThiago Macieira2017-03-201-1/+1
| | | | | | | | | | | | | | | | | Automount filesystems like /home on many operating systems (QNX and OpenIndiana, at least) don't like if you try to mkdir in them, even if the file path already exists. OpenIndiana even gives you an ENOSYS error. So instead, let's try to mkdir our target, if we fail because of ENOENT, we try to create the parent, then try again. Task-number: QTBUG-58390 Change-Id: Ibe5b1b60c6ea47e19612fffd149cce81589b0acd Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit d9a2dd8d3b55d16d2e38d124abb0ade490963b37) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Call disconnectNotify() when disconnecting a QMetaObject::ConnectionUlf Hermann2017-03-171-2/+21
| | | | | | | | | | | In all other forms of disconnecting this is done. We also know the signal index, so there is no reason not to do this. Change-Id: Ic8b042cd8f45dbff74b42ee30c384a84bef78b20 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> (cherry picked from commit 972580accdd0732b33947e8b1ca0ba8943041bdc) Task-number: QTBUG-59500 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix parsing of day-of-week names that start with another nameThiago Macieira2017-03-161-0/+50
| | | | | | | Task-number: QTBUG-59159 Change-Id: I95c9e502ccc74af3bcf0fffd14a69e0cd27ce96b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 04b8db3d57970631351fc6330af9553e94f1b14d)
* Blacklist tst_QPauseAnimation::multipleSequentialGroups()Marc Mutz2017-03-021-0/+2
| | | | | | | | | It's been determined to be be flaky on the CI, but only on the 5.6 branch. Task-number: QTBUG-59218 Change-Id: I23c6673b2824c982bf30574888bca7c3306d0ecc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Blacklist tst_QTimer::remainingTime() on Windows and macOSFriedemann Kleint2017-03-021-0/+3
| | | | | | | | | Task-number: QTBUG-58519 Change-Id: Ib03aa0bdeaa9ed0dc2f0d92aa11d07ffcdc2bc26 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> (cherry picked from commit 737383875e3878beebedbc04492d8b8d9d13bc71) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QVarLengthArray: fix appending an already-contained itemMarc Mutz2017-02-211-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> (cherry picked from commit 0e3d6fe4f69955bf98e23a382caf5251e2b47ea0)
* QInputDialog: prevent crash in static get*() functions when parent gets deletedMarc Mutz2017-02-202-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | As explained in https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 creating dialogs on the stack is a bad idea if the application or the dialog's parent window can be closed by means other than user interaction (such as a timer or an IPC call). Since we cannot know whether Qt is used to build such an application, we must assume it is, create the dialog on the heap, and monitor its lifetime with a QPointer. Instead of using manual resource management, add a minimal implementation of QAutoPointer, and use that in all static get*() functions. Task-number: QTBUG-54693 Change-Id: I6157dca18608e02be1ea2c2defbc31641defc9d1 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit c876bb1f1333e47722e202b0916415e771137071)
* tst_QThreadPool: don't deadlock when a cancel() test failsMarc Mutz2017-02-151-0/+20
| | | | | | | | | | | | | | | | | | | | | | We keep the runnables from finishing by having them block on a QSemaphore::acquire() call inside run(). If we fail a test that precedes the call to sem.release() further into the test, the early return will cause the thread pool to be destroyed, which will then attempt to wait for the runnables to finished, which, in turn wait for the semaphore to be released. -> dead lock Fix by introducing a RAII object to release the semaphore with a sufficiently large number to unblock all runnables. That number will in some situations be too large, but that does not matter. Change-Id: I1ec7e29b37bc36309e93e6e30708cc7db3c9579c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b4689401a5ea142c9e2136b77d9193792874400a)
* Wait for runnables to start up in tst_QThreadPool::cancel()Marc Mutz2017-02-151-3/+10
| | | | | | | | | | | In order to get reproducible runs of the test, we need to wait in the main thread until all runnables have started executing. Otherwise, what the cancel() loop below actually does will vary from run to run. Change-Id: Ib912b0943e7bbd55c9480ae6fd4011ba20ac457e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 410a14cc768ad084a4e474ffd8b61471405fce0f)
* tst_QThreadPool: simplify cancel()Marc Mutz2017-02-151-5/+8
| | | | | | | | | | | | Instead of allocating a statically-sized array on the heap, use an automatic C array instead. Replace some magic numbers with named constants. Change-Id: I17d29a76a67c4a413453ac26a5dee8cd54a8a37d Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 8087ea67b1457db5da5a641628a11a84a3a119f2) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix UB (data race) in tst_QThreadPool::cancel()Marc Mutz2017-02-151-10/+17
| | | | | | | | | | | | Manipulating a simple int from multiple threads is a data race, thus undefined behavior. Fix by using QAtomicInt and atomic operations instead. Change-Id: I5418bc260da57fe353a71b8e5c7c1c97adbe7597 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit dcf74bdec83ba450b2016081339f48ac7469e1f5) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringMatcher: fix setCaseSensitivity() on a non-QString-backed matcherMarc Mutz2017-02-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | When a non-QString-backed mode (via the (QChar*, int) ctor) was added for Qt 4.5, the author forgot to adjust the setCaseSensitivity() function. It still uses q_pattern instead of (p.uc, p.len) as the pattern for which to create the skip-table. Since there is no setPattern() overload for this mode, the correctness of the matcher is not harmed by this, but its performance degrades to that of a linear scan: the skip-table, being filled from an empty pattern, will be all-zeros, sending bm_find() into the 'possible match' case at every character. Since matching is still correct, but slow, it's not possible to write a test for this. I did, however, leave my attempts in the auto-test, for when we add QStringView overloads of setPattern() which will then be able to expose the bug. Change-Id: I7b803e8624b0352a0a974900affbbfc0c260d93b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9e5e30fa130e43524d9ff26493023ac966a878cc)
* Plug memleaks in tst_QStackedLayoutMarc Mutz2017-02-071-1/+1
| | | | | | | | QLayout::replaceWidget() doesn't delete the affected item, but returns it. Change-Id: Ibda96e4bf2432ad13ed2908c7d37547f46e29a37 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 610c7da075789c1ae736c4a016ef822a4e500f29)
* Accept all formatting characters as valid inputEskil Abrahamsen Blomfeldt2017-02-061-0/+22
| | | | | | | | | | | | | Amends 7896ae052ad2c0c6ae2ebfc64cc2f525185198a8. The previous change focused only on ZWJ and ZWNJ, but there are many other formatting characters that we need to support and that may be rejected by the German keyboard-hack. This opens up for all characters in the Other_Format category. Task-number: QTBUG-58364 Change-Id: Ifa600c9610e38e71a71c2f668f2f9fcee5230ef3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 8d752b5151c9890b76d50c4a479ab32dd0eca10c)
* Stabilize tst_QPropertyAnimation::noStartValue()Friedemann Kleint2017-02-061-4/+2
| | | | | | | | | | Remove the qWait() and introduce a QTRY_COMPARE() checking for the end value first. Task-number: QTBUG-58402 Change-Id: I2d3758178de5f67881008f28c406076ad27c4a90 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> (cherry picked from commit a8a74fe81acab07bfe068bff398555804629a88c)