summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus
Commit message (Collapse)AuthorAgeFilesLines
* tests: Remove unused SRCDIR definesIevgenii Meshcheriakov2021-08-173-4/+0
| | | | | | | | | | | Remove SRCDIR defines from tests that don't use them. There is a standard define called QT_TESTCASE_SOURCEDIR that is available to all tests and serves the same purpose. Pick-to: 6.2 Change-Id: I2aa237739c011495e31641cca525dc0eeef3c870 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
* Port of QDBusServiceWatcher::watchMode to new property systemAndreas Buhr2021-04-191-0/+41
| | | | | | | | | | | Port watchMode in QDBusServiceWatcher to the new property system. This is the easiest part. Task-number: QTBUG-85520 Change-Id: I588212af205e77765862b8fecdbdcbf871717142 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* dbus: Fix missing QVersionNumber includeKevin Funk2021-01-251-0/+1
| | | | | | | | Fixes the build Change-Id: Ie0b7a1476bb1f80ee2ccfe1cbc6ca37e9c93e758 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove .prev_CMakeLists.txt filesJoerg Bornemann2021-01-128-101/+0
| | | | | | | | | | Those serve no purpose anymore, now that the .pro files are gone. Task-number: QTBUG-88742 Change-Id: I39943327b8c9871785b58e9973e4e7602371793e Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove QtDBus includesDavid Skoland2021-01-1227-93/+163
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Pick-to: 6.0 Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-0730-219/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-2220-20/+33
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QChar: make construction from integral explicitGiuseppe D'Angelo2020-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QChar should not be convertible from any integral type except from char16_t, short and possibly char (since it's a direct superset). David provided the perfect example: if (str == 123) { ~~~ } compiles, with 123 implicitly converted to QChar (str == "123" was meant instead). But similarly one can construct other scenarios where QString(123) gets accidentally used (instead of QString::number(123)), like QString s; s += 123;. Add a macro to revert to the implicit constructors, for backwards compatibility. The breaks are mostly in tests that "abuse" of integers (arithmetic, etc.). Maybe it's time for user-defined literals for QChar/QString, but that is left for another commit. [ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar constructors from integral types are now by default explicit. It is recommended to use explicit conversions, QLatin1Char, QChar::fromUcs4 instead of implicit conversions. The old behavior can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION macro. Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Adjust tst_qdbusmarshall to QVariant changesFabian Kosmale2020-10-301-24/+58
| | | | | | | | | | | | Comparing QVariant's containing QDBusArguments does not work anymore in Qt 6, where QVariant will simply use QMetaType equals. Thus we now do the comparisons in a more manual way. This is currently only partially implemented. Additionally, adjust to changed warning message. Fixes: QTBUG-87998 Change-Id: Ie63db4e8c8d03d7627234f3c892067d1557454af Reviewed-by: Liang Qi <liang.qi@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-237-94/+91
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-074-7/+7
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QMetaType instead of integer based type idsLars Knoll2020-09-232-3/+3
| | | | | | | | | Change the implementation of Qt DBus to use QMetaType directly instead of integer based type ids. Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup DBus type registration codeLars Knoll2020-09-231-3/+3
| | | | | | | | Modernize the code base, use QMetaType and avoid reinterpret_casts. Change-Id: I0bad2ee393a0f850cf40b248cb9439b06ed9f663 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-2330-39/+39
| | | | | | | | | | | 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>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-115-7/+9
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-241-2/+2
| | | | | | | | | | | | | 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>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-061-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix passing QDBusUnixFileDescriptors over peer-to-peer connectionsSteffen Kieß2020-07-131-2/+3
| | | | | | | | | | | | | | | | | | | Passing QDBusUnixFileDescriptors over peer-to-peer connections currently does not work, because QDBusConnectionPrivate::setPeer() does not set this->capabilities (unlike QDBusConnectionPrivate::setConnection() which is executed for bus connections). Keep track of whether the connection already has been authenticated, and once the connection does get authenticated, update this->capabilities. Note that sending a message directly after connecting (before any message has been received from the peer) might still fail if the message contains a QDBusUnixFileDescriptor. Pick-to: 5.15 Fixes: QTBUG-85396 Change-Id: Ib83213ebcd3255fb091c6faefb3618745b8d736c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate subdir test projectsAlexandru Croitor2020-07-097-4/+22
| | | | | | | | And generate a few more test projects that were missing. Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-0928-35/+35
| | | | | | | | 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>
* Use QList instead of QVector in dbus testsJarek Kobus2020-06-253-6/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: I37d169770f188837118b4e33aa3a3894bf7aed2c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move implementation of QVector/List back to qlist.hLars Knoll2020-06-201-1/+1
| | | | | | | | | | | | | And name the main class QList. That's also the one we document. This gives less porting pain for our users, and a lot less churn in our API, as we use QList in Qt 5 in 95% of our API. In addition, it gives more consistent naming with QStringList and QByteArrayList and disambiguates QList vs QVector(2|3|4)D. Fixes: QTBUG-84468 Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of the obsolete isEditable flag for propertiesLars Knoll2020-06-111-1/+0
| | | | | | Change-Id: I54411bd8e223671523c9c8fad5c80bfa6b5b7097 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix autotests after the QHash changesLars Knoll2020-04-091-13/+13
| | | | | | | | | | | | | Some test cases are sensitive to the exact ordering inside QHash, and need adjustments when we change QHash or the hashing functions. Some rcc tests now also need 32bit specific data, as the hashing functions for 32 and 64 bit are different now (as we use size_t). Change-Id: Ieab01cd55b1288336493b13c41d27e42a008bdd9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* New QMetaType representationOlivier Goffart2020-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | the QMetaType is represented as a pointer to a "vtable" in the form of a QtPrivate::QMetaTypeInterface* The recomanded use of QMetaType is to construct an object with QMetaType::fromType. This does not require any registration. There is still an id() function which will do some registration for compatibility with Qt5. Also the patch does not really touch the other extra things that can be registered (data stream operator, comparison operator, iteratable, ...) and this still uses the previous system. This is only the change in QMetaType, other changes to use it in QVariant and QMetaObject will follow Change-Id: Iffad20085cf33f33447f58a68236013a8b60fdbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-125-15/+5
| | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Post Merge FixesLeander Beernaert2020-01-242-2/+0
| | | | | Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-4/+4
|\ | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-251-4/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
| | * Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Regenerate TestsLeander Beernaert2020-01-166-9/+25
| | | | | | | | | | | | | | | | | | Change-Id: I78f1efbec809610bcf6a8224392fa0dc8dbf3b3b Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* | | Fix tst_qdbusmarshallLeander Beernaert2020-01-101-1/+1
| | | | | | | | | | | | | | | Change-Id: Ia7bb50a8c69a0083d0b8acdad0cb8eb6a71ca24e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix qmake buildsAlexandru Croitor2019-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We did some changes in the .cpp files of some tests when converting the build system to CMake, but didn't adjust the .pro files which caused tests to fail when doing a qmake build. Make the required changes. Was discovered when doing a test wip/cmake -> dev merge. Change-Id: I407a982412cb44df592a38a4cb997968bdfe3304 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Post merge fixesLeander Beernaert2019-11-252-0/+12
| | | | | | | | | | | | | | | Change-Id: I78d3c9687f99c0a32da04257e297e88ef0b02581 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-192-5/+8
|\| | | | | | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * | Make QList an alias to QVectorLars Knoll2019-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is almost 100% source compatible with Qt 5. Exceptions are * Stability of references for large or non movable types * taking a PMF for types that are now overloaded with r-value references in QVector * The missing prepend optimization in QVector (that is still planned to come for Qt 6) Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | test: migrate QDBusInterface test to QRegularExpressionSamuel Gaist2019-10-211-4/+7
| |/ | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. Task-number: QTBUG-72587 Change-Id: I47a047e27432c874b47bd25581806e1bc156e94f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Regenerate tests/auto/dbusAlexandru Croitor2019-11-1326-51/+120
| | | | | | | | | | Change-Id: I105eb73065e02a4fa508d17f481047b32875f128 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate tests that use helper processesAlexandru Croitor2019-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | This is needed to make sure the output directory is in the correct place somewhere under tests, rather than in $prefix/bin. Change-Id: I98afa9c0a7517a8a10866b4c626bd4c4d2fd214f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot
* | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-152-0/+0
|\| | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * unblacklist passing testsDaniel Smith2019-07-082-0/+0
| | | | | | | | | | | | | | | | These tests have not failed on the removed platforms for at least 60 days Task-number: QTBUG-76608 Change-Id: If7a9f4db907124e3cd54e3f4b0ad3e20717d1912 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Regenerate some of the test projects that do SUBDIRS += fooAlexandru Croitor2019-08-071-7/+4
| | | | | | | | | | | | | | | | | | This show cases the new cleaner subdirs handling code in pro2cmake. Change-Id: I25001942ef020e4c4191b355f55309c4fb033ecc Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix qdbusmarshall testLeander Beernaert2019-07-171-3/+12
| | | | | | | | | | | | | | | | Fix target name for qdbushmarshall and fix missing include paths and unresolved symbols. Change-Id: I770e190e33d1de9b9d95ee92e63d868e2337c322 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-2/+2
|\| | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | cmake: Fix tests that need helper binariesAlbert Astals Cid2019-06-043-0/+6
| | | | | | | | | | | | | | Compile the binaries where they are expected not in builddir/bin Change-Id: I5c9461424a4b3f9fb7f39f5b9d3cd9b96887cfbc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Don't link against dbus-1_nolink when dbus_linked feature is offAlexandru Croitor2019-05-082-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbus1_linked is only evaluated to true when the dbus package is found. If it was not found, then it makes no sense to link against the _nolink target, because no package was found in the first place. When the package is not found, QtDBus uses a minimal dbus header which is included with QtDBus sources, so there is no need for the _nolink target. This amends cc141cc5c61d086d6938e2c7312ec02e5f79734c and fixes a build failure on macOS. Change-Id: I71dcbb7465ad13b0bf03579f51412c373125caba Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-163-42/+102
|\| | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-192-5/+2
| |\ | | | | | | | | | Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0