From 49babe02f0a00fe2baff3950fbdcb725ce20d772 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 17 May 2011 13:43:30 +1000 Subject: 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 --- tests/auto/qtcpsocket/stressTest/Test.cpp | 94 ------------------------------- tests/auto/qtcpsocket/stressTest/Test.h | 42 -------------- tests/auto/qtcpsocket/stressTest/main.cpp | 8 +-- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 10 +--- 4 files changed, 2 insertions(+), 152 deletions(-) (limited to 'tests/auto/qtcpsocket') 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,48 +42,10 @@ #define TEST_H //------------------------------------------------------------------------------ -// Qt -#ifdef QT3_SUPPORT -#include -#include -#endif #include #include -//------------------------------------------------------------------------------ -#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 { @@ -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 "); + qDebug("usage: ./stressTest "); 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("client"); QTest::addColumn("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); -- cgit v1.2.3