diff options
author | Andrew Stanley-Jones <andrew.stanley-jones@nokia.com> | 2012-02-21 08:11:49 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-21 22:31:00 +0100 |
commit | d1abf3e3e7108071fec2075301310ac2c19c878d (patch) | |
tree | 50a71ad4be67c6b3ac63b79ebd4b3393cd34a0ac /tests | |
parent | 511e447b70999089b8212967616b1f2962d59e96 (diff) |
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 <alex.blasche@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<bool>("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 |