diff options
Diffstat (limited to 'tests/auto/sql/kernel/qsqlquery')
-rw-r--r-- | tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index f1c4333ccd..078a629df5 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -962,14 +957,14 @@ void tst_QSqlQuery::value() if (dbType == QSqlDriver::Interbase) QVERIFY( q.value( 1 ).toString().startsWith( "VarChar" + QString::number( i ) ) ); - else if ( q.value( 1 ).toString().right( 1 ) == " " ) + else if ( q.value( 1 ).toString().endsWith(QLatin1Char(' '))) QCOMPARE( q.value( 1 ).toString(), ( "VarChar" + QString::number( i ) + " " ) ); else QCOMPARE( q.value( 1 ).toString(), ( "VarChar" + QString::number( i ) ) ); if (dbType == QSqlDriver::Interbase) QVERIFY( q.value( 2 ).toString().startsWith( "Char" + QString::number( i ) ) ); - else if ( q.value( 2 ).toString().right( 1 ) != " " ) + else if (!q.value( 2 ).toString().endsWith(QLatin1Char(' '))) QCOMPARE( q.value( 2 ).toString(), ( "Char" + QString::number( i ) ) ); else QCOMPARE( q.value( 2 ).toString(), ( "Char" + QString::number( i ) + " " ) ); @@ -3130,7 +3125,7 @@ void tst_QSqlQuery::sqlServerReturn0() "SELECT * FROM "+tableName+" WHERE ID = 2 " "RETURN 0")); - QVERIFY_SQL(q, exec("{CALL "+procName+"}")); + QVERIFY_SQL(q, exec("{CALL " + procName + QLatin1Char('}'))); QVERIFY_SQL(q, next()); } @@ -3147,7 +3142,7 @@ void tst_QSqlQuery::QTBUG_551() TYPE IntType IS TABLE OF INTEGER INDEX BY BINARY_INTEGER;\n\ TYPE VCType IS TABLE OF VARCHAR2(60) INDEX BY BINARY_INTEGER;\n\ PROCEDURE P (Inp IN IntType, Outp OUT VCType);\n\ - END "+pkgname+";")); + END "+ pkgname + QLatin1Char(';'))); QVERIFY_SQL(q, exec("CREATE OR REPLACE PACKAGE BODY "+pkgname+" IS\n\ PROCEDURE P (Inp IN IntType, Outp OUT VCType)\n\ @@ -3157,7 +3152,7 @@ void tst_QSqlQuery::QTBUG_551() Outp(2) := '2. Value is ' ||TO_CHAR(Inp(2));\n\ Outp(3) := '3. Value is ' ||TO_CHAR(Inp(3));\n\ END p;\n\ - END "+pkgname+";")); + END " + pkgname + QLatin1Char(';'))); QVariantList inLst, outLst, res_outLst; @@ -3295,7 +3290,7 @@ void tst_QSqlQuery::QTBUG_6421() QVERIFY_SQL(q, exec("create index INDEX2 on "+tableName+" (COL2 desc)")); QVERIFY_SQL(q, exec("create index INDEX3 on "+tableName+" (COL3 desc)")); q.setForwardOnly(true); - QVERIFY_SQL(q, exec("select COLUMN_EXPRESSION from ALL_IND_EXPRESSIONS where TABLE_NAME='"+tableName+"'")); + QVERIFY_SQL(q, exec("select COLUMN_EXPRESSION from ALL_IND_EXPRESSIONS where TABLE_NAME='" + tableName + QLatin1Char('\''))); QVERIFY_SQL(q, next()); QCOMPARE(q.value(0).toString(), QLatin1String("\"COL1\"")); QVERIFY_SQL(q, next()); @@ -3323,7 +3318,7 @@ void tst_QSqlQuery::QTBUG_6618() "begin\n" " raiserror('" + errorString + "', 16, 1)\n" "end\n" )); - q.exec("{call " + qTableName("tst_raiseError", __FILE__, db) + "}"); + q.exec("{call " + qTableName("tst_raiseError", __FILE__, db) + QLatin1Char('}')); QVERIFY(q.lastError().text().contains(errorString)); } @@ -3415,7 +3410,7 @@ void tst_QSqlQuery::QTBUG_21884() QStringList stList; QString tableName(qTableName("bug21884", __FILE__, db)); stList << "create table " + tableName + "(id integer primary key, note string)"; - stList << "select * from " + tableName + ";"; + stList << "select * from " + tableName + QLatin1Char(';'); stList << "select * from " + tableName + "; \t\n\r"; stList << "drop table " + tableName; @@ -4005,7 +4000,7 @@ void runIntegralTypesMysqlTest(QSqlDatabase &db, const QString &tableName, const { QSqlQuery q(db); QVERIFY_SQL(q, exec("DROP TABLE IF EXISTS " + tableName)); - QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id " + type + ")")); + QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id " + type + ')')); const int steps = 20; const T increment = max / steps - min / steps; @@ -4022,7 +4017,7 @@ void runIntegralTypesMysqlTest(QSqlDatabase &db, const QString &tableName, const q.bindValue(0, v); QVERIFY_SQL(q, exec()); } else { - QVERIFY_SQL(q, exec("INSERT INTO " + tableName + " (id) VALUES (" + QString::number(v) + ")")); + QVERIFY_SQL(q, exec("INSERT INTO " + tableName + " (id) VALUES (" + QString::number(v) + QLatin1Char(')'))); } values[i] = v; v += increment; |