From: Jason McDonald Date: Fri, 7 Oct 2011 00:55:06 +0000 (+1000) Subject: No need to return after QSKIP. X-Git-Tag: qt-v5.0.0-alpha1~3304 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4de0b17211c58fdecece48d065e8b2dac53711c;p=profile%2Fivi%2Fqtbase.git No need to return after QSKIP. 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 --- diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index fe37c77..af6d822 100644 --- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp @@ -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); diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 3344062..f69b665 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -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); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index c6babb8..f7bdf67 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -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; diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp index 432baed..d847f29 100644 --- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp @@ -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")); diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h index 497f5a4..9515d01 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h +++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h @@ -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() diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index dc0c86d..5546cef 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -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__)); diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index 2c5af13..c133b8e 100644 --- a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -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__)));