[SCM] qtwebsockets packaging branch, master, updated. debian/5.3.2-3-2-g22d16fd
Lisandro Damián Nicanor Pérez
lisandro at moszumanska.debian.org
Tue Sep 23 18:17:45 UTC 2014
Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtwebsockets.git;a=commitdiff;h=22d16fd
The following commit has been merged in the master branch:
commit 22d16fdecd44a2ff676819cfb0e7bb5707c5aa5e
Author: Lisandro Damián Nicanor Pérez Meyer <perezmeyer at gmail.com>
Date: Tue Sep 23 15:17:24 2014 -0300
Fix some tests to work on kfreebsd.
Thanks Adam Majer for the patch!
---
debian/changelog | 3 +
debian/patches/fix_kfreebsd_test.patch | 101 +++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 105 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 83f86c3..f255132 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
qtwebsockets-opensource-src (5.3.2-4) UNRELEASED; urgency=medium
+ [ Lisandro Damián Nicanor Pérez Meyer ]
+ * Fix some tests to work on kfreebsd. Thanks Adam Majer for the patch!
+
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Tue, 23 Sep 2014 15:10:29 -0300
qtwebsockets-opensource-src (5.3.2-3) unstable; urgency=medium
diff --git a/debian/patches/fix_kfreebsd_test.patch b/debian/patches/fix_kfreebsd_test.patch
new file mode 100644
index 0000000..937d122
--- /dev/null
+++ b/debian/patches/fix_kfreebsd_test.patch
@@ -0,0 +1,101 @@
+Description: fix some tests in kfreebsd.
+Author: Adam Majer <adamm at zombino.com>
+Bug-Qt: https://bugreports.qt-project.org/browse/QTBUG-41448
+
+---
+ tests/auto/qwebsocket/tst_qwebsocket.cpp | 31 ++++++++++++++++++++++++++++---
+ 1 file changed, 28 insertions(+), 3 deletions(-)
+
+--- a/tests/auto/qwebsocket/tst_qwebsocket.cpp
++++ b/tests/auto/qwebsocket/tst_qwebsocket.cpp
+@@ -246,6 +246,7 @@ void tst_QWebSocket::tst_invalidOpen_dat
+ QTest::addColumn<QString>("expectedUrl");
+ QTest::addColumn<QString>("expectedPeerName");
+ QTest::addColumn<QString>("expectedResourceName");
++ QTest::addColumn<QAbstractSocket::SocketError>("socketErrorAfterConnect");
+ QTest::addColumn<QAbstractSocket::SocketState>("stateAfterOpenCall");
+ QTest::addColumn<int>("disconnectedCount");
+ QTest::addColumn<int>("stateChangedCount");
+@@ -253,18 +254,28 @@ void tst_QWebSocket::tst_invalidOpen_dat
+ QTest::newRow("Illegal local address")
+ << QStringLiteral("ws://127.0.0.1:1/") << QStringLiteral("ws://127.0.0.1:1/")
+ << QStringLiteral("127.0.0.1")
+- << QStringLiteral("/") << QAbstractSocket::ConnectingState
++ << QStringLiteral("/")
++#ifdef Q_OS_FREEBSD_KERNEL
++ << QAbstractSocket::ConnectionRefusedError
++ << QAbstractSocket::UnconnectedState
++#else
++ << QAbstractSocket::UnknownSocketError
++ << QAbstractSocket::ConnectingState
++#endif
+ << 1
+ << 2; //going from connecting to disconnected
+ QTest::newRow("URL containing new line in the hostname")
+ << QStringLiteral("ws://myhacky
server/") << QString()
+ << QString()
+- << QString() << QAbstractSocket::UnconnectedState
++ << QString()
++ << QAbstractSocket::UnknownSocketError
++ << QAbstractSocket::UnconnectedState
+ << 0 << 0;
+ QTest::newRow("URL containing new line in the resource name")
+ << QStringLiteral("ws://127.0.0.1:1/tricky
path") << QString()
+ << QString()
+ << QString()
++ << QAbstractSocket::UnknownSocketError
+ << QAbstractSocket::UnconnectedState
+ << 0 << 0;
+ }
+@@ -275,6 +286,7 @@ void tst_QWebSocket::tst_invalidOpen()
+ QFETCH(QString, expectedUrl);
+ QFETCH(QString, expectedPeerName);
+ QFETCH(QString, expectedResourceName);
++ QFETCH(QAbstractSocket::SocketError, socketErrorAfterConnect);
+ QFETCH(QAbstractSocket::SocketState, stateAfterOpenCall);
+ QFETCH(int, disconnectedCount);
+ QFETCH(int, stateChangedCount);
+@@ -298,7 +310,8 @@ void tst_QWebSocket::tst_invalidOpen()
+ QCOMPARE(socket.version(), QWebSocketProtocol::VersionLatest);
+ //at this point the socket is in a connecting state
+ //so, there should no error at this point
+- QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
++ // but it depends on the platform
++ QCOMPARE(socket.error(), socketErrorAfterConnect);
+ QVERIFY(!socket.errorString().isEmpty());
+ QVERIFY(!socket.isValid());
+ QVERIFY(socket.localAddress().isNull());
+@@ -365,7 +378,13 @@ void tst_QWebSocket::tst_invalidOrigin()
+
+ //at this point the socket is in a connecting state
+ //so, there should no error at this point
++#ifdef Q_OS_FREEBSD_KERNEL
++ // except with FreeBSD, which seems too fast for tests
++ QCOMPARE(socket.error(), QAbstractSocket::ConnectionRefusedError);
++#else
+ QCOMPARE(socket.error(), QAbstractSocket::UnknownSocketError);
++#endif
++
+ QVERIFY(!socket.errorString().isEmpty());
+ QVERIFY(!socket.isValid());
+ QVERIFY(socket.localAddress().isNull());
+@@ -374,13 +393,19 @@ void tst_QWebSocket::tst_invalidOrigin()
+ QVERIFY(socket.peerAddress().isNull());
+ QCOMPARE(socket.peerPort(), quint16(0));
+ QCOMPARE(socket.peerName(), QStringLiteral("127.0.0.1"));
++#ifdef Q_OS_FREEBSD_KERNEL
++ QCOMPARE(socket.state(), QAbstractSocket::UnconnectedState);
++#else
+ QCOMPARE(socket.state(), QAbstractSocket::ConnectingState);
++#endif
+ QCOMPARE(socket.readBufferSize(), 0);
+ QCOMPARE(socket.resourceName(), QStringLiteral("/"));
+ QCOMPARE(socket.requestUrl(), QUrl(QStringLiteral("ws://127.0.0.1:1/")));
+ QCOMPARE(socket.closeCode(), QWebSocketProtocol::CloseCodeNormal);
+
++#ifndef Q_OS_FREEBSD_KERNEL
+ QVERIFY(errorSpy.wait());
++#endif
+
+ QCOMPARE(errorSpy.count(), 1);
+ QList<QVariant> arguments = errorSpy.takeFirst();
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7591b36
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix_kfreebsd_test.patch
--
qtwebsockets packaging
More information about the pkg-kde-commits
mailing list