Invert a condition to save a lot of indentation
Simply if (!condition) QSKIP(...) instead of having a long block depend on the condition with the QSKIP() in its else block (which should have had braces, as it was). While dedenting the code block, tidied up spacing: only include blank lines where they break up the code into blocks that go together, don't leave spaces just inside parentheses. Change-Id: I0196150088be88a7c6073b997a315b8f14d5f392 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
b3f67d2ba3
commit
426f032119
@ -494,7 +494,9 @@ void tst_QSqlQuery::char1SelectUnicode()
|
||||
if (dbType == QSqlDriver::DB2)
|
||||
QSKIP("Needs someone with more Unicode knowledge than I have to fix");
|
||||
|
||||
if ( db.driver()->hasFeature( QSqlDriver::Unicode ) ) {
|
||||
if (!db.driver()->hasFeature(QSqlDriver::Unicode))
|
||||
QSKIP("Database not unicode capable");
|
||||
|
||||
QString uniStr(QChar(0x0915)); // DEVANAGARI LETTER KA
|
||||
QSqlQuery q(db);
|
||||
QLatin1String createQuery;
|
||||
@ -513,8 +515,7 @@ void tst_QSqlQuery::char1SelectUnicode()
|
||||
createQuery = QLatin1String("create table %1 (id char(1) character set unicode_fss)");
|
||||
break;
|
||||
case QSqlDriver::MySqlServer:
|
||||
createQuery =
|
||||
QLatin1String("create table %1 (id char(1)) default character set 'utf8'");
|
||||
createQuery = QLatin1String("create table %1 (id char(1)) default character set 'utf8'");
|
||||
break;
|
||||
default:
|
||||
createQuery = QLatin1String("create table %1 (id char(1))");
|
||||
@ -535,9 +536,6 @@ void tst_QSqlQuery::char1SelectUnicode()
|
||||
QCOMPARE(q.value(0).toString().trimmed(), uniStr);
|
||||
QVERIFY(!q.next());
|
||||
}
|
||||
else
|
||||
QSKIP( "Database not unicode capable");
|
||||
}
|
||||
|
||||
void tst_QSqlQuery::oraRowId()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user