summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqldatabase
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@nokia.com>2009-06-16 15:15:48 (GMT)
committerVolker Hilsheimer <volker.hilsheimer@nokia.com>2009-06-16 15:15:48 (GMT)
commite73e36a16bb51fa66bdccc780f177e2c4d5d8092 (patch)
tree12b6de8d0cb5c630a05f28686d4baabe474dbfda /tests/auto/qsqldatabase
parent237a3e690f290fd8ef8ef2a51459caa7fdc7bef1 (diff)
parentd4ea3957a535ac522bd29b0645e614e0ccd09f82 (diff)
downloadQt-e73e36a16bb51fa66bdccc780f177e2c4d5d8092.zip
Qt-e73e36a16bb51fa66bdccc780f177e2c4d5d8092.tar.gz
Qt-e73e36a16bb51fa66bdccc780f177e2c4d5d8092.tar.bz2
Merge license header changes from 4.5
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..77d1d5b 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_", "testuser", "Ee4Gabf6_", "" );
+// addDb( "QODBC", "DRIVER={FreeTDS};SERVER=bq-winserv2008-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433;UID=testuser;PWD=Ee4Gabf6_", "testuser", "Ee4Gabf6_", "" );
+// 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 d8c21ac..13ec263 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)) {