summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTasuku Suzuki <stasuku@gmail.com>2013-06-17 10:44:09 +0900
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-01 23:14:15 +0100
commitc3c424b384b06354116e232bf4055514f9b205ce (patch)
treeae76f4b7881413ea3093440a6d1cbfe9e3477c19 /tests
parentded6a7081b8b34906ee875e68e2048570c2e98d8 (diff)
QSqlQuery::isNull string overload
Introduce isNull overload to take field name as a parameter. This is corresponding to the commit 7e6e1412348fb8d8df844d821ee80d6d3de69517 Change-Id: I122f79707d26eaa09c2f38dc31aeee1dac7de33b Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 9098d5b101..b74e02bcc4 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,10 +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 */