From 831d2742b7c41924f052acd81620e8bfc58afde7 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 1 Apr 2009 14:09:00 +1000 Subject: DB Autotest cleanup Make db autotest data set generation more consistent, slightly faster. Also, add ability to easily generate a set of a single databases entries worth of criteria to test. --- tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'tests/auto/q3sqlcursor') diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp index c06485d36c..2d9118642b 100644 --- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp +++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp @@ -89,7 +89,7 @@ private slots: void unicode(); void precision_data() { generic_data(); } void precision(); - void insertORA_data(); + void insertORA_data() { generic_data("QOCI"); } void insertORA(); void batchInsert_data() { generic_data(); } void batchInsert(); @@ -101,7 +101,7 @@ private slots: void insertFieldNameContainsWS(); // For task 117996 private: - void generic_data(); + void generic_data(const QString &engine=QString()); void createTestTables( QSqlDatabase db ); void dropTestTables( QSqlDatabase db ); void populateTestTables( QSqlDatabase db ); @@ -117,10 +117,14 @@ tst_Q3SqlCursor::~tst_Q3SqlCursor() { } -void tst_Q3SqlCursor::generic_data() +void tst_Q3SqlCursor::generic_data(const QString &engine) { - if ( dbs.fillTestTable() == 0 ) - QSKIP( "No database drivers are available in this Qt configuration", SkipAll ); + if ( dbs.fillTestTable(engine) == 0 ) { + if(engine.isEmpty()) + QSKIP( "No database drivers are available in this Qt configuration", SkipAll ); + else + QSKIP( (QString("No database drivers of type %1 are available in this Qt configuration").arg(engine)).toLocal8Bit(), SkipAll ); + } } void tst_Q3SqlCursor::createTestTables( QSqlDatabase db ) @@ -429,12 +433,6 @@ static QString dumpUtf8( const QString& str ) return res; } -void tst_Q3SqlCursor::insertORA_data() -{ - if ( dbs.fillTestTable( "QOCI" ) == 0 ) - QSKIP( "No Oracle database drivers are available in this Qt configuration", SkipAll ); -} - void tst_Q3SqlCursor::insertORA() { QFETCH( QString, dbName ); -- cgit v1.2.3