diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2012-01-09 18:49:04 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-03 06:47:05 (GMT) |
commit | 687344ec72d2c36786a031f9c44da6df3f8f2110 (patch) | |
tree | eb9385407399b7e70faf56f7c8eef5fdd9fe1f48 /tests/auto/qsqlquery | |
parent | bf4ff951186bf717e911e759a9c6972d24c8fa59 (diff) | |
download | Qt-687344ec72d2c36786a031f9c44da6df3f8f2110.zip Qt-687344ec72d2c36786a031f9c44da6df3f8f2110.tar.gz Qt-687344ec72d2c36786a031f9c44da6df3f8f2110.tar.bz2 |
test: Split `qsqlquery' unit and benchmark test
Moving benchmark test from 'tests/auto' to 'tests/benchmarks'.
Also removing 'qttest_p4' usage while we are at it.
- void benchmark();
was moved to 'tests/benchmarks/sql/kernel/qsqlquery'
Change-Id: Icbe88fecdfe24a7754079451f635f9c19b3d6683
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/qsqlquery')
-rw-r--r-- | tests/auto/qsqlquery/qsqlquery.pro | 7 | ||||
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 35 |
2 files changed, 4 insertions, 38 deletions
diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro index fbcc998..7acc040 100644 --- a/tests/auto/qsqlquery/qsqlquery.pro +++ b/tests/auto/qsqlquery/qsqlquery.pro @@ -1,7 +1,8 @@ -load(qttest_p4) -SOURCES += tst_qsqlquery.cpp +CONFIG += testcase -QT = core sql +TARGET = tst_qsqlquery +QT = core sql testlib +SOURCES += tst_qsqlquery.cpp !wince*:win32:LIBS += -lws2_32 diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 482b70f..7d2c547 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -219,11 +219,6 @@ private slots: void sqlite_constraint_data() { generic_data("QSQLITE"); } void sqlite_constraint(); -#if 0 - void benchmark_data() { generic_data(); } - void benchmark(); -#endif - void sqlite_real_data() { generic_data("QSQLITE"); } void sqlite_real(); @@ -3283,36 +3278,6 @@ void tst_QSqlQuery::sqlite_constraint() QCOMPARE(q.lastError().databaseText(), QLatin1String("Raised Abort successfully")); } -#if 0 -void tst_QSqlQuery::benchmark() -{ - QFETCH( QString, dbName ); - QSqlDatabase db = QSqlDatabase::database( dbName ); - CHECK_DATABASE( db ); - if ( tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 ) - QSKIP( "Test requires MySQL >= 5.0", SkipSingle ); - - QSqlQuery q(db); - const QString tableName(qTableName("benchmark", __FILE__)); - - tst_Databases::safeDropTable( db, tableName ); - - QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(\n" - "MainKey INT NOT NULL,\n" - "OtherTextCol VARCHAR(45) NOT NULL,\n" - "PRIMARY KEY(`MainKey`))")); - - int i=1; - - QBENCHMARK { - QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" VALUES("+QString::number(i)+", \"Value"+QString::number(i)+"\")")); - i++; - } - - tst_Databases::safeDropTable( db, tableName ); -} -#endif - void tst_QSqlQuery::sqlite_real() { QFETCH(QString, dbName); |