diff options
Diffstat (limited to 'tests/auto/qnetworksession')
4 files changed, 22 insertions, 32 deletions
diff --git a/tests/auto/qnetworksession/lackey/lackey.pro b/tests/auto/qnetworksession/lackey/lackey.pro index b8a006b..6cc1b43 100644 --- a/tests/auto/qnetworksession/lackey/lackey.pro +++ b/tests/auto/qnetworksession/lackey/lackey.pro @@ -1,13 +1,4 @@ SOURCES += main.cpp TARGET = qnetworksessionlackey -INCLUDEPATH += ../../../../src/bearer -DEPENDPATH += ../../../../src/bearer QT = core network - -CONFIG+= testcase - -include(../../../../common.pri) - -CONFIG += mobility -MOBILITY = bearer diff --git a/tests/auto/qnetworksession/lackey/main.cpp b/tests/auto/qnetworksession/lackey/main.cpp index f3a7a07..a84021d 100644 --- a/tests/auto/qnetworksession/lackey/main.cpp +++ b/tests/auto/qnetworksession/lackey/main.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Mobility Components. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -48,7 +48,7 @@ #include <QDebug> -QTM_USE_NAMESPACE +QT_USE_NAMESPACE #define NO_DISCOVERED_CONFIGURATIONS_ERROR 1 diff --git a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp index 86b3e46..d3923e9 100644 --- a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp +++ b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Mobility Components. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -51,7 +51,7 @@ #include <iapconf.h> #endif -QTM_USE_NAMESPACE +QT_USE_NAMESPACE Q_DECLARE_METATYPE(QNetworkConfiguration) Q_DECLARE_METATYPE(QNetworkSession::State); @@ -82,7 +82,7 @@ private slots: private: QNetworkConfigurationManager manager; - uint inProcessSessionManagementCount; + int inProcessSessionManagementCount; #ifdef Q_WS_MAEMO_6 Maemo::IAPConf *iapconf; @@ -170,7 +170,7 @@ void tst_QNetworkSession::initTestCase() dbus_send.waitForFinished(); #endif - inProcessSessionManagementCount = 0; + inProcessSessionManagementCount = -1; QSignalSpy spy(&manager, SIGNAL(updateCompleted())); manager.updateConfigurations(); @@ -249,6 +249,9 @@ void tst_QNetworkSession::sessionProperties() if (!configuration.isValid()) { QVERIFY(configuration.bearerName().isEmpty()); } else { + qDebug() << "Type:" << configuration.type() + << "Bearer:" << configuration.bearerName(); + switch (configuration.type()) { case QNetworkConfiguration::ServiceNetwork: @@ -264,6 +267,8 @@ void tst_QNetworkSession::sessionProperties() // QNetworkSession::interface() should return an invalid interface unless // session is in the connected state. + qDebug() << "Session state:" << session.state(); + qDebug() << "Session iface:" << session.interface().isValid() << session.interface().name(); QCOMPARE(session.state() == QNetworkSession::Connected, session.interface().isValid()); if (!configuration.isValid()) { @@ -426,6 +431,8 @@ void tst_QNetworkSession::sessionOpenCloseStop_data() QTest::newRow((name + QLatin1String(" stop")).toLocal8Bit().constData()) << config << true; } + + inProcessSessionManagementCount = 0; } void tst_QNetworkSession::sessionOpenCloseStop() @@ -788,6 +795,8 @@ QDebug operator<<(QDebug debug, const QList<QNetworkConfiguration> &list) void tst_QNetworkSession::outOfProcessSession() { + qDebug() << "START"; + QNetworkConfigurationManager manager; QList<QNetworkConfiguration> before = manager.allConfigurations(QNetworkConfiguration::Active); @@ -803,13 +812,16 @@ void tst_QNetworkSession::outOfProcessSession() QLocalServer::removeServer("tst_qnetworksession"); oopServer.listen("tst_qnetworksession"); + qDebug() << "starting lackey"; QProcess lackey; lackey.start("qnetworksessionlackey"); + qDebug() << lackey.error() << lackey.errorString(); QVERIFY(lackey.waitForStarted()); + qDebug() << "waiting for connection"; QVERIFY(oopServer.waitForNewConnection(-1)); QLocalSocket *oopSocket = oopServer.nextPendingConnection(); - + qDebug() << "got connection"; do { QByteArray output; @@ -817,7 +829,7 @@ void tst_QNetworkSession::outOfProcessSession() output = oopSocket->readLine().trimmed(); if (output.startsWith("Started session ")) { - QString identifier = QString::fromLocal8Bit(output.mid(16).constData()); + QString identifier = QString::fromLocal8Bit(output.mid(20).constData()); QNetworkConfiguration changed; @@ -873,12 +885,12 @@ void tst_QNetworkSession::outOfProcessSession() break; case 1: QSKIP("No discovered configurations found.", SkipAll); - break; case 2: QSKIP("Lackey could not start session.", SkipAll); default: QSKIP("Lackey failed", SkipAll); } + qDebug("STOP"); } QTEST_MAIN(tst_QNetworkSession) diff --git a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro index 18b5c23..ffa3b25 100644 --- a/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro +++ b/tests/auto/qnetworksession/tst_qnetworksession/tst_qnetworksession.pro @@ -1,22 +1,9 @@ +load(qttest_p4) SOURCES += tst_qnetworksession.cpp HEADERS += ../../qbearertestcommon.h -TARGET = tst_qnetworksession -CONFIG += testcase QT = core network -INCLUDEPATH += ../../../../src/bearer - -include(../../../../common.pri) -CONFIG += mobility -MOBILITY = bearer - -wince* { - LACKEY.sources = $$OUTPUT_DIR/build/tests/bin/qnetworksessionlackey.exe - LACKEY.path = . - DEPLOYMENT += LACKEY -} - symbian { TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData } |