summaryrefslogtreecommitdiffstats
path: root/test/qt/qpong.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago@kde.org>2006-03-06 14:30:52 +0000
committerThiago Macieira <thiago@kde.org>2006-03-06 14:30:52 +0000
commit12dc0934ae2a1fb92223f84804ad31a57689813c (patch)
treef2f8d4ecc8493c109ff4834b2bcad91d3372aed8 /test/qt/qpong.cpp
parent9393d6b459d02a8508750a846bf97a69e48c97e2 (diff)
2006-03-06 Thiago Macieira <thiago.macieira@trolltech.com>
* test/qt/*: Update the self-tests.
Diffstat (limited to 'test/qt/qpong.cpp')
-rw-r--r--test/qt/qpong.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/qt/qpong.cpp b/test/qt/qpong.cpp
new file mode 100644
index 00000000..38e5c78d
--- /dev/null
+++ b/test/qt/qpong.cpp
@@ -0,0 +1,35 @@
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <QtCore/QtCore>
+#include <dbus/qdbus.h>
+
+class Pong: public QObject
+{
+ Q_OBJECT
+public slots:
+
+ void ping(const QDBusMessage &msg)
+ {
+ QDBusMessage reply = QDBusMessage::methodReply(msg);
+ reply << static_cast<QList<QVariant> >(msg);
+ if (!msg.connection().send(reply))
+ exit(1);
+ }
+};
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+
+ QDBusConnection &con = QDBus::sessionBus();
+ if (!con.requestName("org.kde.selftest"))
+ exit(2);
+
+ Pong pong;
+ con.registerObject("/org/kde/selftest", &pong, QDBusConnection::ExportSlots);
+
+ printf("ready.\n");
+
+ return app.exec();
+}
+
+#include "qpong.moc"