summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@nokia.com>2009-09-29 18:13:58 +0300
committerJukka Rissanen <jukka.rissanen@nokia.com>2009-09-29 18:13:58 +0300
commitced25c7bf691060d1ca2e5edfe86d36f0c537ac5 (patch)
tree5dccd8530faa351ce428e19c76cd5171f3d8fdc9 /tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
parent5595aa3e1a98de3559216fa34be9d0dcf17e0295 (diff)
Unit tests pass for maemo.
Diffstat (limited to 'tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp')
-rw-r--r--tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp b/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
index c4276cc4c5..0d0680e180 100644
--- a/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
+++ b/tests/auto/qnetworkconfigmanager/tst_qnetworkconfigmanager.cpp
@@ -58,8 +58,9 @@ private slots:
private:
#ifdef MAEMO
Maemo::IAPConf *iapconf;
+ Maemo::IAPConf *iapconf2;
Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 100
+#define MAX_IAPS 50
Maemo::IAPConf *iaps[MAX_IAPS];
QProcess *icd_stub;
#endif
@@ -87,7 +88,16 @@ void tst_QNetworkConfigurationManager::initTestCase()
gprsiap->setValue("name", "MI6");
gprsiap->setValue("type", "GPRS");
- /* Create huge number of IAPs in the gconf and see what happens */
+ iapconf2 = new Maemo::IAPConf("osso.net");
+ iapconf2->setValue("ipv4_type", "AUTO");
+ iapconf2->setValue("wlan_wepkey1", "osso.net");
+ iapconf2->setValue("wlan_wepdefkey", 1);
+ iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
+ iapconf2->setValue("name", "osso.net");
+ iapconf2->setValue("type", "WLAN_INFRA");
+ iapconf2->setValue("wlan_security", "WEP");
+
+ /* Create large number of IAPs in the gconf and see what happens */
fflush(stdout);
printf("Creating %d IAPS: ", MAX_IAPS);
for (int i=0; i<MAX_IAPS; i++) {
@@ -107,16 +117,25 @@ void tst_QNetworkConfigurationManager::initTestCase()
icd_stub = new QProcess(this);
icd_stub->start("/usr/bin/icd2_stub.py");
- //QTest::qWait(1000);
+ QTest::qWait(1000);
// Add a known network to scan list that icd2 stub returns
QProcess dbus_send;
+ // 007 network
dbus_send.start("dbus-send --type=method_call --system "
"--dest=com.nokia.icd2 /com/nokia/icd2 "
"com.nokia.icd2.testing.add_available_network "
"string:'' uint32:0 string:'' "
"string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
dbus_send.waitForFinished();
+
+ // osso.net network
+ dbus_send.start("dbus-send --type=method_call --system "
+ "--dest=com.nokia.icd2 /com/nokia/icd2 "
+ "com.nokia.icd2.testing.add_available_network "
+ "string:'' uint32:0 string:'' "
+ "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
+ dbus_send.waitForFinished();
#endif
}
@@ -126,6 +145,8 @@ void tst_QNetworkConfigurationManager::cleanupTestCase()
#ifdef MAEMO
iapconf->clear();
delete iapconf;
+ iapconf2->clear();
+ delete iapconf2;
gprsiap->clear();
delete gprsiap;
@@ -249,9 +270,6 @@ void tst_QNetworkConfigurationManager::defaultConfiguration()
QNetworkConfiguration defaultConfig = manager.defaultConfiguration();
bool confirm = configs.contains(defaultConfig);
-#ifdef MAEMO
- confirm = !confirm; // In maemo the default configuration will never be in allConfiguration because it is a pseudo config
-#endif
bool isUserChoice = (defaultConfig.type() == QNetworkConfiguration::UserChoice);
//user choice config is not part of allConfigurations()