summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtcpsocket
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-17 13:43:30 +1000
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-18 16:09:29 +1000
commit49babe02f0a00fe2baff3950fbdcb725ce20d772 (patch)
treee0383c879f78ef74ba7a0fe394504c096312edf4 /tests/auto/qtcpsocket
parent0cd93933d8e5cc69151958fc285936854ff86e47 (diff)
Remove autotest code for Qt3Support library.
This commit deals with the simple cases -- mostly just removing blocks of code enclosed in #ifdef QT3_SUPPORT. Later commits will deal with the trickier cases. Change-Id: I280dea25b3754be175efe62fc7e5e4e7c304e658 Task-number: QTBUG-19325 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qtcpsocket')
-rw-r--r--tests/auto/qtcpsocket/stressTest/Test.cpp94
-rw-r--r--tests/auto/qtcpsocket/stressTest/Test.h42
-rw-r--r--tests/auto/qtcpsocket/stressTest/main.cpp8
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp10
4 files changed, 2 insertions, 152 deletions
diff --git a/tests/auto/qtcpsocket/stressTest/Test.cpp b/tests/auto/qtcpsocket/stressTest/Test.cpp
index 80b4c398f7..4304131352 100644
--- a/tests/auto/qtcpsocket/stressTest/Test.cpp
+++ b/tests/auto/qtcpsocket/stressTest/Test.cpp
@@ -47,87 +47,6 @@
// Test
#include "Test.h"
-#ifdef QT3_SUPPORT
-//------------------------------------------------------------------------------
-My3Socket::My3Socket(QObject *parent)
- : Q3Socket(parent), safeShutDown(false)
-{
- connect(this, SIGNAL(readyRead()), this, SLOT(read()));
- connect(this, SIGNAL(delayedCloseFinished()), this, SLOT(closed()));
- connect(this, SIGNAL(connectionClosed()), this, SLOT(closed()));
-}
-
-//------------------------------------------------------------------------------
-void My3Socket::read()
-{
- QDataStream in(this);
-
- quint32 num, reply;
-
- while (bytesAvailable()) {
- in >> num;
- if (num == 42) {
- qDebug("SUCCESS");
- safeShutDown = true;
- QCoreApplication::instance()->quit();
- return;
- }
- reply = num + 1;
- if (reply == 42)
- ++reply;
- }
-
- // Reply with a bigger number
- sendTest(reply);
-}
-
-//------------------------------------------------------------------------------
-void My3Socket::closed()
-{
- if (!safeShutDown)
- qDebug("FAILED");
- QCoreApplication::instance()->quit();
-}
-
-//------------------------------------------------------------------------------
-void My3Socket::sendTest(quint32 num)
-{
- QByteArray block;
- QDataStream out(&block, QIODevice::WriteOnly);
- out << num;
- writeBlock(block, block.size());
-}
-
-//------------------------------------------------------------------------------
-My3Server::My3Server(QObject *parent)
- : Q3ServerSocket(7700, 1, parent), m_socket(0)
-{
- if (ok())
- qDebug("qt3server");
-
- QTimer::singleShot(5000, this, SLOT(stopServer()));
-}
-
-//------------------------------------------------------------------------------
-void My3Server::newConnection(int socketId)
-{
- m_socket = new My3Socket(this);
- m_socket->setSocket(socketId);
-}
-
-//------------------------------------------------------------------------------
-void My3Server::stopServer()
-{
- if (m_socket) {
- qDebug("SUCCESS");
- m_socket->safeShutDown = true;
- m_socket->sendTest(42);
- } else {
- QCoreApplication::instance()->quit();
- }
-}
-#endif
-
//------------------------------------------------------------------------------
My4Socket::My4Socket(QObject *parent)
: QTcpSocket(parent), safeShutDown(false)
@@ -210,19 +129,6 @@ void My4Server::stopServer()
Test::Test(Type type)
{
switch (type) {
-#ifdef QT3_SUPPORT
- case Qt3Server: {
- new My3Server(this);
- break;
- }
- case Qt3Client: {
- qDebug("qt3client");
- My3Socket *s = new My3Socket(this);
- s->connectToHost("localhost", 7700);
- s->sendTest(1);
- break;
- }
-#endif
case Qt4Client: {
qDebug("qt4client");
My4Socket *s = new My4Socket(this);
diff --git a/tests/auto/qtcpsocket/stressTest/Test.h b/tests/auto/qtcpsocket/stressTest/Test.h
index f74eda3c79..1aa4d709c2 100644
--- a/tests/auto/qtcpsocket/stressTest/Test.h
+++ b/tests/auto/qtcpsocket/stressTest/Test.h
@@ -42,49 +42,11 @@
#define TEST_H
//------------------------------------------------------------------------------
-// Qt
-#ifdef QT3_SUPPORT
-#include <Q3ServerSocket>
-#include <Q3Socket>
-#endif
#include <QTcpServer>
#include <QTcpSocket>
//------------------------------------------------------------------------------
-#ifdef QT3_SUPPORT
-class My3Socket : public Q3Socket
-{
- Q_OBJECT
-public:
- My3Socket(QObject *parent);
-
- void sendTest(Q_UINT32 num);
- bool safeShutDown;
-
-private slots:
- void read();
- void closed();
-};
-
-//------------------------------------------------------------------------------
-class My3Server : public Q3ServerSocket
-{
- Q_OBJECT
-public:
- My3Server(QObject *parent = 0);
-
- void newConnection(int socket);
-
-private slots:
- void stopServer();
-
-private:
- My3Socket *m_socket;
-};
-#endif
-
-//------------------------------------------------------------------------------
class My4Socket : public QTcpSocket
{
Q_OBJECT
@@ -125,10 +87,6 @@ public:
enum Type {
Qt4Client,
Qt4Server,
-#ifdef QT3_SUPPORT
- Qt3Client,
- Qt3Server
-#endif
};
Test(Type type);
};
diff --git a/tests/auto/qtcpsocket/stressTest/main.cpp b/tests/auto/qtcpsocket/stressTest/main.cpp
index 83d175da28..6cff356910 100644
--- a/tests/auto/qtcpsocket/stressTest/main.cpp
+++ b/tests/auto/qtcpsocket/stressTest/main.cpp
@@ -56,14 +56,8 @@ int main(int argc, char **argv)
type = Test::Qt4Client;
else if (arg == QLatin1String("qt4server"))
type = Test::Qt4Server;
-#ifdef QT3_SUPPORT
- else if (arg == QLatin1String("qt3client"))
- type = Test::Qt3Client;
- else if (arg == QLatin1String("qt3server"))
- type = Test::Qt3Server;
-#endif
else {
- qDebug("usage: ./stressTest <qt3client|qt3server|qt4client|qt4server>");
+ qDebug("usage: ./stressTest <qt4client|qt4server>");
return 0;
}
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index f83c4cf99c..2e664935be 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -2167,20 +2167,12 @@ void tst_QTcpSocket::suddenRemoteDisconnect_data()
QTest::addColumn<QString>("client");
QTest::addColumn<QString>("server");
-#ifdef QT3_SUPPORT
- QTest::newRow("Qt3 Client <-> Qt3 Server") << QString::fromLatin1("qt3client") << QString::fromLatin1("qt3server");
- QTest::newRow("Qt3 Client <-> Qt4 Server") << QString::fromLatin1("qt3client") << QString::fromLatin1("qt4server");
- QTest::newRow("Qt4 Client <-> Qt3 Server") << QString::fromLatin1("qt4client") << QString::fromLatin1("qt3server");
-#endif
-
QTest::newRow("Qt4 Client <-> Qt4 Server") << QString::fromLatin1("qt4client") << QString::fromLatin1("qt4server");
}
void tst_QTcpSocket::suddenRemoteDisconnect()
{
-#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS)
- QSKIP("stressTest subprocess needs Qt3Support", SkipAll);
-#elif defined( Q_OS_SYMBIAN )
+#if defined( Q_OS_SYMBIAN )
QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll);
#else
QFETCH(QString, client);