summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworksession/lackey
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-03 06:41:07 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-03 06:41:07 (GMT)
commite80295fff0836268d357488feaefb874b458e8ab (patch)
treee7c283b015fe520654c50c4fb10a62982077bd4f /tests/auto/qnetworksession/lackey
parentba7fdc51a2cc0792ceeaf51edce7863c94d96249 (diff)
parent29f24e41b91c05d551c7ac16625a2961744c8339 (diff)
downloadQt-e80295fff0836268d357488feaefb874b458e8ab.zip
Qt-e80295fff0836268d357488feaefb874b458e8ab.tar.gz
Qt-e80295fff0836268d357488feaefb874b458e8ab.tar.bz2
Merge commit 'BearerIntegration-5' into remove-manual-test
Conflicts: tests/auto/qnetworksession/lackey/lackey.pro tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp
Diffstat (limited to 'tests/auto/qnetworksession/lackey')
-rw-r--r--tests/auto/qnetworksession/lackey/lackey.pro6
-rw-r--r--tests/auto/qnetworksession/lackey/main.cpp21
2 files changed, 20 insertions, 7 deletions
diff --git a/tests/auto/qnetworksession/lackey/lackey.pro b/tests/auto/qnetworksession/lackey/lackey.pro
index 6cc1b43..3ed9850 100644
--- a/tests/auto/qnetworksession/lackey/lackey.pro
+++ b/tests/auto/qnetworksession/lackey/lackey.pro
@@ -2,3 +2,9 @@ SOURCES += main.cpp
TARGET = qnetworksessionlackey
QT = core network
+
+symbian {
+ # Needed for interprocess communication and opening QNetworkSession
+ TARGET.CAPABILITY = NetworkControl NetworkServices
+}
+
diff --git a/tests/auto/qnetworksession/lackey/main.cpp b/tests/auto/qnetworksession/lackey/main.cpp
index a84021d..1e40485 100644
--- a/tests/auto/qnetworksession/lackey/main.cpp
+++ b/tests/auto/qnetworksession/lackey/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -54,16 +54,23 @@ QT_USE_NAMESPACE
#define NO_DISCOVERED_CONFIGURATIONS_ERROR 1
#define SESSION_OPEN_ERROR 2
+
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
QNetworkConfigurationManager manager;
QList<QNetworkConfiguration> discovered =
+#if defined (Q_OS_SYMBIAN)
+ // On Symbian, on the first query (before updateConfigurations() call
+ // the discovered-states are not correct, so defined-state will do.
+ manager.allConfigurations(QNetworkConfiguration::Defined);
+#else
manager.allConfigurations(QNetworkConfiguration::Discovered);
-
- if (discovered.isEmpty())
+#endif
+ if (discovered.isEmpty()) {
return NO_DISCOVERED_CONFIGURATIONS_ERROR;
+ }
// Cannot read/write to processes on WinCE or Symbian.
// Easiest alternative is to use sockets for IPC.
@@ -85,15 +92,16 @@ int main(int argc, char** argv)
qDebug() << "Discovered configurations:" << discovered.count();
if (discovered.isEmpty()) {
- qDebug() << "No more configurations";
+ qDebug() << "No more discovered configurations";
break;
}
qDebug() << "Taking first configuration";
QNetworkConfiguration config = discovered.takeFirst();
+
if ((config.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
- qDebug() << config.name() << "is active";
+ qDebug() << config.name() << "is active, therefore skipping it (looking for configs in 'discovered' state).";
continue;
}
@@ -104,12 +112,11 @@ int main(int argc, char** argv)
QString output = QString("Starting session for %1\n").arg(config.identifier());
oopSocket.write(output.toAscii());
oopSocket.waitForBytesWritten();
-
session->open();
session->waitForOpened();
} while (!(session && session->isOpen()));
- qDebug() << "loop done";
+ qDebug() << "lackey: loop done";
if (!session) {
qDebug() << "Could not start session";