No need to return after QSKIP.
authorJason McDonald <jason.mcdonald@nokia.com>
Fri, 7 Oct 2011 00:55:06 +0000 (10:55 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 7 Oct 2011 02:30:30 +0000 (04:30 +0200)
QSKIP already causes the test function that calls it to return, so the
returns removed by this commit were unreachable.

Change-Id: I1fa2f3a3271927d8a600b02d8b31bd81db9146b1
Reviewed-on: http://codereview.qt-project.org/6188
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
tests/auto/qplaintextedit/tst_qplaintextedit.cpp
tests/auto/sql/kernel/qsqldatabase/tst_databases.h
tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp

index fe37c77..af6d822 100644 (file)
@@ -253,10 +253,8 @@ void tst_QFontDatabase::addAppFont()
     QCOMPARE(fontDbChangedSpy.count(), 1);
 // addApplicationFont is supported on Mac, don't skip the test if it breaks.
 #ifndef Q_WS_MAC
-    if (id == -1) {
+    if (id == -1)
         QSKIP("Skip the test since app fonts are not supported on this system", SkipSingle);
-        return;
-    }
 #endif
 
     const QStringList addedFamilies = QFontDatabase::applicationFontFamilies(id);
index 3344062..f69b665 100644 (file)
@@ -423,10 +423,8 @@ void tst_QGraphicsEffect::opacity()
 
 void tst_QGraphicsEffect::grayscale()
 {
-    if (qApp->desktop()->depth() < 24) {
+    if (qApp->desktop()->depth() < 24)
         QSKIP("Test only works on 32 bit displays", SkipAll);
-        return;
-    }
 
     QGraphicsScene scene(0, 0, 100, 100);
 
@@ -472,10 +470,8 @@ void tst_QGraphicsEffect::grayscale()
 
 void tst_QGraphicsEffect::colorize()
 {
-    if (qApp->desktop()->depth() < 24) {
+    if (qApp->desktop()->depth() < 24)
         QSKIP("Test only works on 32 bit displays", SkipAll);
-        return;
-    }
 
     QGraphicsScene scene(0, 0, 100, 100);
 
index c6babb8..f7bdf67 100644 (file)
@@ -10519,7 +10519,6 @@ void tst_QGraphicsItem::updateMicroFocus()
 {
 #if defined Q_OS_WIN || defined Q_OS_MAC
     QSKIP("QTBUG-9578", SkipAll);
-    return;
 #endif
     QGraphicsScene scene;
     QWidget parent;
index 432baed..d847f29 100644 (file)
@@ -339,10 +339,8 @@ void tst_QPlainTextEdit::paragSeparatorOnPlaintextAppend()
 #ifndef QT_NO_CLIPBOARD
 void tst_QPlainTextEdit::selectAllSetsNotSelection()
 {
-    if (!QApplication::clipboard()->supportsSelection()) {
+    if (!QApplication::clipboard()->supportsSelection())
         QSKIP("Test only relevant for systems with selection", SkipAll);
-        return;
-    }
 
     QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection);
     QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar"));
index 497f5a4..9515d01 100644 (file)
@@ -71,7 +71,7 @@
 #define QFAIL_SQL(q, stmt) QVERIFY2(!(q).stmt, tst_Databases::printError((q).lastError(), db))
 
 #define DBMS_SPECIFIC(db, driver) \
-    if (!db.driverName().startsWith(driver)) { QSKIP(driver " specific test", SkipSingle); return; }
+    if (!db.driverName().startsWith(driver)) { QSKIP(driver " specific test", SkipSingle); }
 
 // ### use QSystem::hostName if it is integrated in qtest/main
 static QString qGetHostName()
index dc0c86d..5546cef 100644 (file)
@@ -571,10 +571,8 @@ void tst_QSqlQuery::oraOutValues()
     CHECK_DATABASE( db );
     const QString tst_outValues(qTableName("tst_outValues", __FILE__));
 
-    if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) {
+    if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) )
         QSKIP( "Test requires prepared query support", SkipSingle );
-        return;
-    }
 
     QSqlQuery q( db );
 
@@ -755,10 +753,8 @@ void tst_QSqlQuery::outValuesDB2()
     QSqlDatabase db = QSqlDatabase::database( dbName );
     CHECK_DATABASE( db );
 
-    if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) {
+    if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) )
         QSKIP( "Test requires prepared query support", SkipSingle );
-        return;
-    }
 
     QSqlQuery q( db );
 
@@ -794,10 +790,8 @@ void tst_QSqlQuery::outValues()
     CHECK_DATABASE( db );
     const QString tst_outValues(qTableName("tst_outValues", __FILE__));
 
-    if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) {
+    if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) )
         QSKIP( "Test requires prepared query support", SkipSingle );
-        return;
-    }
 
     QSqlQuery q( db );
 
@@ -824,10 +818,8 @@ void tst_QSqlQuery::outValues()
                                 "    set @x = 42\n"
                                 "end\n" ) );
         QVERIFY( q.prepare( "{call " + tst_outValues + "(?)}" ) );
-    } else {
+    } else
         QSKIP( "Don't know how to create a stored procedure for this database server, please fix this test", SkipSingle );
-        return;
-    }
 
     q.addBindValue( 0, QSql::Out );
 
@@ -1600,12 +1592,10 @@ void tst_QSqlQuery::joins()
     if ( db.driverName().startsWith( "QOCI" )
             || db.driverName().startsWith( "QTDS" )
             || db.driverName().startsWith( "QODBC" )
-            || db.driverName().startsWith( "QIBASE" ) ) {
+            || db.driverName().startsWith( "QIBASE" ) )
         // Oracle broken beyond recognition - cannot outer join on more than
         // one table.
         QSKIP( "DBMS cannot understand standard SQL", SkipSingle );
-        return;
-    }
 
     QSqlQuery q( db );
 
@@ -2222,10 +2212,8 @@ void tst_QSqlQuery::bindWithDoubleColonCastOperator()
 
     // Only PostgreSQL support the double-colon cast operator
 
-    if ( !db.driverName().startsWith( "QPSQL" ) ) {
+    if ( !db.driverName().startsWith( "QPSQL" ) )
         QSKIP( "Test requires PostgreSQL", SkipSingle );
-        return;
-    }
 
     const QString tablename(qTableName( "bindtest", __FILE__ ));
 
@@ -2292,10 +2280,8 @@ void tst_QSqlQuery::createQueryOnClosedDatabase()
     if ( !db.driverName().startsWith( "QPSQL" )
             && !db.driverName().startsWith( "QOCI" )
             && !db.driverName().startsWith( "QMYSQL" )
-            && !db.driverName().startsWith( "QDB2" ) ) {
+            && !db.driverName().startsWith( "QDB2" ) )
         QSKIP( "Test is specific for PostgreSQL, Oracle, MySql and DB2", SkipSingle );
-        return;
-    }
 
     db.close();
 
@@ -2380,10 +2366,8 @@ void tst_QSqlQuery::sqlite_finish()
     QFETCH( QString, dbName );
     QSqlDatabase db = QSqlDatabase::database( dbName );
     CHECK_DATABASE( db );
-    if (db.driverName() != QLatin1String("QSQLITE")) {
+    if (db.driverName() != QLatin1String("QSQLITE"))
         QSKIP("Sqlite3 specific test", SkipSingle);
-        return;
-    }
 
     if ( db.databaseName().startsWith( ':' ) )
         QSKIP( "This test requires a database on the filesystem, not in-memory", SkipAll );
@@ -3214,10 +3198,8 @@ void tst_QSqlQuery::sqlite_constraint()
     QSqlDatabase db = QSqlDatabase::database( dbName );
     CHECK_DATABASE( db );
 
-    if (db.driverName() != QLatin1String("QSQLITE")) {
+    if (db.driverName() != QLatin1String("QSQLITE"))
         QSKIP("Sqlite3 specific test", SkipSingle);
-        return;
-    }
 
     QSqlQuery q(db);
     const QString trigger(qTableName("test_constraint", __FILE__));
index 2c5af13..c133b8e 100644 (file)
@@ -1449,10 +1449,9 @@ void tst_QSqlRelationalTableModel::psqlSchemaTest()
     QSqlDatabase db = QSqlDatabase::database(dbName);
     CHECK_DATABASE(db);
 
-    if(!tst_Databases::isPostgreSQL(db)) {
+    if(!tst_Databases::isPostgreSQL(db))
         QSKIP("Postgresql specific test", SkipSingle);
-        return;
-    }
+
     QSqlRelationalTableModel model(0, db);
     QSqlQuery q(db);
     QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373", __FILE__)));