summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql
diff options
context:
space:
mode:
authorTatiana Borisova <tatiana.borisova@qt.io>2023-04-13 19:53:37 +0200
committerTatiana Borisova <tatiana.borisova@qt.io>2023-04-14 10:34:45 +0000
commit42d3e242faeada60037060f1b61f2adad40b9df7 (patch)
tree1bdd1bb193e36c49236b8589667842de6b864319 /tests/auto/sql
parent9618427ee5a42e1d120fa475aa6e2408a738915a (diff)
Put timezone related code under ifdef
In case FEATURE_timezone=OFF auto-tests should still be built successfully Change-Id: I0226a7d7781a412bf9e9935c2cf1a48b1ce427b5 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'tests/auto/sql')
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 26003a8916..205b3617dd 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -4805,19 +4805,22 @@ void tst_QSqlQuery::ibaseDateTimeWithTZ_data()
QTest::addColumn<QList<QDateTime> >("initialDateTimes");
QTest::addColumn<QList<QDateTime> >("expectedDateTimes");
+#if QT_CONFIG(timezone)
const QTimeZone afterUTCTimeZone("Asia/Hong_Kong");
const QTimeZone beforeUTCTimeZone("America/Los_Angeles");
- const QTimeZone utcTimeZone("UTC");
-
const QDateTime dtWithAfterTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), afterUTCTimeZone);
const QDateTime dtWithBeforeTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), beforeUTCTimeZone);
+ const QTimeZone utcTimeZone("UTC");
const QDateTime dtWithUTCTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), utcTimeZone);
+#endif // QT_CONFIG(timezone)
const QDateTime dtLocalTZ(QDateTime::currentDateTime());
const QList<QDateTime> dateTimes = {
+#if QT_CONFIG(timezone)
dtWithAfterTZ,
dtWithBeforeTZ,
dtWithUTCTZ,
+#endif // QT_CONFIG(timezone)
dtLocalTZ
};
@@ -5018,7 +5021,7 @@ void tst_QSqlQuery::ibaseTimeStampTzArray()
"create table %1 (timeStampData timestamp with time zone[0:4])").arg(ts.tableName())));
QVERIFY_SQL(qry, prepare(QLatin1String("insert into %1 (timeStampData)"
" values(?)").arg(ts.tableName())));
-
+#if QT_CONFIG(timezone)
const QDateTime dtWithAfterTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), QTimeZone("Asia/Hong_Kong"));
const QDateTime dtWithBeforeTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), QTimeZone("America/Los_Angeles"));
const QDateTime dtWithUTCTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), QTimeZone("UTC"));
@@ -5036,6 +5039,7 @@ void tst_QSqlQuery::ibaseTimeStampTzArray()
QVERIFY_SQL(qry, exec("select * from " + ts.tableName()));
QVERIFY(qry.next());
QCOMPARE(qry.value(0).toList(), timeStampData.toList());
+#endif // QT_CONFIG(timezone)
}
void tst_QSqlQuery::ibase_executeBlock()