summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBill King <bking@trolltech.com>2009-07-06 02:30:32 (GMT)
committerBill King <bking@trolltech.com>2009-07-06 02:30:32 (GMT)
commit8fa9744b1b18f97b98fc434b8b8057434118e3db (patch)
treec0a3bd86630ccfb18ea2925661341d039e01ae4b /tests
parent012d133b2093e0949872263297c23277d0ce30d9 (diff)
downloadQt-8fa9744b1b18f97b98fc434b8b8057434118e3db.zip
Qt-8fa9744b1b18f97b98fc434b8b8057434118e3db.tar.gz
Qt-8fa9744b1b18f97b98fc434b8b8057434118e3db.tar.bz2
Fix precision autotest for SqlServer
Sql Server can't count. Reduce the expected length of string when we're on sql server.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
index 91533dd..812c862 100644
--- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
+++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
@@ -155,11 +155,9 @@ void tst_Q3SqlCursor::createTestTables( QSqlDatabase db )
}
if (tst_Databases::isMSAccess(db)) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 number)"));
- } else if (db.driverName().startsWith("QIBASE")) {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))"));
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 number)"));
} else {
- QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))"));
+ QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))"));
}
}
@@ -555,7 +553,7 @@ void tst_Q3SqlCursor::unicode()
void tst_Q3SqlCursor::precision()
{
- static const QString precStr = "1.23456789012345";
+ static const QString precStr = QLatin1String("1.23456789012345");
static const double precDbl = 2.23456789012345;
QFETCH( QString, dbName );
@@ -574,7 +572,10 @@ void tst_Q3SqlCursor::precision()
QVERIFY_SQL(cur, select());
QVERIFY( cur.next() );
- QCOMPARE( cur.value( 0 ).asString(), QString( precStr ) );
+ if(!tst_Databases::isSqlServer(db))
+ QCOMPARE( cur.value( 0 ).asString(), precStr );
+ else
+ QCOMPARE( cur.value( 0 ).asString(), precStr.left(precStr.size()-1) );
QVERIFY( cur.next() );
QCOMPARE( cur.value( 0 ).asDouble(), precDbl );
}