diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-10-07 10:55:06 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-07 04:30:30 +0200 |
commit | b4de0b17211c58fdecece48d065e8b2dac53711c (patch) | |
tree | 2cefda5796193a770b08e2d4ff42da8c1a96b8f7 | |
parent | 924d810dbdcd5b5b0fa860922b2487ea9062d002 (diff) |
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 <rohan.mcgovern@nokia.com>
7 files changed, 16 insertions, 44 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp index fe37c77dd5..af6d822666 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 334406272e..f69b66534a 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 c6babb8dd0..f7bdf67657 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 432baed892..d847f295e0 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 497f5a49df..9515d01049 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 dc0c86d6f4..5546cefd09 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 2c5af13c0c..c133b8efa0 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__))); |