summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXizhi Zhu <xizhi.zhu@gmail.com>2012-01-13 20:05:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-16 11:29:04 +0100
commit5b1aa4c75de4301d1417fd98bb1abf0767779736 (patch)
tree44d3bab26ec70c633abb20b58bb18f9d5bf54edb /tests
parent23a372ab8d59cd9b33356a16744313890b544f4f (diff)
Fixed build break when bearer is disabled.
Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp8
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp2
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp7
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp6
-rw-r--r--tests/auto/network/bearer/qnetworksession/lackey/main.cpp4
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp10
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp4
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp2
8 files changed, 39 insertions, 4 deletions
diff --git a/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp b/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
index 5b10123b56..9fda95821e 100644
--- a/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
+++ b/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
@@ -42,11 +42,15 @@
#include <QtTest/QtTest>
#include <QtNetwork/QNetworkAccessManager>
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/QNetworkConfigurationManager>
+#endif
#include <QtCore/QDebug>
-Q_DECLARE_METATYPE(QNetworkAccessManager::NetworkAccessibility);
+#ifndef QT_NO_BEARERMANAGEMENT
+Q_DECLARE_METATYPE(QNetworkAccessManager::NetworkAccessibility)
+#endif
class tst_QNetworkAccessManager : public QObject
{
@@ -65,6 +69,7 @@ tst_QNetworkAccessManager::tst_QNetworkAccessManager()
void tst_QNetworkAccessManager::networkAccessible()
{
+#ifndef QT_NO_BEARERMANAGEMENT
QNetworkAccessManager manager;
qRegisterMetaType<QNetworkAccessManager::NetworkAccessibility>("QNetworkAccessManager::NetworkAccessibility");
@@ -105,6 +110,7 @@ void tst_QNetworkAccessManager::networkAccessible()
QNetworkAccessManager::NotAccessible);
QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::NotAccessible);
}
+#endif
}
QTEST_MAIN(tst_QNetworkAccessManager)
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 6fae97dc6d..9d3c8a7f2f 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -1315,9 +1315,11 @@ void tst_QNetworkReply::cleanupTestCase()
#if !defined Q_OS_WIN
QFile::remove(wronlyFileName);
#endif
+#ifndef QT_NO_BEARERMANAGEMENT
if (networkSession && networkSession->isOpen()) {
networkSession->close();
}
+#endif
}
void tst_QNetworkReply::init()
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index f4dd6191b2..2a05f6132a 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -42,8 +42,10 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
+#endif
/*
Although this unit test doesn't use QNetworkAccessManager
@@ -53,17 +55,21 @@
#include <QNetworkAccessManager>
QT_USE_NAMESPACE
+
class tst_QNetworkConfiguration : public QObject
{
Q_OBJECT
private slots:
+#ifndef QT_NO_BEARERMANAGEMENT
void invalidPoint();
void comparison();
void children();
void isRoamingAvailable();
+#endif
};
+#ifndef QT_NO_BEARERMANAGEMENT
void tst_QNetworkConfiguration::invalidPoint()
{
QNetworkConfiguration pt;
@@ -188,6 +194,7 @@ void tst_QNetworkConfiguration::isRoamingAvailable()
}
}
}
+#endif
QTEST_MAIN(tst_QNetworkConfiguration)
#include "tst_qnetworkconfiguration.moc"
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index 7366e0adc1..c801534a50 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -42,8 +42,10 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
+#endif
QT_USE_NAMESPACE
class tst_QNetworkConfigurationManager : public QObject
@@ -51,12 +53,15 @@ class tst_QNetworkConfigurationManager : public QObject
Q_OBJECT
private slots:
+#ifndef QT_NO_BEARERMANAGEMENT
void usedInThread(); // this test must be first, or it will falsely pass
void allConfigurations();
void defaultConfiguration();
void configurationFromIdentifier();
+#endif
};
+#ifndef QT_NO_BEARERMANAGEMENT
void printConfigurationDetails(const QNetworkConfiguration& p)
{
qDebug() << p.name() <<": isvalid->" <<p.isValid() << " type->"<< p.type() <<
@@ -245,6 +250,7 @@ void tst_QNetworkConfigurationManager::usedInThread()
//QCOMPARE(thread.preScanConfigs, preScanConfigs);
#endif
}
+#endif
QTEST_MAIN(tst_QNetworkConfigurationManager)
#include "tst_qnetworkconfigurationmanager.moc"
diff --git a/tests/auto/network/bearer/qnetworksession/lackey/main.cpp b/tests/auto/network/bearer/qnetworksession/lackey/main.cpp
index 2631e06f64..1182454fda 100644
--- a/tests/auto/network/bearer/qnetworksession/lackey/main.cpp
+++ b/tests/auto/network/bearer/qnetworksession/lackey/main.cpp
@@ -43,9 +43,11 @@
#include <QStringList>
#include <QLocalSocket>
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
+#endif
#include <QEventLoop>
#include <QTimer>
@@ -62,6 +64,7 @@ int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
+#ifndef QT_NO_BEARERMANAGEMENT
// Update configurations so that everything is up to date for this process too.
// Event loop is used to wait for awhile.
QNetworkConfigurationManager manager;
@@ -150,6 +153,7 @@ int main(int argc, char** argv)
oopSocket.disconnectFromServer();
oopSocket.waitForDisconnected(-1);
+#endif
return 0;
}
diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
index ceedd17064..26bdec5c9b 100644
--- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
@@ -45,27 +45,31 @@
#include <QTimer>
#include "../../qbearertestcommon.h"
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
+#endif
QT_USE_NAMESPACE
// Can be used to configure tests that require manual attention (such as roaming)
//#define QNETWORKSESSION_MANUAL_TESTS 1
+#ifndef QT_NO_BEARERMANAGEMENT
Q_DECLARE_METATYPE(QNetworkConfiguration)
Q_DECLARE_METATYPE(QNetworkConfiguration::Type)
+#endif
class tst_QNetworkSession : public QObject
{
Q_OBJECT
+#ifndef QT_NO_BEARERMANAGEMENT
public slots:
void initTestCase();
void cleanupTestCase();
private slots:
-
void robustnessBombing();
void sessionClosing_data();
@@ -92,8 +96,10 @@ private slots:
private:
QNetworkConfigurationManager manager;
int inProcessSessionManagementCount;
+#endif
};
+#ifndef QT_NO_BEARERMANAGEMENT
// Helper functions
bool openSession(QNetworkSession *session);
bool closeSession(QNetworkSession *session, bool lastSessionOnConfiguration = true);
@@ -1250,7 +1256,7 @@ void tst_QNetworkSession::sessionAutoClose()
QCOMPARE(autoCloseSession.toInt(), -1);
}
+#endif
QTEST_MAIN(tst_QNetworkSession)
-
#include "tst_qnetworksession.moc"
diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
index da48b4907a..9a82be67a7 100644
--- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
+++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
@@ -45,8 +45,10 @@
#include <qcoreapplication.h>
#include <qnetworkinterface.h>
#include <qtcpsocket.h>
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QNetworkConfigurationManager>
#include <QNetworkSession>
+#endif
#include "../../../network-settings.h"
class tst_QNetworkInterface : public QObject
@@ -68,7 +70,7 @@ private slots:
void copyInvalidInterface();
private:
-#ifndef QT_NO_BEARER_MANAGEMENT
+#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager *netConfMan;
QNetworkConfiguration networkConfiguration;
QScopedPointer<QNetworkSession> networkSession;
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index b51e24b9a5..fb23483451 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -63,7 +63,9 @@
Q_DECLARE_METATYPE(QHostAddress)
Q_DECLARE_METATYPE(QNetworkInterface)
+#ifndef QT_NO_BEARERMANAGEMENT
Q_DECLARE_METATYPE(QSharedPointer<QNetworkSession>)
+#endif
QT_FORWARD_DECLARE_CLASS(QUdpSocket)