From cd62bacc89db0906b85da8fb3b0501fb5c4a39a1 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 5 Oct 2011 16:23:06 +1000 Subject: Remove code to selectively run test functions. QTestLib already makes a superior version of this functionality available to all tests, without the need to recompile. Each qtestlib test program can be passed, via the command line, a list of test functions and test data tags to be executed instead of executing all test functions. Change-Id: I1b54fc70a0c58a17209817afabfb953b5748dac4 Reviewed-on: http://codereview.qt-project.org/6015 Reviewed-by: Qt Sanity Bot Reviewed-by: Rohan McGovern --- .../qnetworksession/test/tst_qnetworksession.cpp | 45 ++-------------------- 1 file changed, 3 insertions(+), 42 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp index f000cd3d84..6d11fd5ccd 100644 --- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp +++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp @@ -96,8 +96,6 @@ private slots: private: QNetworkConfigurationManager manager; - QMap testsToRun; - int inProcessSessionManagementCount; #if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) @@ -121,17 +119,6 @@ void tst_QNetworkSession::initTestCase() { qRegisterMetaType("QNetworkConfiguration"); qRegisterMetaType("QNetworkConfiguration::Type"); - - // If you wish to skip tests, set value as false. This is often very convinient because tests are so lengthy. - // Better way still would be to make this readable from a file. - testsToRun["robustnessBombing"] = true; - testsToRun["sessionClosing"] = true; - testsToRun["outOfProcessSession"] = true; - testsToRun["invalidSession"] = true; - testsToRun["repeatedOpenClose"] = true; - testsToRun["sessionProperties"] = true; - testsToRun["userChoiceSession"] = true; - testsToRun["sessionOpenCloseStop"] = true; #if defined(Q_OS_UNIX) && !defined(QT_NO_ICD) iapconf = new Maemo::IAPConf("007"); @@ -245,10 +232,6 @@ void tst_QNetworkSession::cleanupTestCase() // Robustness test for calling interfaces in nonsense order / with nonsense parameters void tst_QNetworkSession::robustnessBombing() { - if (!testsToRun["robustnessBombing"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } - QNetworkConfigurationManager mgr; QNetworkSession testSession(mgr.defaultConfiguration()); // Should not reset even session is not opened @@ -270,9 +253,6 @@ void tst_QNetworkSession::sessionClosing_data() { // Testcase for closing the session at unexpected times void tst_QNetworkSession::sessionClosing() { - if (!testsToRun["sessionClosing"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } QFETCH(QString, bearerType); QFETCH(QNetworkConfiguration::Type, configurationType); @@ -307,10 +287,7 @@ void tst_QNetworkSession::sessionClosing() } void tst_QNetworkSession::invalidSession() -{ - if (!testsToRun["invalidSession"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } +{ // 1. Verify that session created with invalid configuration remains in invalid state QNetworkSession session(QNetworkConfiguration(), 0); QVERIFY(!session.isOpen()); @@ -385,9 +362,6 @@ void tst_QNetworkSession::sessionProperties_data() void tst_QNetworkSession::sessionProperties() { - if (!testsToRun["sessionProperties"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } QFETCH(QNetworkConfiguration, configuration); QNetworkSession session(configuration); QVERIFY(session.configuration() == configuration); @@ -460,12 +434,8 @@ void tst_QNetworkSession::repeatedOpenClose_data() { } // Tests repeated-open close. -void tst_QNetworkSession::repeatedOpenClose() -{ - if (!testsToRun["repeatedOpenClose"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } - +void tst_QNetworkSession::repeatedOpenClose() +{ QFETCH(QString, bearerType); QFETCH(QNetworkConfiguration::Type, configurationType); QFETCH(int, repeatTimes); @@ -503,9 +473,6 @@ void tst_QNetworkSession::userChoiceSession_data() void tst_QNetworkSession::userChoiceSession() { - if (!testsToRun["userChoiceSession"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } QFETCH(QNetworkConfiguration, configuration); QVERIFY(configuration.type() == QNetworkConfiguration::UserChoice); @@ -634,9 +601,6 @@ void tst_QNetworkSession::sessionOpenCloseStop_data() void tst_QNetworkSession::sessionOpenCloseStop() { - if (!testsToRun["sessionOpenCloseStop"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } QFETCH(QNetworkConfiguration, configuration); QFETCH(bool, forceSessionStop); @@ -1038,9 +1002,6 @@ QDebug operator<<(QDebug debug, const QList &list) // at Discovered -state. void tst_QNetworkSession::outOfProcessSession() { - if (!testsToRun["outOfProcessSession"]) { - QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll); - } updateConfigurations(); QTest::qWait(2000); -- cgit v1.2.3