summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorDerick Hawcroft <derick.hawcroft@nokia.com>2009-07-07 23:29:33 (GMT)
committerDerick Hawcroft <derick.hawcroft@nokia.com>2009-07-07 23:31:41 (GMT)
commitc2198e1c7884b835807e45ff53c3c54e86900211 (patch)
treeac0e95d2374fd79355d855d23af869695ef1275c /tests/auto
parente5049ecc4590896a75dedcb098da9e991e1764ee (diff)
downloadQt-c2198e1c7884b835807e45ff53c3c54e86900211.zip
Qt-c2198e1c7884b835807e45ff53c3c54e86900211.tar.gz
Qt-c2198e1c7884b835807e45ff53c3c54e86900211.tar.bz2
Auto test for task 233829
- postgreSQL specific autotest. Task-number:233829
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index ed19e91..4b41eaf 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -188,6 +188,9 @@ private slots:
void task_205701_data() { generic_data("QMYSQL"); }
void task_205701();
+ void task_233829_data() { generic_data(); }
+ void task_233829();
+
private:
// returns all database connections
@@ -301,7 +304,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
tablenames << qTableName( "qtest_lockedtable" );
tablenames << qTableName( "Planet" );
-
+
tablenames << qTableName( "task_250026" );
tst_Databases::safeDropTables( db, tablenames );
@@ -2814,5 +2817,30 @@ void tst_QSqlQuery::task_234422()
#endif
+void tst_QSqlQuery::task_233829()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database( dbName );
+ CHECK_DATABASE( db );
+
+ if (!db.driverName().startsWith( "QPSQL" )) {
+ QSKIP( "This is a PostgreSQL specific test", SkipSingle );
+ }
+
+ QSqlQuery q( db );
+ QString tableName = qTableName("task_233829");
+ q.exec("DROP TABLE " + tableName);
+ QVERIFY_SQL(q,exec("CREATE TABLE " + tableName + " (dbl1 double precision,dbl2 double precision) without oids;"));
+
+ QString queryString("INSERT INTO " + tableName +"(dbl1, dbl2) VALUES(?,?)");
+
+ double k = 0.0;
+ QVERIFY_SQL(q,prepare(queryString));
+ q.bindValue(0,0.0 / k); // nan
+ q.bindValue(1,0.0 / k); // nan
+ QVERIFY_SQL(q,exec());
+ q.exec("DROP TABLE " + tableName);
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"