summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-08-30 10:59:05 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-08-30 11:52:13 +0000
commit0b706608fc93bbedbd525af4fb41f7e5cd6fb5d6 (patch)
tree430558cc189be3bd6bd440d09b8b13d290ef7d08
parent09b611acde6ebdbd029a52c2d587b922250b588f (diff)
downloadqt-creator-0b706608fc93bbedbd525af4fb41f7e5cd6fb5d6.tar.gz
QmlProfiler: Listen on QHostAddress::Any in QmlProfilerToolTest
The attach dialog retrieves the host address to connect to from the device's toolControlChannel(). All of the toolControlChannel() implementations currently specify "localhost" as host address. "localhost" means IPv6 on macOS and IPv4 everywhere else. Unfortunately there is no shortcut for listening on a dual-stack local address in QTcpServer and urlFromLocalHostAndFreePort() will try both v4 and v6, returning whatever works. There is a shortcut for listening on a dual-stack "any" address, though. As this is only the test, we can live with exposing a TCP server to the internet for a short time. Change-Id: I4114f03668e608f80353d21a59edf67db4b7f738 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp
index fdba15f03d..1779e966e1 100644
--- a/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp
+++ b/src/plugins/qmlprofiler/tests/qmlprofilertool_test.cpp
@@ -57,7 +57,7 @@ void QmlProfilerToolTest::testAttachToWaitingApplication()
QUrl serverUrl = Utils::urlFromLocalHostAndFreePort();
QVERIFY(serverUrl.port() >= 0);
QVERIFY(serverUrl.port() <= std::numeric_limits<quint16>::max());
- server.listen(QHostAddress(serverUrl.host()), static_cast<quint16>(serverUrl.port()));
+ server.listen(QHostAddress::Any, static_cast<quint16>(serverUrl.port()));
QScopedPointer<QTcpSocket> connection;
connect(&server, &QTcpServer::newConnection, this, [&]() {