summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusabstractinterface
Commit message (Collapse)AuthorAgeFilesLines
* Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-012-2/+0
| | | | | Change-Id: I1955320e7639760b4383a53f37a506c8055933ef Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* tests/auto/dbus: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-08-191-18/+18
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I363776ef664c97bca0071d57cf78a8fe935bce8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Autotest: rename sub tests from "test" to something meaningfulThiago Macieira2015-07-182-1/+1
| | | | | | | | | Otherwise, if I open tests/auto/dbus/dbus.pro in Qt Creator, it shows me "test", "test2", "test3", "test4" and it's very hard to know which test is which. Change-Id: Iee8cbc07c4434ce9b560ffff13d0654696c025b7 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Tests: remove insignificant flag for dbus tests on osxCaroline Chao2015-03-271-2/+0
| | | | | | | | | Tests are now passing in CI. Change-Id: I0051fb7070c1c1027c557eba9dde6367ad59ac7a Task-number: QTQAINFRA-837 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-114-28/+28
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Autotest: fix a race condition in verifying a peer D-Bus connectedThiago Macieira2015-01-062-5/+17
| | | | | | | | | | | | | | | On the unit test side, everything is sequential: we first ask for the connection, verify that it is connected, then ask the remote side via the session bus if it is connected. Unfortunately, the remote site may handle things in a different order: it may handle the incoming function call to "isConnected" before doing accept(2) on the listening socket. So, instead, make the local side block until the connection is received on the other side. On the remote, we don't block, instead we use the feature of delayed replies. Change-Id: Ie386938b8b39dd94a9d7e5913668125fb4a3c7da Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Autotest: Forward stderr of the sub-processesThiago Macieira2015-01-021-0/+1
| | | | | | | So we can get the output when running with QDBUS_DEBUG=1. Change-Id: I6a6b8e0d82727c522914fb90a7ce594c86307d8f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Autotest: Be nicer when asking the sub-processes to exitThiago Macieira2015-01-022-13/+9
| | | | | | | | | | Instead of killing them outright (and note that terminate() doesn't work on Windows), ask them nicely to exit on their own. This way, if we run them in valgrind, valgrind gets a chance to print the leak check output and summary. Change-Id: Ib6cc8d4560ff0bf255f94980eb220e97592c00f0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Autotest: Fix a race condition in launching the QtDBus sub-processesThiago Macieira2014-12-202-0/+2
| | | | | | | | | | | | Wait for the subprocess to print "ready" before assuming that it is ready to receive calls. waitForStarted() will return as soon as the child is running, but it may not have registered on D-Bus yet. This also solves the synchronization problem more elegantly than how tst_qdbusmarshall.cpp was trying to do it. Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix handling of subprocesses for QtDBus unit tests on WindowsThiago Macieira2014-12-203-6/+13
| | | | | | | | | The executables are not in the same dir as on Unix, so we need to use QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from placing the executables in a "debug/" subdir. Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't kill the subprocess in tst_qdbusabstractinterfaceThiago Macieira2014-12-201-17/+25
| | | | | | | | | | | Rohan was right in e88f9a92b7ab05ea9bc25083de7dee1b67dd673e to stabilize the test and reset the state, but killing the subprocess is overkill. All we need is to reset the state in both applications, which includes disconnecting and reconnecting to the peer, to discard any sent but not yet received messages. Change-Id: Ie01392e6e63bd70ef8345217d3fc641ed63c7aba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Autotest: Make the peer executables report error if they failedThiago Macieira2014-12-201-1/+3
| | | | | | | | | QDBusServer::address() will return an empty QString, which caused the tests to fail later with no apparent reason. Change-Id: I86f448dfc67a6cdb27ecda2d490f335766cfaf4f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the hardcoding of Unix socket paths for QtDBusThiago Macieira2014-12-201-2/+2
| | | | | | | | | | | | | | | | | | | This allows the tests to be run on Windows too by using TCP socket connections instead of requiring Unix sockets. The tests shouldn't have hardcoded the path, which came from QDBusServer anyway. Now the tests simply defer to QDBusServer. This is a slight behavior change for Windows, but not one that should matter since anyone who was using the default constructor resulted in a QDBusServer that failed to listen. [ChangeLog][QtDBus][QDBusServer] Fixed a bug that made QDBusServer's default constructor try to bind to a Unix socket on non-Unix systems. Now QDBusServer will attempt to bind to a TCP socket instead. Change-Id: I2a126019671c2d90257e739ed3aff7938d1fe946 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-244-76/+44
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Autotest: make sure the helper programs in QtDBus aren't bundlesThiago Macieira2014-05-091-0/+2
| | | | | | | The main test won't find them if they are. Change-Id: Iae3ffe4c0289a0c88d46c1bd2e414c20def89ab4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* tests: Mark tst_qdbus* tests as insignificant on OS XSergio Ahumada2014-03-131-0/+2
| | | | | | | | | D-Bus libraries were recently added to OS X 10.7 making these tests to be executed for first time. Task-number: QTBUG-37469 Change-Id: Ia7a74a45b18d4a645307f7fb7666236c5e009e5f Reviewed-by: Simo Fält <simo.falt@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-271-2/+1
|\ | | | | | | | | | | | | Conflicts: examples/widgets/doc/src/addressbook-fr.qdoc Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
| * tests: Make the QT assignments more explicitSergio Ahumada2013-08-211-2/+1
| | | | | | | | | | | | | | | | Remove unused 'QT -= gui' and replace some others with 'QT = core ...' Change-Id: I2d14fae963afc21dbd21a4acdbba2c30cdf8fa61 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-2/+24
|\| | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| * Fix QDBusAbstractInterface::isValid() for peer connectionsAlberto Mardegan2013-07-161-2/+24
| | | | | | | | | | | | | | | | | | | | | | Do not attempt to lookup the service owner on peer connections (it will fail). Make QDBusAbstractInterface::isValid() return a sensible result on peer connections, instead of always returning false. Task-number: QTBUG-32374 Change-Id: I1b02feaffb3b255188f8d63306f89f5034a32f22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Let qdbusxml2cpp generate code that compiles: no '-' in variable names.David Faure2013-07-011-1/+1
| | | | | | | | | | | | | | | | org.freedesktop.Application.xml has <arg type='a{sv}' name='platform-data' direction='in'/> Change-Id: I035436d48ec45da3ccad7dabe01e9cccec17b730 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDBus: Add test for a{sv} and an annotation pointing to QVariantHash.David Faure2013-05-103-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | QVariantMap would work too; I presume this is why the annotation is needed, rather than QtDBus automatically figuring out which type to use. This even checks that QHash&lt;QString,QVariant&gt; works in the annotation, although QVariantHash would be simpler to write, obviously. Change-Id: I7a339ca90f10e5ec97dcea1bb4dbba3c515e6b23 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* | tst_qdbusabstractinterface: generate interface at compile timeDavid Faure2013-05-094-229/+8
|/ | | | | | | | in order to test for regressions in qdbusxml2cpp too. Change-Id: Icd2a6f319c5fabf0b0f2a1fe8c70afcd2c84263e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Fix wildcard signal disconnection in QDBusAbstractInterfaceThiago Macieira2013-03-191-2/+4
| | | | | | | | | | | | | | This has been broken forever, just like generic signal disconnection. It didn't use to show up before because in Qt 4, QObject's destructor would not call disconnectNotify(). Just like in the previous commit, we need to verify whether the signal was disconnected from the last receiver. A wildcard disconnect might be disconnecting only from a specific receiver. Task-number: QTBUG-29498 Change-Id: I0790128ea878fdf3ac563c99d96c6aa7d270e9a3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Make sure that signal disconnects don't disconnect too muchThiago Macieira2013-03-191-0/+90
| | | | | | | | | | | | | | | There has been a latent bug forever in QtDBus that would make a signal disconnect actually disconnect too much. The reason is that disconnectNotify() is called every time a signal is disconnected from a receiver, but that doesn't mean it was the last connection. This test checks whether disconnecting from voidSignal() to our test receiver will also disconnect from exitLoop(). If it does, we'll get a timeout. I could have implemented it with two receivers, but in the buggy case, it would always fail first in the timeout verification. Change-Id: I5766d8a38594eb25e65b304913251303660fad41 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Remove bogus portion of unit testThiago Macieira2013-03-151-12/+0
| | | | | | | | | | | | | | In Qt 4, QSignalSpy didn't *really* connect to the signal it was spying on. See the "we need to connect the signal somewhere in order for D-Bus to enable the rules" comments. In Qt 5, it connects, which rendered this section of the test bogus: since the signal is still connected, the QSignalSpy will notice that fact and will not be empty. This is passing due to a false positive. The upcoming fix breaks it, so we need to remove it. Change-Id: Ic8fbf7d0e941403e97149f5bc392334a52c66ab1 Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-186-8/+8
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* normalise signal/slot signatures [QtDBus tests]Marc Mutz2012-10-191-1/+1
| | | | | Change-Id: I4a0441d37e455dce28072ee3650b2062bec65759 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-226-147/+147
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-012-0/+2
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix unit confusion in ccf3b9e48b2d773999a9a88e249f79380618cde6David Faure2012-05-021-4/+10
| | | | | | | | | I wrote nonsense in that commit. The older methods that take a timeout all take milliseconds, and the comments in the unit test really meant milliseconds, not seconds. 1s is not shorter than 100ms.... Change-Id: Ic18899bb0462d89575dc5a9a311478adc4dea1cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-022-8/+8
| | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Finish cleaning up com.trolltech -> org.qtproject in QtDBusThiago Macieira2012-04-167-19/+19
| | | | | | | | | | | | | | Lots of uses of the annotations and error names, plus a bunch of local unit test names (including one file that had to be renamed). The meta object generator is updated to support both the old and new names. That means some references to com.trolltech *must* remain in the source code. Task-number: QTBUG-23274 Change-Id: Icc38ae040232f07c437e7546ee744a4703f41726 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
* Update the error codes in QtDBusThiago Macieira2012-04-161-7/+7
| | | | | | | | | | | Change the old com.trolltech ones to org.qtproject and introduce Use the alternate domain name for the Qt Project because the dash character is not valid in interface and error names. Task-number: QTBUG-23274 Change-Id: Iac1699e70525d67f983c10560932acff6b2ecde6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Stabilize tst_qdbusabstractinterface and make it XFAILRohan McGovern2012-02-201-40/+38
| | | | | | | | | | | | | | | This test was written incorrectly in a way which happened to allow it to pass most of the time (but not all the time). Reset the state of test objects between each test function, and mark the broken functions with QEXPECT_FAIL and a link to a task. Replace the unusual WaitForPinger construct with the usual QTRY_VERIFY/QTRY_COMPARE method of verifying asynchronous operations. Task-number: QTBUG-24262 Change-Id: I82d09002307c0b500bf60cd5b583674321b37609 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-306-6/+6
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-236-6/+6
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-056-8/+8
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* all remaining tests: eliminated usage of qttest_p4.prfRohan McGovern2011-10-252-3/+4
| | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Change-Id: I02fe27b2c1800f929250fa8694ca2976c9661a12 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Remove redundant logic from dbus test .pro files.Jason McDonald2011-10-111-8/+3
| | | | | | | | | | | | There was logic in .pro files for the dbus tests to omit the body of each test if dbus was not available in the Qt build. This was all redundant however, because tests/auto/auto.pro already excluded all dbus tests if dbus was not available in the Qt build. Change-Id: Iaea06e38622e5227daec4d2e08106c2da3fb4013 Reviewed-on: http://codereview.qt-project.org/6372 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* This passes just fineLars Knoll2011-09-201-1/+0
| | | | | | | | Task-number: QTBUG-21424 Change-Id: Ied95373b2cf3882ec4f352ccbc285b578c66f83d Reviewed-on: http://codereview.qt-project.org/5003 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Temporarily disabled testsHolger Ihrig2011-09-141-0/+1
| | | | | | | | | | | Necessary to avoid CI blocking. The tests should be enabled again as soon as possible. Task-number: QTBUG-21424 Change-Id: Ibc54723855579095be0dea3bd3e071dd22a1fccf Reviewed-on: http://codereview.qt-project.org/4825 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
* Moved dbus autotests into new directory structureJo Asplin2011-09-0110-0/+1890
Task-number: QTBUG-21108 Change-Id: I8cdd4af59db3716921e7392379584f349ed29136 Reviewed-on: http://codereview.qt.nokia.com/3602 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>