summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-12-11 14:37:11 -0800
committerThiago Macieira <thiago.macieira@intel.com>2014-12-20 07:36:42 +0100
commit7b6ab50c68e771ecbd350b58890fae0e58330e9f (patch)
tree37fe8ff6332892aa3edd8213b15afcc6dd0dc170 /tests
parent9434162eda4d0ffe5f5f8571ff7330a71df0d0e2 (diff)
Remove the hardcoding of Unix socket paths for QtDBus
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp4
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp4
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp15
-rw-r--r--tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp4
4 files changed, 12 insertions, 15 deletions
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
index b4c16c6fa3..b0b9889e70 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
@@ -50,8 +50,8 @@ class MyServer : public QDBusServer
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qmyserver")
public:
- MyServer(QString addr = "unix:tmpdir=/tmp", QObject* parent = 0)
- : QDBusServer(addr, parent),
+ MyServer(QObject* parent = 0)
+ : QDBusServer(parent),
m_conn("none"),
obj(NULL)
{
diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
index 6be61ec9e0..7466526c99 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
@@ -43,8 +43,8 @@ class PingerServer : public QDBusServer
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qpinger")
public:
- PingerServer(QString addr = "unix:tmpdir=/tmp", QObject* parent = 0)
- : QDBusServer(addr, parent),
+ PingerServer(QObject* parent = 0)
+ : QDBusServer(parent),
m_conn("none")
{
connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
index c8d1184226..7e6e742e28 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
@@ -296,7 +296,7 @@ void tst_QDBusConnection::connectToPeer()
QVERIFY(con.lastError().isValid());
}
- QDBusServer server("unix:tmpdir=/tmp", 0);
+ QDBusServer server;
{
QDBusConnection con = QDBusConnection::connectToPeer(
@@ -381,9 +381,7 @@ class MyServer : public QDBusServer
{
Q_OBJECT
public:
- MyServer(QString path, QString addr, QObject* parent) : QDBusServer(addr, parent),
- m_path(path),
- m_connections()
+ MyServer(QString path) : m_path(path), m_connections()
{
connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
}
@@ -446,7 +444,7 @@ void tst_QDBusConnection::registerObjectPeer()
{
QFETCH(QString, path);
- MyServer server(path, "unix:tmpdir=/tmp", 0);
+ MyServer server(path);
QDBusConnection::connectToPeer(server.address(), "beforeFoo");
@@ -594,8 +592,7 @@ class MyServer2 : public QDBusServer
{
Q_OBJECT
public:
- MyServer2(QString addr, QObject* parent) : QDBusServer(addr, parent),
- m_conn("none")
+ MyServer2() : m_conn("none")
{
connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
}
@@ -620,7 +617,7 @@ private:
void tst_QDBusConnection::registerObjectPeer2()
{
- MyServer2 server("unix:tmpdir=/tmp", 0);
+ MyServer2 server;
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
QCoreApplication::processEvents();
QVERIFY(con.isConnected());
@@ -775,7 +772,7 @@ void tst_QDBusConnection::registerQObjectChildren()
void tst_QDBusConnection::registerQObjectChildrenPeer()
{
- MyServer2 server("unix:tmpdir=/tmp", 0);
+ MyServer2 server;
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
QCoreApplication::processEvents();
QVERIFY(con.isConnected());
diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
index df131f13f6..cb7296e7d2 100644
--- a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
@@ -48,8 +48,8 @@ class MyServer : public QDBusServer
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qmyserver")
public:
- MyServer(QString addr = "unix:tmpdir=/tmp", QObject* parent = 0)
- : QDBusServer(addr, parent),
+ MyServer(QObject* parent = 0)
+ : QDBusServer(parent),
m_conn("none")
{
connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));