summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp')
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 1a100ce706..38f561dbaa 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -1384,7 +1384,9 @@ void tst_QSqlQuery::isNull()
QVERIFY_SQL(q, exec("select id, t_varchar from " + qTableName("qtest_null", __FILE__, db) + " order by id"));
QVERIFY( q.next() );
QVERIFY( !q.isNull( 0 ) );
+ QVERIFY(!q.isNull("id"));
QVERIFY( q.isNull( 1 ) );
+ QVERIFY(q.isNull("t_varchar"));
QCOMPARE( q.value( 0 ).toInt(), 0 );
QCOMPARE( q.value( 1 ).toString(), QString() );
QVERIFY( !q.value( 0 ).isNull() );
@@ -1392,7 +1394,13 @@ void tst_QSqlQuery::isNull()
QVERIFY( q.next() );
QVERIFY( !q.isNull( 0 ) );
+ QVERIFY(!q.isNull("id"));
QVERIFY( !q.isNull( 1 ) );
+ QVERIFY(!q.isNull("t_varchar"));
+
+ // For a non existent field, it should be returning true.
+ QVERIFY(q.isNull(2));
+ QVERIFY(q.isNull("unknown"));
}
/*! TDS specific BIT field test */
@@ -2849,7 +2857,7 @@ void tst_QSqlQuery::task_250026()
QVERIFY_SQL( q, next() );
QCOMPARE( q.value( 0 ).toString().length(), data258.length() );
QVERIFY_SQL( q, next() );
- QCOMPARE( q.value( 0 ).toString().length(), data1026.length() );
+ QCOMPARE( q.value( 0 ).toString().length(), data1026.length() );
}
void tst_QSqlQuery::task_205701()