summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-05-26 12:43:32 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-06-13 09:54:55 (GMT)
commit978dd42d80730fea26ba02303bb65904cfdbadb5 (patch)
tree6ae942ebff0043a37042abe6b2f2eec439b13052
parent437aa330b9ce7934200592fef0227997fbbe17b5 (diff)
downloadQt-978dd42d80730fea26ba02303bb65904cfdbadb5.zip
Qt-978dd42d80730fea26ba02303bb65904cfdbadb5.tar.gz
Qt-978dd42d80730fea26ba02303bb65904cfdbadb5.tar.bz2
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
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/qtcpserver.pro2
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp35
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);