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>
This commit is contained in:
Jason McDonald 2011-10-07 10:55:06 +10:00 committed by Qt by Nokia
parent 924d810dbd
commit b4de0b1721
7 changed files with 16 additions and 44 deletions

View File

@ -253,10 +253,8 @@ void tst_QFontDatabase::addAppFont()
QCOMPARE(fontDbChangedSpy.count(), 1); QCOMPARE(fontDbChangedSpy.count(), 1);
// addApplicationFont is supported on Mac, don't skip the test if it breaks. // addApplicationFont is supported on Mac, don't skip the test if it breaks.
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
if (id == -1) { if (id == -1)
QSKIP("Skip the test since app fonts are not supported on this system", SkipSingle); QSKIP("Skip the test since app fonts are not supported on this system", SkipSingle);
return;
}
#endif #endif
const QStringList addedFamilies = QFontDatabase::applicationFontFamilies(id); const QStringList addedFamilies = QFontDatabase::applicationFontFamilies(id);

View File

@ -423,10 +423,8 @@ void tst_QGraphicsEffect::opacity()
void tst_QGraphicsEffect::grayscale() void tst_QGraphicsEffect::grayscale()
{ {
if (qApp->desktop()->depth() < 24) { if (qApp->desktop()->depth() < 24)
QSKIP("Test only works on 32 bit displays", SkipAll); QSKIP("Test only works on 32 bit displays", SkipAll);
return;
}
QGraphicsScene scene(0, 0, 100, 100); QGraphicsScene scene(0, 0, 100, 100);
@ -472,10 +470,8 @@ void tst_QGraphicsEffect::grayscale()
void tst_QGraphicsEffect::colorize() void tst_QGraphicsEffect::colorize()
{ {
if (qApp->desktop()->depth() < 24) { if (qApp->desktop()->depth() < 24)
QSKIP("Test only works on 32 bit displays", SkipAll); QSKIP("Test only works on 32 bit displays", SkipAll);
return;
}
QGraphicsScene scene(0, 0, 100, 100); QGraphicsScene scene(0, 0, 100, 100);

View File

@ -10519,7 +10519,6 @@ void tst_QGraphicsItem::updateMicroFocus()
{ {
#if defined Q_OS_WIN || defined Q_OS_MAC #if defined Q_OS_WIN || defined Q_OS_MAC
QSKIP("QTBUG-9578", SkipAll); QSKIP("QTBUG-9578", SkipAll);
return;
#endif #endif
QGraphicsScene scene; QGraphicsScene scene;
QWidget parent; QWidget parent;

View File

@ -339,10 +339,8 @@ void tst_QPlainTextEdit::paragSeparatorOnPlaintextAppend()
#ifndef QT_NO_CLIPBOARD #ifndef QT_NO_CLIPBOARD
void tst_QPlainTextEdit::selectAllSetsNotSelection() void tst_QPlainTextEdit::selectAllSetsNotSelection()
{ {
if (!QApplication::clipboard()->supportsSelection()) { if (!QApplication::clipboard()->supportsSelection())
QSKIP("Test only relevant for systems with selection", SkipAll); QSKIP("Test only relevant for systems with selection", SkipAll);
return;
}
QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection); QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection);
QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar")); QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar"));

View File

@ -71,7 +71,7 @@
#define QFAIL_SQL(q, stmt) QVERIFY2(!(q).stmt, tst_Databases::printError((q).lastError(), db)) #define QFAIL_SQL(q, stmt) QVERIFY2(!(q).stmt, tst_Databases::printError((q).lastError(), db))
#define DBMS_SPECIFIC(db, driver) \ #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 // ### use QSystem::hostName if it is integrated in qtest/main
static QString qGetHostName() static QString qGetHostName()

View File

@ -571,10 +571,8 @@ void tst_QSqlQuery::oraOutValues()
CHECK_DATABASE( db ); CHECK_DATABASE( db );
const QString tst_outValues(qTableName("tst_outValues", __FILE__)); 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 ); QSKIP( "Test requires prepared query support", SkipSingle );
return;
}
QSqlQuery q( db ); QSqlQuery q( db );
@ -755,10 +753,8 @@ void tst_QSqlQuery::outValuesDB2()
QSqlDatabase db = QSqlDatabase::database( dbName ); QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db ); CHECK_DATABASE( db );
if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) { if ( !db.driver()->hasFeature( QSqlDriver::PreparedQueries ) )
QSKIP( "Test requires prepared query support", SkipSingle ); QSKIP( "Test requires prepared query support", SkipSingle );
return;
}
QSqlQuery q( db ); QSqlQuery q( db );
@ -794,10 +790,8 @@ void tst_QSqlQuery::outValues()
CHECK_DATABASE( db ); CHECK_DATABASE( db );
const QString tst_outValues(qTableName("tst_outValues", __FILE__)); 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 ); QSKIP( "Test requires prepared query support", SkipSingle );
return;
}
QSqlQuery q( db ); QSqlQuery q( db );
@ -824,10 +818,8 @@ void tst_QSqlQuery::outValues()
" set @x = 42\n" " set @x = 42\n"
"end\n" ) ); "end\n" ) );
QVERIFY( q.prepare( "{call " + tst_outValues + "(?)}" ) ); 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 ); 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 ); q.addBindValue( 0, QSql::Out );
@ -1600,12 +1592,10 @@ void tst_QSqlQuery::joins()
if ( db.driverName().startsWith( "QOCI" ) if ( db.driverName().startsWith( "QOCI" )
|| db.driverName().startsWith( "QTDS" ) || db.driverName().startsWith( "QTDS" )
|| db.driverName().startsWith( "QODBC" ) || db.driverName().startsWith( "QODBC" )
|| db.driverName().startsWith( "QIBASE" ) ) { || db.driverName().startsWith( "QIBASE" ) )
// Oracle broken beyond recognition - cannot outer join on more than // Oracle broken beyond recognition - cannot outer join on more than
// one table. // one table.
QSKIP( "DBMS cannot understand standard SQL", SkipSingle ); QSKIP( "DBMS cannot understand standard SQL", SkipSingle );
return;
}
QSqlQuery q( db ); QSqlQuery q( db );
@ -2222,10 +2212,8 @@ void tst_QSqlQuery::bindWithDoubleColonCastOperator()
// Only PostgreSQL support the double-colon cast operator // Only PostgreSQL support the double-colon cast operator
if ( !db.driverName().startsWith( "QPSQL" ) ) { if ( !db.driverName().startsWith( "QPSQL" ) )
QSKIP( "Test requires PostgreSQL", SkipSingle ); QSKIP( "Test requires PostgreSQL", SkipSingle );
return;
}
const QString tablename(qTableName( "bindtest", __FILE__ )); const QString tablename(qTableName( "bindtest", __FILE__ ));
@ -2292,10 +2280,8 @@ void tst_QSqlQuery::createQueryOnClosedDatabase()
if ( !db.driverName().startsWith( "QPSQL" ) if ( !db.driverName().startsWith( "QPSQL" )
&& !db.driverName().startsWith( "QOCI" ) && !db.driverName().startsWith( "QOCI" )
&& !db.driverName().startsWith( "QMYSQL" ) && !db.driverName().startsWith( "QMYSQL" )
&& !db.driverName().startsWith( "QDB2" ) ) { && !db.driverName().startsWith( "QDB2" ) )
QSKIP( "Test is specific for PostgreSQL, Oracle, MySql and DB2", SkipSingle ); QSKIP( "Test is specific for PostgreSQL, Oracle, MySql and DB2", SkipSingle );
return;
}
db.close(); db.close();
@ -2380,10 +2366,8 @@ void tst_QSqlQuery::sqlite_finish()
QFETCH( QString, dbName ); QFETCH( QString, dbName );
QSqlDatabase db = QSqlDatabase::database( dbName ); QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db ); CHECK_DATABASE( db );
if (db.driverName() != QLatin1String("QSQLITE")) { if (db.driverName() != QLatin1String("QSQLITE"))
QSKIP("Sqlite3 specific test", SkipSingle); QSKIP("Sqlite3 specific test", SkipSingle);
return;
}
if ( db.databaseName().startsWith( ':' ) ) if ( db.databaseName().startsWith( ':' ) )
QSKIP( "This test requires a database on the filesystem, not in-memory", SkipAll ); 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 ); QSqlDatabase db = QSqlDatabase::database( dbName );
CHECK_DATABASE( db ); CHECK_DATABASE( db );
if (db.driverName() != QLatin1String("QSQLITE")) { if (db.driverName() != QLatin1String("QSQLITE"))
QSKIP("Sqlite3 specific test", SkipSingle); QSKIP("Sqlite3 specific test", SkipSingle);
return;
}
QSqlQuery q(db); QSqlQuery q(db);
const QString trigger(qTableName("test_constraint", __FILE__)); const QString trigger(qTableName("test_constraint", __FILE__));

View File

@ -1449,10 +1449,9 @@ void tst_QSqlRelationalTableModel::psqlSchemaTest()
QSqlDatabase db = QSqlDatabase::database(dbName); QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db); CHECK_DATABASE(db);
if(!tst_Databases::isPostgreSQL(db)) { if(!tst_Databases::isPostgreSQL(db))
QSKIP("Postgresql specific test", SkipSingle); QSKIP("Postgresql specific test", SkipSingle);
return;
}
QSqlRelationalTableModel model(0, db); QSqlRelationalTableModel model(0, db);
QSqlQuery q(db); QSqlQuery q(db);
QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373", __FILE__))); QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373", __FILE__)));