summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-03-28 14:58:34 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-03-29 09:48:24 (GMT)
commita970c3334bba3b7e1e27fa8b1b4ad4e4724ce015 (patch)
treed9b1f3ba6287e653e89daf053809459d57b4f40c /tests
parentbcbce977fa7a0d61de5f17e6727eba5a823bc3bb (diff)
downloadQt-a970c3334bba3b7e1e27fa8b1b4ad4e4724ce015.zip
Qt-a970c3334bba3b7e1e27fa8b1b4ad4e4724ce015.tar.gz
Qt-a970c3334bba3b7e1e27fa8b1b4ad4e4724ce015.tar.bz2
Bearer support for autotests
Start default bearer when running network self test Fix typo in qnetworkreply test Reviewed-by: Markus Goetz
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/networkselftest/tst_networkselftest.cpp26
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp2
2 files changed, 27 insertions, 1 deletions
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp
index 64de64a..ed070d7 100644
--- a/tests/auto/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/networkselftest/tst_networkselftest.cpp
@@ -44,6 +44,12 @@
#include <time.h>
+#ifndef QT_NO_BEARERMANAGEMENT
+#include <QtNetwork/qnetworkconfigmanager.h>
+#include <QtNetwork/qnetworkconfiguration.h>
+#include <QtNetwork/qnetworksession.h>
+#endif
+
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
// Current path (C:\private\<UID>) contains only ascii chars
@@ -64,6 +70,7 @@ public:
QHostAddress serverIpAddress();
private slots:
+ void initTestCase();
void hostTest();
void dnsResolution_data();
void dnsResolution();
@@ -91,6 +98,12 @@ private slots:
// ssl supported test
void supportsSsl();
+private:
+#ifndef QT_NO_BEARERMANAGEMENT
+ QNetworkConfigurationManager *netConfMan;
+ QNetworkConfiguration networkConfiguration;
+ QScopedPointer<QNetworkSession> networkSession;
+#endif
};
class Chat
@@ -354,6 +367,19 @@ QHostAddress tst_NetworkSelfTest::serverIpAddress()
return cachedIpAddress;
}
+void tst_NetworkSelfTest::initTestCase()
+{
+#ifndef QT_NO_BEARERMANAGEMENT
+ netConfMan = new QNetworkConfigurationManager(this);
+ networkConfiguration = netConfMan->defaultConfiguration();
+ networkSession.reset(new QNetworkSession(networkConfiguration));
+ if (!networkSession->isOpen()) {
+ networkSession->open();
+ QVERIFY(networkSession->waitForOpened(30000));
+ }
+#endif
+}
+
void tst_NetworkSelfTest::hostTest()
{
// this is a localhost self-test
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 4b8dc3b..11f4fc3 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -143,7 +143,7 @@ class tst_QNetworkReply: public QObject
QSslConfiguration storedSslConfiguration;
QList<QSslError> storedExpectedSslErrors;
#endif
-#ifndef QT_NO_BEARER_MANAGEMENT
+#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager *netConfMan;
QNetworkConfiguration networkConfiguration;
QScopedPointer<QNetworkSession> networkSession;