summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
...
* QProperty: add test case for spurious dependency issueFabian Kosmale2020-12-011-0/+52
| | | | | | | | Task-number: QTBUG-88999 Change-Id: Ifcbf23fedfb795771550762dfed8fc38bce65794 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit cea8b5832c56e92aba2b028afc965ddcf384d37b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qtcpserver: Test pauseAccepting/resumeAcceptingMårten Nordheim2020-12-011-0/+33
| | | | | | | | | | | | | Currently untested The socks case is odd: after accepting the first connection it shows as unconnected. Details as for why is unknown, out of scope of adding this test. Change-Id: I0e7658f23b89f3af8db379b001ee33a844f3bec4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 6035fd8f2c23357c46c401fb7120af83e5cf5887) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDtls(cookie verifier): make sure a server can re-use 'Client Hello'Timur Pocheptsov2020-12-011-0/+14
| | | | | | | | | | | | | | | | And extend an auto-test for this. When a cookie verification mechanism is enabled, and verifier, indeed, verifies that some datagram is a 'Client Hello' message with a proper cookie attached, we start a real DTLS handshake creating a QDtls object and calling 'doHandshake'. In case cookie verification was enabled, we need parameters from the verifier (it's a crypto-strong 'number' and hash algorithm) to 'lock and load' the TLS state machine in a freshly created TLS session object. This code path previously was only tested manually and was found by LCOV as untested. Change-Id: Ieacb8c989997999ea10e15bda6ae106a0338b698 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 6a1d9f6fc1e46f7f0af7ec52dc5d6d415c918bf2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSslSocket::verify: do not alter the default configurationTimur Pocheptsov2020-12-012-2/+96
| | | | | | | | | | | | | | | | | | | | QSslCertificate::verify() has an undocumented and not very desirable property - on some platorms it updates the default configuration, which can be surprising. For example, we deprecated QSslSocket::setDefaultCaCertificates() and recommend using QSslConfiguration::defaultConfiguration(), QSslConfiguration::setDefaultConfiguration(), and QSslConfiguration::setCaCertificates(). If an application does this to select CA roots it trusts explicitly, and then for some reason is calling verify, the application can have its QSslSockets successfully connecting to a host, whose root was not trusted by the application. Also, on Windows, defaultCaCertificates() include system roots already, no need to have them twice. [ChangeLog][QtCore][QtNetwork] QSslSocket::verify - do not change the default configuration Fixes: QTBUG-88639 Change-Id: I1cd40b259d0a6dcd15c78d1e7c027ff10859595c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 1158ff67b492853b72199ed78bfcf24132e1c7ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add widget-based test for TouchCancel eventKirill Burtsev2020-12-011-1/+83
| | | | | | | | | Follow up for 45a65cbeb2 Change-Id: Idb4f4eaaa3ee583462430c530f88a4cc32378d6c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6c442ddbf584413fa4228aae4cc277887344e20d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslError: improve the code coverage, as pointed at by LCOVTimur Pocheptsov2020-12-013-38/+98
| | | | | | | | | | | | | And also, reduce the utter sloppiness, weirdness of the test and make it more a test and not a joke. Since the test itself depends on !QT_NO_SSL, why bother building and running its main, to create a useless tst_QSslError and do nothing then? Exclude test from no-ssl build. Change-Id: I67879b0de036cbc8c2f75a18f4cf94e6c43c5af0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit fe009bd51438877d864d2444f40582508c43c1f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Bump the type info version in qhooks.cppLars Knoll2020-12-011-1/+1
| | | | | | | | | | | And correct the comment in tst_toolsupport. Amends change d99fdf17842d914daa41124184c6531c92766cd0. Change-Id: I94e296f5bb5b57132c887072efb0bb56aafc524f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 95730dd19cddd65588c902255513517556afc49f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Inline access to the QBindingStorageLars Knoll2020-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | And inline the fast checks inside the methods in QBindingStorage. This allows QObjectBindableProperty and friends to inline all the fast checks and almost completely eliminates the overhead for property accesses when no bindings are being used. Read and write times of QObject based properties when no bindings are being used: Read Write Old style property: 3.8ns 7.3ns QObjectBindableProperty (no notification): 4.5ns 4.3ns QObjectBindableProperty (with signal): 4.5ns 7.6ns QObjectBindableProperty (inline accessors): 3.2ns 3.4ns Numbers without this patch: Old style property: 3.8ns 7.9ns QObjectBindableProperty (no notification): 7.2ns 7.7ns QObjectBindableProperty (with signal): 7.2ns 16.0ns QObjectBindableProperty (inline accessors): 6.3ns 6.7ns Pick-to: dev 6.0.0 Change-Id: Ifd1fa3a489c3be8b1468c0b88af547aac397f412 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Android: exclude faulty qfilesystemwatcher testAssam Boudjelthia2020-11-263-2/+7
| | | | | | | | Task-number: QTBUG-88508 Change-Id: I11b845e74e599d3bdae4f9490a591893531bc77b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c7dec2faca476c94a40bd4ac5118915b1a5d9aa8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: exclude faulty tst_selftestsAssam Boudjelthia2020-11-263-2/+11
| | | | | | | | | | | | This test was failing but was returning a pass because of a bug in androidtestrunner. Task-number: QTBUG-88507 Task-number: QTBUG-88508 Change-Id: I4fda7c2ddf8cd1e6858617e7bb447078c5768a75 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 63934f13380c9ed3c455394e2ba863d44239f05c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix tst_android testAssam Boudjelthia2020-11-262-3/+2
| | | | | | | | Fixes: QTBUG-88506 Change-Id: I938de388fce8ec393b03b2f0f42ddfe9094e6a5e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 97b914b3e7410ee013ab50680210309524960f55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QVariant/QMetaType::compare APIsGiuseppe D'Angelo2020-11-256-3/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::optional<int> is the wrong datatype to use for compare. First and foremost, it can't be used in the idiomatic form of auto r = a.compare(b); if (r < 0) ~~~ // a is less than b if (r > 0) ~~~ // a is greater than b which we *already* feature in Qt (QString, QByteArray). Also, std::optional<int> (explicitly) converts to bool, which is a trap, because the result of the comparison can be accidentally tested as a bool: if (a.compare(b)) ~~~ // oops! does NOT mean a<b Not to mention extending this to algorithms: auto lessThan = [](QVariant a, QVariant b) { return a.compare(b); }; // oops! std::ranges::sort(vectorOfVariants, lessThan); which thankfully doesn't compile as is -- std::optional has an *explicit* operator bool, and the Compare concept requires an implicit conversion. However, the error the user is going to face will be "cannot convert to bool because the operator is explicit", which is deceiving because the fix is NOT supposed to be: auto lessThan = [](QVariant a, QVariant b) { return (bool)a.compare(b); }; // big oops! Instead: backport to Qt the required subset of C++20's <compare> API, and use that. This commits just adds the necessary parts for compare() (i.e. partial ordering), the rest of <compare> (classes, functions, conversions) can be added to 6.1. Change-Id: I2b5522da47854da39f79993e1207fad033786f00 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3e59c97c3453926fc66479d9ceca03901df55f90) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVLA: do not include QtTestGiuseppe D'Angelo2020-11-251-1/+1
| | | | | | | | | The right include is QTest, QtTest drags in all of QtCore. Change-Id: Icc2964ccdb85fe1bfc9fe8f43351a4605a34329b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bfe77a21fb0988a52fb77af09fe9675eb151e8b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Change generated resources namingAlexey Edelev2020-11-241-3/+3
| | | | | | | | | | | Align generated resources .qrc file naming to qmake naming. Update tests. Fixes: QTBUG-88581 Change-Id: Id8a2f91f23c257e5b8bd371748c2151ec54a6418 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 2548438e326d20eda2eb4398139164f5400d22ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_qfiledialog2 in case directory ~/foo existsAndreas Buhr2020-11-241-2/+2
| | | | | | | | | | | | One test in tst_qfiledialog2 only succeeded if the directory "~/foo" did not exist. This patch changes the path used to "~/Vugiu1co" which has hopefully a much lower probability of existing. The string "Vugiu1co" is taken from a call to "pwgen". Change-Id: Ia82b07902a91eb908a74aa90cdbdf4761d432d9a Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> (cherry picked from commit 824de3850e50904720f959d823fc8d962b639522) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_qlibrary after rebuildAndreas Buhr2020-11-242-2/+30
| | | | | | | | | | | | | | | | | tst_qlibrary depends on a library (targets mylib and mylib2) to be built. They create a library with the same name, in two versions. This is done in order to test versioned library loading. However, those two libraries were fighting over the creation of "libmylib.so". In a fresh build, mylib2 wins, as intended. But after a rebuild, mylib won, which led to failing unit tests. This patch changes the situation. With this change, mylib no longer tries to create "libmylib.so". Thus no fighting and no problem. Change-Id: Id89baa5503c9f078a8737ff0b8616edf09044f72 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 1dff26dd9539feb40767b7761c5339085ad74dbf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Blacklist authenticationCacheAfterCancel on Ubuntu 20.04Alexandru Croitor2020-11-241-0/+4
| | | | | | | | | | | | | | It flaky fails integrations. Amends 2b49b01aa3467173f0be9252cfa50b41a311dd57 Task-number: QTBUG-88417 Change-Id: I6aad6ee7a70e580da64e75f69e8c9cab1cb78cd7 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 143d619ba33c693fbbf9fbc3587921a44ae87435) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_qlibrary by telling CMake about required librariesAndreas Buhr2020-11-241-0/+1
| | | | | | | | | | | | | | tst_qlibraries needs to test libraries to be built in order to run successfully. However, these libraries were not mentioned as dependencies in CMake. This patch fixes that. Fixes: QTBUG-88445 Change-Id: Ic335e46664edd98217bd55a9bca5a58a39cffe66 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit f9d172f5a191a4e0e13923a6a1d31e86107bc75e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compiler warning about discarded return valueVolker Hilsheimer2020-11-231-1/+1
| | | | | | | | | | Not testing the result of the copying, just verifying that it doesn't assert. Change-Id: Ib51129134b74c17eada7e3819ccfff10bb9affbf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit e59ab8b5907f87a77cc6924abab5fb1c82483856) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMetaType: Track whether type is QML list typeFabian Kosmale2020-11-231-19/+23
| | | | | | | | | | This information is required in the QML engine to handle list properties (instances of QQmlListproperty<T> and list<T> types from QML). Change-Id: I1e30572f1c91f58b290cb9b4b07433af99a1db6f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 5806ecf5cb24cf39ea2608d42246eafbaa817582) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fit tst_qprinterinfo in case there are printers in local networkAndreas Buhr2020-11-211-4/+2
| | | | | | | | | | | | | tst_qprinterinfo compared the output of "lpstat -p" with the result of a call to "cupsGetDests". "lpstat -p" only returns local printers, "cupsGetDests" also returns printers on the local network. This patch fixes the test by using "lpstat -e", which also shows printers on the local network. Change-Id: Ia70adad8b8467f4c738f769d34757786fc9645b2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 146a2a21b1fd279e3f26690243db30fba89f9027) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add unit test for QAnyStringView::compareAndreas Buhr2020-11-211-1/+8
| | | | | | | | | | | | Coverage tests revealed that QAnyStringView::compare(QAnyStringView, QAnyStringView, CaseSensitivity) was not tested in our unit tests. This patch adds a test for this. Change-Id: Id8e0d8af87e7e7ab192fb7554a278ddbb890fb14 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ae2c30942086bd0387c6d5297c0cb85b505f29a0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix weight when reading old serialized QFontsEskil Abrahamsen Blomfeldt2020-11-212-4/+4
| | | | | | | | | | | | | | | | | | | The QFont::fromString() needs to differ between strings produced before and after Qt 6.0 when interpreting the weight value, since in older strings this will be the legacy scale. Luckily the number of tokens in the string can be used for this purpose, since many tokens were added in Qt 6.0. This broke KDE, where font settings are stored in QSettings and serialized using QFont::toString() from Qt 5. Fixes: QTBUG-88589 Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 1d14067680f02f47b2f8ff375c44eb64633eec02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: exclude qarraydata::dataPointerAllocate() from CI testsAssam Boudjelthia2020-11-201-0/+3
| | | | | | | | | Task-number: QTBUG-88705 Task-number: QTBUG-87025 Change-Id: If2dc0e650e5104d00a097e6195dd117d6cfd64e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 4713298b98503cc7c4699a6e33e3167622da91d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Test conversion of ulonglong variant to JSONSona Kurazyan2020-11-201-0/+12
| | | | | | | | | | Make sure ulonglong variant converts to a double JSON value when the value is greater than 2^63. Change-Id: I4d4392b05de29c220624056d5d0d4664fb2c08b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 289f909621a8d83320d33e3ff7d651c164034098) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSslCipher - improve its code coverage and auto-testsTimur Pocheptsov2020-11-202-23/+25
| | | | | | | | | | | | | tst_qsslcipher was quite useless - now we test that default constructed QSslCipher reports expected values. Test the non-default from the different auto-test, where we are sure we have really useful ciphersuites (with different parameters obtained from a TLS backend, where it's possible). Change-Id: Iff14a0580fed889cf9e0873bee01d968773626db Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 1a2e2921d268f09b6cb5ca91c85614192b8e2e0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qocsp: improve code coverageTimur Pocheptsov2020-11-201-3/+16
| | | | | | | | | | By simply extending the basic test to trigger qHash, isEqual and a bunch of getters. Change-Id: Ib1d88fc6d2ad623743cea77ac286ae6ac819dfd1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 1d7189f5b3eb03e7c71fb31e2bd491d0e5a535e4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add unit test for QString::insert(negativeint, QChar)Andreas Buhr2020-11-201-0/+1
| | | | | | | | | | | QString::insert(qsizetype, QChar) can insert at negative positions, then counting from the end of the string. Coverage analysis revealed we do not have a unit test for this. This patch adds a unit test. Change-Id: I8d41b38df964c07fe2d2e7be444f8236c9e19b5d Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 7b0fd207756d367db768c3cb546fa439c15bbac8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add unit test for YearMonthDateAndreas Buhr2020-11-201-0/+31
| | | | | | | | | | Coverage analysis showed that QCalendar::YearMonthDate was not rigorously tested. This patch adds a unit test. Change-Id: I0af485d13c4883764b61ea1e35455905cc77b966 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit b02147788b4013a698955aeea9fa92bb5613cc4d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Allow QWindowsPipe{Reader,Writer} to work with foreign event loops"Kai Koehne2020-11-202-44/+2
| | | | | | | | | | | | | | This reverts commit ee122077b09430da54ca09750589b37326a22d85. Reason for revert: This causes QProcess::readAll() to sometimes return nothing after the process has ended. Fixes: QTBUG-88624 Change-Id: I34fa27ae7fb38cc7c3a1e8eb2fdae2a5775584c2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 23100ee61e33680d20f934dcbc96b57e8da29bf9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add unit test for QString::replace with out-of-bounds positionAndreas Buhr2020-11-191-0/+10
| | | | | | | | | | | QString::replace(pos, len, *unicode, size) can handle positions which are outside of the this-string. In that case, it is a no-op. Coverage analysis revealed we do not have a unit test for this. This patch adds one. Change-Id: Id4a407e860fff0d5c7c0a200c379e5e3961c86d2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix logic error in QString::replace(ch, after, cs)Andreas Buhr2020-11-191-0/+11
| | | | | | | | | | Coverage analysis showed that an if-branch marked "Q_LIKELY" was never taken. It turns out the code was incorrect, but behaved correctly. This patch fixes the logic and adds a unit test. Pick-to: 5.15 Change-Id: I9b4ba76392b52f07b8e21188496e23f98dba95a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QMetaTypeInterface constexpr on WindowsLars Knoll2020-11-191-12/+23
| | | | | | | | | | | | | | | | This was so far problematic as it gave various link errors. The solution to that seems to be to make the default constructor of QPairVariantInterfaceImpl constexpr to get around one set of problems. The other problem to solve where undefined references to metaobjects. The reason for that is apparently that QMetaTypeInterface contains a direct pointer to the meta object, something the linker doesn't like. Adding a level of indirection by using a function that returns the pointer seems to solve that problem. Fixes: QTBUG-88468 Change-Id: I5612ae807ea3b7e49bc40349d8d1fca1be9bd7ee Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change QString formatting of negative numbers in non-base-10Andreas Buhr2020-11-191-0/+64
| | | | | | | | | | | | | | | | | | | For bases other than 10, negative numbers have been converted to QString by casting them to an unsigned number and converting that. Thus QString::number(-17, 16) returned "0xffffffffffffffef", for example. This patch changes the behavior so that negative numbers are converted like positive numbers. Additinally, this patch adds unit tests for QString::number. [ChangeLog][Important Behavior Changes] Changed QString::number(integer, base) for negative numbers and bases other than 10 to return the string corresponding to the absolute value, prefixed by "-". Fixes: QTBUG-53706 Change-Id: I0ad3ca3f035d553860b262f5bec17dc81714d8ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QSFPM not emitting dataChanged when source model is setWang ChunLin2020-11-182-0/+30
| | | | | | | | | | | | | | QSortFilterProxyModel did not emit dataChanged when calling setSourceModel() after modifying the source model. QSortFilterProxyModel::setSourceModel and QSortFilterProxyModelPrivate::_q_sourceReset(), _q_clearMapping is called to delete the source_index_mapping. They also need to call create_mapping function to re-create it. Fixes: QTBUG-87781 Pick-to: 5.15 Change-Id: Idbe34696c9d3a2fbf354b653c870bac61378811d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of Q_COMPILER_CONSTEXPR checksAllan Sandfeld Jensen2020-11-177-36/+0
| | | | | | | Is required now. Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Network self-test: make it work with docker/containersTimur Pocheptsov2020-11-174-78/+181
| | | | | | | Fixes: QTBUG-87740 Pick-to: 5.15 Change-Id: Idfe73708784774188afd40048f81406aa720a554 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Test QTimer's isSingleShot() and timerType()Edward Welbourne2020-11-171-1/+7
| | | | | | | | | | Previously neglected in testing. Task-number: QTBUG-88183 Change-Id: Iacfca6f8c590af6dccb126cf3e43387ed50dbf06 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add some tests for various qmath.h functionsEdward Welbourne2020-11-171-0/+68
| | | | | | | | | | Previously untested. Task-number: QTBUG-88183 Change-Id: I9e94308471651e447f35a21329e43a363fb23961 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve qFloatDistance() test coverageEdward Welbourne2020-11-171-0/+1
| | | | | | | | | | | | Four code-paths that weren't tested are simply those with the parameters swapped from code-paths we did test. In any case, the float-distance between values should be symmetric, so test that. Task-number: QTBUG-88183 Change-Id: I2060eb77b1abada5b0fd5f4557dbb1761c5cfd02 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTest: don't wait before sending mouse event: increment the timestampShawn Rutledge2020-11-171-2/+4
| | | | | | | | | | Tests can run faster now, but we still expect calculations based on the timestamp (such as QEventPoint::velocity()) to be correct. Change-Id: Ie962604c9ebd139384dcd89a157de66b4b773cc9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Track progress range in QFutureInterface::setProgressValueIvan Solovev2020-11-172-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously QFutureInterface::setProgressValue was silently ignoring the progress range and allowed to set any progress value. Also no checks were performed in QFutureInterface::setProgressRange, which allowed the user to set minimum > maximum. Add checking of the current progress range, when settings the progress value. Add checks for minimum and maximum values while setting the progress range. The implementation of the checks is mostly based on the logic that is used in QProgressBar. - If maximum is smaller than minimum, minimum becomes the only legal value. - If the current progress value falls outside the new range, the progress value is set to be minimum. - If both progressMinimum() and progressMaximum() return 0, the current progress range is considered to be unused, and any progress value can be set. - When setting the value using setProgressValue(), if the value falls out of the progress range, the method has no effect. Task-number: QTBUG-84729 Change-Id: I29cf4f94b8e98e1af30dd46fbdba39c421cf66bf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Extend tests for QLoggingIvan Solovev2020-11-174-0/+384
| | | | | | | | | | Add tests for QMessageLogger class to explicitly cover all overloads of logging methods. Task-number: QTBUG-88183 Change-Id: I8d551f4b066cc285101646230bd9a17869ada3c1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Android: Ensure windows always have a geometry on creationPiotr Mikolajczyk2020-11-171-9/+0
| | | | | | | | | | | | | | | A QWindow created without an explicit geometry needs to pick up a default geometry in the platform plugin. If the window has a maximized of fullscreen window state, it will fill the entire available geometry of the parent window (or the screen if there's not parent window). Fixes: QTBUG-69159 Fixes: QTBUG-69156 Fixes: QTBUG-69154 Pick-to: 5.15 Change-Id: If8565d92a97bb4b3fa44757e68969d54d0bc7ebe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move the iterator from QTypedArrayData to QListLars Knoll2020-11-171-2/+2
| | | | | | | | | | The low level implementation does not use it at all, so there's no point having the iterator in QTypedArrayData. Having it in QList removes and indirection and will lead to clearer error messages. Change-Id: I4af270c3cdb39620e5e52e835eb8fe1aa659e038 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Clean up QList(iterator, iterator)Lars Knoll2020-11-171-1/+1
| | | | | | | | | | Fold the two overloads into one, and distinguish the cases using if constexpr. Do not overload QArrayOps::copyAppend(), to make it clear which one is being used. Change-Id: If6a894841aacb84ba190fb2209246f5f61034b42 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix signature of QArrayDataOps::erase()Lars Knoll2020-11-172-2/+2
| | | | | | | | | | | | Bring it in line with the other methods that also take a pointer and a size. Also use truncate() in removeAll() as that's more efficient for the use case. Change-Id: Ib1073b7c048ceb96fb6391b308ef8feb77896866 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the special code for emplaceFront/Back againLars Knoll2020-11-171-3/+4
| | | | | | | | | emplace() itself now handles those cases fast enough, so there should not be a need to add special code paths for those methods. Change-Id: I3277eb77dd54194e46f96f24de44d7785a6f860a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up emplace implementationsLars Knoll2020-11-171-154/+0
| | | | | | | | | | | Avoid duplicated code paths for GrowsForward vs GrowsBackward. Special case emplaceing at the beginning or end of the awrray where we can avoid creating a temporary copy. Change-Id: I2218ffd8d38cfa22e8faca75ebeadb79a682d3cf Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Simplify QArrayDataOps::insert() for movable typesLars Knoll2020-11-171-157/+0
| | | | | | | | | Avoid ever having to call a destructor and unify the code for insertion at the front or at the end. Change-Id: Ie50ae2d4a75477cfdae9d5bd4bddf268426d95b5 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>