summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqldatabase
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-06-29 12:25:09 (GMT)
committeraxis <qt-info@nokia.com>2009-06-29 12:25:09 (GMT)
commit1a8c89e9eaec05e9f38eae4fbc007d8344015de3 (patch)
treed87e517cfab9443926841b3ef92ca715a717f54a /tests/auto/qsqldatabase
parent78166d5235a5045fdc887febe01d789cac333bb3 (diff)
parentb6171cfbe3b1453a2c46f78db0df4819e4e5e54f (diff)
downloadQt-1a8c89e9eaec05e9f38eae4fbc007d8344015de3.zip
Qt-1a8c89e9eaec05e9f38eae4fbc007d8344015de3.tar.gz
Qt-1a8c89e9eaec05e9f38eae4fbc007d8344015de3.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: .gitignore src/gui/dialogs/qfiledialog_p.h src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontdatabase.cpp tests/auto/network-settings.h tests/auto/qitemdelegate/tst_qitemdelegate.cpp
Diffstat (limited to 'tests/auto/qsqldatabase')
-rw-r--r--tests/auto/qsqldatabase/tst_databases.h31
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp7
2 files changed, 22 insertions, 16 deletions
diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h
index ef51285..bd51b97 100644
--- a/tests/auto/qsqldatabase/tst_databases.h
+++ b/tests/auto/qsqldatabase/tst_databases.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -105,7 +105,11 @@ inline static QString qTableName( const QString& prefix, QSqlDriver* driver = 0
inline static bool testWhiteSpaceNames( const QString &name )
{
- return name != QLatin1String("QTDS7");
+/* return name.startsWith( "QPSQL" )
+ || name.startsWith( "QODBC" )
+ || name.startsWith( "QSQLITE" )
+ || name.startsWith( "QMYSQL" );*/
+ return name != QLatin1String("QSQLITE2");
}
inline static QString toHex( const QString& binary )
@@ -207,7 +211,7 @@ public:
// This requires a local ODBC data source to be configured( pointing to a MySql database )
// addDb( "QODBC", "mysqlodbc", "troll", "trond" );
// addDb( "QODBC", "SqlServer", "troll", "trond" );
-// addDb( "QTDS7", "testdb", "troll", "trondk", "horsehead" );
+// addDb( "QTDS7", "testdb", "troll", "trondk", "horsehead.nokia.troll.no" );
// addDb( "QODBC", "silencetestdb", "troll", "trond", "silence" );
// addDb( "QODBC", "horseheadtestdb", "troll", "trondk", "horsehead" );
@@ -247,7 +251,10 @@ public:
// addDb( "QODBC", "DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql5-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" );
// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=horsehead.nokia.troll.no;DATABASE=testdb;PORT=4101;UID=troll;PWD=trondk", "troll", "trondk", "" );
// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=silence.nokia.troll.no;DATABASE=testdb;PORT=2392;UID=troll;PWD=trond", "troll", "trond", "" );
-
+// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=bq-winserv2003-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433;UID=testuser;PWD=Ee4Gabf6_;TDS_Version=8.0", "", "", "" );
+// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=bq-winserv2008-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433;UID=testuser;PWD=Ee4Gabf6_;TDS_Version=8.0", "", "", "" );
+// addDb( "QTDS7", "testdb", "testuser", "Ee4Gabf6_", "bq-winserv2003" );
+// addDb( "QTDS7", "testdb", "testuser", "Ee4Gabf6_", "bq-winserv2008" );
}
void open()
@@ -313,22 +320,16 @@ public:
QSqlQuery q( db );
QStringList dbtables=db.tables();
- foreach(const QString &tableName, tableNames)
- {
+ foreach(const QString &tableName, tableNames) {
wasDropped = true;
- QString table=tableName;
- if ( db.driver()->isIdentifierEscaped(table, QSqlDriver::TableName))
- table = db.driver()->stripDelimiters(table, QSqlDriver::TableName);
-
foreach(const QString dbtablesName, dbtables) {
- if(dbtablesName.toUpper() == table.toUpper()) {
+ if(dbtablesName.toUpper() == tableName.toUpper()) {
dbtables.removeAll(dbtablesName);
wasDropped = q.exec("drop table " + db.driver()->escapeIdentifier( dbtablesName, QSqlDriver::TableName ));
if(!wasDropped)
wasDropped = q.exec("drop table " + dbtablesName);
}
}
-
if ( !wasDropped )
qWarning() << dbToString(db) << "unable to drop table" << tableName << ':' << q.lastError().text() << "tables:" << dbtables;
}
@@ -427,7 +428,9 @@ public:
{
return db.databaseName().contains( "sql server", Qt::CaseInsensitive )
|| db.databaseName().contains( "sqlserver", Qt::CaseInsensitive )
- || db.databaseName().contains( "sql native client", Qt::CaseInsensitive );
+ || db.databaseName().contains( "sql native client", Qt::CaseInsensitive )
+ || db.databaseName().contains( "bq-winserv", Qt::CaseInsensitive )
+ || db.hostName().contains( "bq-winserv", Qt::CaseInsensitive );
}
static bool isMSAccess( QSqlDatabase db )
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 4fa3dc4..a286fb9 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -296,6 +296,9 @@ void tst_QSqlDatabase::createTestTables(QSqlDatabase db)
// ### stupid workaround until we find a way to hardcode this
// in the MySQL server startup script
q.exec("set table_type=innodb");
+ if (tst_Databases::isSqlServer(db)) {
+ QVERIFY_SQL(q, exec("SET ANSI_DEFAULTS ON"));
+ }
// please never ever change this table; otherwise fix all tests ;)
if (tst_Databases::isMSAccess(db)) {