diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro | 2 | ||||
-rw-r--r-- | tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp | 35 |
2 files changed, 33 insertions, 4 deletions
diff --git a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro index e5b9346..4bdfcb7 100644 --- a/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro +++ b/tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro @@ -11,3 +11,5 @@ CONFIG += release # Input SOURCES += tst_qtcpserver.cpp + +symbian:TARGET.CAPABILITY += NetworkServices
\ No newline at end of file diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index f81853b..9fc5807 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -54,6 +54,10 @@ #include <qplatformdefs.h> #include <qhostinfo.h> +#include <QNetworkConfiguration> +#include <QNetworkConfigurationManager> +#include <QNetworkSession> + #include <QNetworkProxy> Q_DECLARE_METATYPE(QNetworkProxy) Q_DECLARE_METATYPE(QList<QNetworkProxy>) @@ -75,16 +79,42 @@ public: public slots: void initTestCase_data(); void init(); + void initTestCase(); void cleanup(); private slots: void ipv4LoopbackPerformanceTest(); void ipv6LoopbackPerformanceTest(); void ipv4PerformanceTest(); +private: +#ifndef QT_NO_BEARERMANAGEMENT + QNetworkConfigurationManager *netConfMan; + QNetworkConfiguration networkConfiguration; + QSharedPointer<QNetworkSession> networkSession; +#endif }; tst_QTcpServer::tst_QTcpServer() { - Q_SET_DEFAULT_IAP +} + +void tst_QTcpServer::initTestCase() +{ +#ifndef QT_NO_BEARERMANAGEMENT + netConfMan = new QNetworkConfigurationManager(this); + netConfMan->updateConfigurations(); + connect(netConfMan, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + networkConfiguration = netConfMan->defaultConfiguration(); + if (networkConfiguration.isValid()) { + networkSession = QSharedPointer<QNetworkSession>(new QNetworkSession(networkConfiguration)); + if (!networkSession->isOpen()) { + networkSession->open(); + QVERIFY(networkSession->waitForOpened(30000)); + } + } else { + QVERIFY(!(netConfMan->capabilities() & QNetworkConfigurationManager::NetworkSessionRequired)); + } +#endif } tst_QTcpServer::~tst_QTcpServer() @@ -179,9 +209,6 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() QSKIP("WinCE WM: Not yet supported", SkipAll); #endif -#if defined(Q_OS_SYMBIAN) - QSKIP("Symbian: IPv6 is not yet supported", SkipAll); -#endif QTcpServer server; if (!server.listen(QHostAddress::LocalHostIPv6, 0)) { QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError); |