From 12dc0934ae2a1fb92223f84804ad31a57689813c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Mar 2006 14:30:52 +0000 Subject: 2006-03-06 Thiago Macieira * test/qt/*: Update the self-tests. --- test/qt/qpong.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/qt/qpong.cpp (limited to 'test/qt/qpong.cpp') 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 +#include + +class Pong: public QObject +{ + Q_OBJECT +public slots: + + void ping(const QDBusMessage &msg) + { + QDBusMessage reply = QDBusMessage::methodReply(msg); + reply << static_cast >(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" -- cgit