From 3a151faec2c15785eb1eb5fee7275cd038b92ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Mon, 21 Feb 2022 12:19:49 +0200 Subject: QNX: Fix support for abstract Unix-domain socket As QNX claims to support abstract Unix-domain sockets, its getsockname always returns for socket that has not been bound to local name address_len of sun_path as maximum length (106) even when it does not contain valid address. https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/u/unix_proto.html Pick-to: 6.2 6.3 Change-Id: I0f0f5c05611c8db6af35377dde16450f58c83c56 Reviewed-by: Thiago Macieira --- tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/network/socket') diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index ba699242fd..afefa0fd30 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -1765,7 +1765,7 @@ void tst_QLocalSocket::verifyListenWithDescriptor() QLocalServer server; QVERIFY2(server.listen(listenSocket), "failed to start create QLocalServer with local socket"); -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) || defined(Q_OS_QNX) if (!bound) { QCOMPARE(server.serverName().isEmpty(), true); QCOMPARE(server.fullServerName().isEmpty(), true); @@ -1806,7 +1806,7 @@ void tst_QLocalSocket::verifyListenWithDescriptor_data() QTest::addColumn("bound"); QTest::newRow("normal") << QDir::tempPath() + QLatin1String("/testsocket") << false << true; -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) || defined(Q_OS_QNX) QTest::newRow("abstract") << QString::fromLatin1("abstractsocketname") << true << true; QTest::newRow("abstractwithslash") << QString::fromLatin1("abstractsocketwitha/inthename") << true << true; #endif -- cgit v1.2.3