From 978dd42d80730fea26ba02303bb65904cfdbadb5 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 26 May 2011 13:43:32 +0100 Subject: Enable QTcpServer benchmark on symbian Added required capability to the .pro file Added default connection startup code Removed the QSKIP for IPv6 test Reviewed-by: Markus Goetz --- .../network/socket/qtcpserver/qtcpserver.pro | 2 ++ .../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 #include +#include +#include +#include + #include Q_DECLARE_METATYPE(QNetworkProxy) Q_DECLARE_METATYPE(QList) @@ -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 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(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); -- cgit v0.12