From d1abf3e3e7108071fec2075301310ac2c19c878d Mon Sep 17 00:00:00 2001 From: Andrew Stanley-Jones Date: Tue, 21 Feb 2012 08:11:49 +0100 Subject: Fix the qlocalsocket test This test is broken in a couple of ways. A few one line fixes combined into a single patch. 1. Linux is the only OS that does abstract unix domain sockets by prepending a null as the first character. Don't test this on non-Linux platforms and expect it to pass. 2. Change QVERIFY2 to QCOMPARE so we can see why this fails in CI but no on the local system. Use QCOMPARE where possible. Change-Id: Ic3d2cf9696730dc4d6589539fdfe8a48ccf28de5 Reviewed-by: Alex --- tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 72fa9f74a4..70da67455e 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -1129,7 +1129,7 @@ void tst_QLocalSocket::verifyListenWithDescriptor() } else if (abstract) { QVERIFY2(server.fullServerName().at(0) == QLatin1Char('@'), "abstract sockets should start with a '@'"); } else { - QVERIFY2(server.fullServerName() == path, "full server path doesn't match patch provided"); + QCOMPARE(server.fullServerName(), path); if (path.contains(QLatin1String("/"))) { QVERIFY2(server.serverName() == path.mid(path.lastIndexOf(QLatin1Char('/'))+1), "server name invalid short name"); } else { @@ -1153,8 +1153,10 @@ void tst_QLocalSocket::verifyListenWithDescriptor_data() QTest::addColumn("bound"); QTest::newRow("normal") << QDir::tempPath() + QLatin1Literal("/testsocket") << false << true; +#ifdef Q_OS_LINUX QTest::newRow("absrtact") << QString::fromLatin1("abstractsocketname") << true << true; QTest::newRow("abstractwithslash") << QString::fromLatin1("abstractsocketwitha/inthename") << true << true; +#endif QTest::newRow("no path") << QString::fromLatin1("/invalid/no path name speficied") << true << false; #endif -- cgit v1.2.3