diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-07-14 16:20:12 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-07-14 16:20:12 +0000 |
commit | a929c9a3b465db8b7e17b9b39936c612c2621a7c (patch) | |
tree | d1764257d1bd56f8e6a044516ccfc9bc44f7f9f5 /test/qt/tst_hal.cpp | |
parent | 5efe8e7f1d97931710558495a951e0b35afbfb72 (diff) |
* Remove all bindings
Diffstat (limited to 'test/qt/tst_hal.cpp')
-rw-r--r-- | test/qt/tst_hal.cpp | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/test/qt/tst_hal.cpp b/test/qt/tst_hal.cpp deleted file mode 100644 index a69daf2f..00000000 --- a/test/qt/tst_hal.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include <qcoreapplication.h> -#include <qdebug.h> - -#include <QtTest/QtTest> -#include <dbus/qdbus.h> - -class tst_Hal: public QObject -{ - Q_OBJECT - -private slots: - void getDevices(); - void lock(); -}; - -class Spy: public QObject -{ - Q_OBJECT -public: - int count; - QDBusConnection &conn; - - Spy(QDBusConnection &c) : count(0), conn(c) - { } - -public slots: - void spySlot(int, const QVariantList&) - { - ++count; - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/acpi_CPU0", - "org.freedesktop.Hal.Device", "GetProperty"); - msg << "info.locked"; - - QDBusMessage reply = conn.sendWithReply(msg); - QVERIFY(!reply.isEmpty()); - } -}; - - -void tst_Hal::getDevices() -{ - QDBusConnection &con = QDBus::systemBus(); - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.Hal", - "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal.Manager", - "GetAllDevices"); - - QDBusMessage reply = con.sendWithReply(msg); - QVERIFY(!reply.isEmpty()); - QVERIFY(reply.type() == QDBusMessage::ReplyMessage); - //qDebug() << reply; -} - -void tst_Hal::lock() -{ - QDBusConnection &con = QDBus::systemBus(); - QVERIFY(con.isConnected()); - - Spy spy( con ); - - con.connect("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/acpi_CPU0", - "org.freedesktop.Hal.Device", "PropertyModified", - &spy, SLOT(spySlot(int, QVariantList))); - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/acpi_CPU0", "org.freedesktop.Hal.Device", - "Lock"); - msg << "No reason..."; - - QDBusMessage reply = con.sendWithReply(msg); - //QTest::qWait(200); - //qDebug() << reply; - QCOMPARE(spy.count, 3); - QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); -} - -QTEST_MAIN(tst_Hal) - -#include "tst_hal.moc" |