summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/access/access.pro3
-rw-r--r--tests/auto/network/access/qftp/tst_qftp.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp42
3 files changed, 23 insertions, 24 deletions
diff --git a/tests/auto/network/access/access.pro b/tests/auto/network/access/access.pro
index 69ed189712..1e98d3cf85 100644
--- a/tests/auto/network/access/access.pro
+++ b/tests/auto/network/access/access.pro
@@ -8,12 +8,11 @@ SUBDIRS=\
qhttpnetworkconnection \
qnetworkreply \
qnetworkcachemetadata \
- qftp \
qhttpnetworkreply \
qabstractnetworkcache \
!contains(QT_CONFIG, private_tests): SUBDIRS -= \
qhttpnetworkconnection \
qhttpnetworkreply \
-
+ qftp \
diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp
index 49e1f4b230..35abd68415 100644
--- a/tests/auto/network/access/qftp/tst_qftp.cpp
+++ b/tests/auto/network/access/qftp/tst_qftp.cpp
@@ -45,7 +45,7 @@
#include <qcoreapplication.h>
#include <qfile.h>
#include <qbuffer.h>
-#include "qftp.h"
+#include "private/qftp_p.h"
#include <qmap.h>
#include <time.h>
#include <stdlib.h>
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 6ed241175d..e2c5798c53 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -54,7 +54,9 @@
#include <QtNetwork/QLocalSocket>
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QHostInfo>
-#include <QtNetwork/QFtp>
+#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
+#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QAbstractNetworkCache>
#include <QtNetwork/qauthenticator.h>
#include <QtNetwork/qnetworkaccessmanager.h>
@@ -1849,23 +1851,22 @@ void tst_QNetworkReply::putToFtp()
// download the file again from FTP to make sure it was uploaded
// correctly
- QFtp ftp;
- ftp.connectToHost(url.host());
- ftp.login();
- ftp.get(url.path());
+ QNetworkAccessManager qnam;
+ QNetworkRequest req(url);
+ QNetworkReply *r = qnam.get(req);
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QByteArray uploaded = ftp.readAll();
+ QByteArray uploaded = r->readAll();
QCOMPARE(uploaded.size(), data.size());
QCOMPARE(uploaded, data);
- ftp.close();
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ r->close();
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
void tst_QNetworkReply::putToHttp_data()
@@ -3901,23 +3902,22 @@ void tst_QNetworkReply::ioPutToFtpFromFile()
// download the file again from FTP to make sure it was uploaded
// correctly
- QFtp ftp;
- ftp.connectToHost(url.host());
- ftp.login();
- ftp.get(url.path());
+ QNetworkAccessManager qnam;
+ QNetworkRequest req(url);
+ QNetworkReply *r = qnam.get(req);
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(3);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QByteArray uploaded = ftp.readAll();
+ QByteArray uploaded = r->readAll();
QCOMPARE(qint64(uploaded.size()), sourceFile.size());
QCOMPARE(uploaded, sourceFile.readAll());
- ftp.close();
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ r->close();
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
void tst_QNetworkReply::ioPutToHttpFromFile_data()