summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-04-14 06:23:22 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-04-14 06:23:22 (GMT)
commit90de3e5c903b67b2e5f3d7dc14266fe24f1daa23 (patch)
treeb2ec0c85f2455f738d6466f129a1f4d057caffa9 /tests/auto
parent0def696a8d569f0895010706fb989e78b25c13c1 (diff)
downloadQt-90de3e5c903b67b2e5f3d7dc14266fe24f1daa23.zip
Qt-90de3e5c903b67b2e5f3d7dc14266fe24f1daa23.tar.gz
Qt-90de3e5c903b67b2e5f3d7dc14266fe24f1daa23.tar.bz2
Bearer management changes from Qt Mobility (7a5ff985)
7a5ff9859f5775915ae80c287f51c772599c2379
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro2
-rw-r--r--tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp15
-rw-r--r--tests/auto/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro2
-rw-r--r--tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp13
-rw-r--r--tests/auto/qnetworksession/lackey/main.cpp7
-rw-r--r--tests/auto/qnetworksession/test/test.pro2
-rw-r--r--tests/auto/qnetworksession/test/tst_qnetworksession.cpp32
7 files changed, 48 insertions, 25 deletions
diff --git a/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro b/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro
index df2d2d9..ca463bd 100644
--- a/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro
+++ b/tests/auto/qnetworkconfiguration/qnetworkconfiguration.pro
@@ -8,7 +8,7 @@ symbian {
TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
}
-maemo6 {
+maemo6|maemo5 {
CONFIG += link_pkgconfig
PKGCONFIG += conninet
diff --git a/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index 70f4447..ce3acb7 100644
--- a/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/qnetworkconfiguration/tst_qnetworkconfiguration.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)
**
@@ -41,10 +41,11 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
-#include "qnetworkconfiguration.h"
-#include "qnetworkconfigmanager.h"
-#ifdef Q_WS_MAEMO_6
+#include <QtNetwork/qnetworkconfiguration.h>
+#include <QtNetwork/qnetworkconfigmanager.h>
+
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
#include <stdio.h>
#include <iapconf.h>
#endif
@@ -65,7 +66,7 @@ private slots:
void isRoamingAvailable();
private:
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
Maemo::IAPConf *iapconf;
Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
@@ -77,7 +78,7 @@ private:
void tst_QNetworkConfiguration::initTestCase()
{
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
iapconf->setValue("wlan_wepkey1", "connt");
@@ -150,7 +151,7 @@ void tst_QNetworkConfiguration::initTestCase()
void tst_QNetworkConfiguration::cleanupTestCase()
{
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf->clear();
delete iapconf;
iapconf2->clear();
diff --git a/tests/auto/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/auto/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
index e0028e5..d9c1d6b 100644
--- a/tests/auto/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
+++ b/tests/auto/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
@@ -8,7 +8,7 @@ symbian {
TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
}
-maemo6 {
+maemo6|maemo5 {
CONFIG += link_pkgconfig
PKGCONFIG += conninet
diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index 30c5a74..7cc527c 100644
--- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -41,10 +41,11 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
-#include "qnetworkconfiguration.h"
-#include "qnetworkconfigmanager.h"
-#ifdef Q_WS_MAEMO_6
+#include <QtNetwork/qnetworkconfiguration.h>
+#include <QtNetwork/qnetworkconfigmanager.h>
+
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
#include <stdio.h>
#include <iapconf.h>
#endif
@@ -66,7 +67,7 @@ private slots:
void configurationFromIdentifier();
private:
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
Maemo::IAPConf *iapconf;
Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
@@ -78,7 +79,7 @@ private:
void tst_QNetworkConfigurationManager::initTestCase()
{
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
iapconf->setValue("wlan_wepkey1", "connt");
@@ -152,7 +153,7 @@ void tst_QNetworkConfigurationManager::initTestCase()
void tst_QNetworkConfigurationManager::cleanupTestCase()
{
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf->clear();
delete iapconf;
iapconf2->clear();
diff --git a/tests/auto/qnetworksession/lackey/main.cpp b/tests/auto/qnetworksession/lackey/main.cpp
index 66d6dd4..8759b52 100644
--- a/tests/auto/qnetworksession/lackey/main.cpp
+++ b/tests/auto/qnetworksession/lackey/main.cpp
@@ -42,9 +42,10 @@
#include <QCoreApplication>
#include <QStringList>
#include <QLocalSocket>
-#include <qnetworkconfigmanager.h>
-#include <qnetworkconfiguration.h>
-#include <qnetworksession.h>
+
+#include <QtNetwork/qnetworkconfiguration.h>
+#include <QtNetwork/qnetworkconfigmanager.h>
+#include <QtNetwork/qnetworksession.h>
#include <QDebug>
diff --git a/tests/auto/qnetworksession/test/test.pro b/tests/auto/qnetworksession/test/test.pro
index d248b10..bfffe90 100644
--- a/tests/auto/qnetworksession/test/test.pro
+++ b/tests/auto/qnetworksession/test/test.pro
@@ -19,7 +19,7 @@ symbian {
TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData PowerMgmt
}
-maemo6 {
+maemo6|maemo5 {
CONFIG += link_pkgconfig
PKGCONFIG += conninet
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index 58b0576..23cdc6a 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -44,10 +44,11 @@
#include <QLocalSocket>
#include <QTimer>
#include "../../qbearertestcommon.h"
-#include <qnetworkconfigmanager.h>
-#include <qnetworksession.h>
-#ifdef Q_WS_MAEMO_6
+#include <QtNetwork/qnetworkconfigmanager.h>
+#include <QtNetwork/qnetworksession.h>
+
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
#include <stdio.h>
#include <iapconf.h>
#endif
@@ -72,6 +73,8 @@ public slots:
private slots:
+ void robustnessBombing();
+
void outOfProcessSession();
void invalidSession();
@@ -100,7 +103,7 @@ private:
int inProcessSessionManagementCount;
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
Maemo::IAPConf *iapconf;
Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
@@ -123,7 +126,7 @@ void tst_QNetworkSession::initTestCase()
qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration");
qRegisterMetaType<QNetworkConfiguration::Type>("QNetworkConfiguration::Type");
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf = new Maemo::IAPConf("007");
iapconf->setValue("ipv4_type", "AUTO");
iapconf->setValue("wlan_wepkey1", "connt");
@@ -209,7 +212,7 @@ void tst_QNetworkSession::cleanupTestCase()
"inProcessSessionManagement()");
}
-#ifdef Q_WS_MAEMO_6
+#if defined(Q_WS_MAEMO_6) || defined(Q_WS_MAEMO_5)
iapconf->clear();
delete iapconf;
iapconf2->clear();
@@ -232,6 +235,23 @@ void tst_QNetworkSession::cleanupTestCase()
#endif
}
+// Robustness test for calling interfaces in nonsense order / with nonsense parameters
+void tst_QNetworkSession::robustnessBombing()
+{
+ QNetworkConfigurationManager mgr;
+ QNetworkSession testSession(mgr.defaultConfiguration());
+ // Should not reset even session is not opened
+ testSession.migrate();
+ testSession.accept();
+ testSession.ignore();
+ testSession.reject();
+ quint64 temp;
+ temp = testSession.bytesWritten();
+ temp = testSession.bytesReceived();
+ temp = testSession.activeTime();
+}
+
+
void tst_QNetworkSession::invalidSession()
{
// 1. Verify that session created with invalid configuration remains in invalid state