diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2020-04-23 17:11:40 +0300 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2020-05-11 14:42:00 +0300 |
commit | b428e98052aa1b97a42f31ed52b1266d17e186ee (patch) | |
tree | d6ce2fefdef8279b986239b2f09a5c3fa36da473 /tests/auto/widgets/widgets | |
parent | 255cc55d74b55dfbecd9af0ea8d39aaf181da4ce (diff) |
Make qtbase compile without QT_CONFIG(timezone)
Fixes: QTBUG-83795
Pick-to: 5.15
Change-Id: I05eaaf57d87a9111d3609ebab81bc707f8af98f0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r-- | tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 08c80c96ab..6efac708b9 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -4510,6 +4510,7 @@ void tst_QDateTimeEdit::stepModifierPressAndHold() QCOMPARE(value.toDate(), expectedDate); } +#if QT_CONFIG(timezone) /* The following tests verify correct handling of the spring forward gap; which hour is skipped, and on which day, depends on the local time zone. We try to @@ -4535,6 +4536,7 @@ static QDateTime findSpring(int year, const QTimeZone &timeZone) return spring; }; +#endif /*! Test that typing in a time that is invalid due to spring forward gap @@ -4542,6 +4544,7 @@ static QDateTime findSpring(int year, const QTimeZone &timeZone) */ void tst_QDateTimeEdit::springForward_data() { +#if QT_CONFIG(timezone) QTest::addColumn<QDateTime>("start"); QTest::addColumn<QAbstractSpinBox::CorrectionMode>("correctionMode"); QTest::addColumn<QTime>("inputTime"); @@ -4589,10 +4592,14 @@ void tst_QDateTimeEdit::springForward_data() << QAbstractSpinBox::CorrectToNearestValue << springGapMiddle << springTransition; +#else + QSKIP("Needs timezone feature enabled"); +#endif } void tst_QDateTimeEdit::springForward() { +#if QT_CONFIG(timezone) QFETCH(QDateTime, start); QFETCH(QAbstractSpinBox::CorrectionMode, correctionMode); QFETCH(QTime, inputTime); @@ -4621,6 +4628,7 @@ void tst_QDateTimeEdit::springForward() QTest::keyClick(&edit, Qt::Key_Return, {}); QCOMPARE(edit.dateTime(), expected); +#endif } /*! @@ -4632,6 +4640,7 @@ void tst_QDateTimeEdit::springForward() */ void tst_QDateTimeEdit::stepIntoDSTGap_data() { +#if QT_CONFIG(timezone) QTest::addColumn<QDateTime>("start"); QTest::addColumn<QDateTimeEdit::Section>("section"); QTest::addColumn<int>("steps"); @@ -4706,10 +4715,14 @@ void tst_QDateTimeEdit::stepIntoDSTGap_data() << QDateTimeEdit::YearSection << -1 << springTransition; +#else + QSKIP("Needs timezone feature enabled"); +#endif } void tst_QDateTimeEdit::stepIntoDSTGap() { +#if QT_CONFIG(timezone) QFETCH(QDateTime, start); QFETCH(QDateTimeEdit::Section, section); QFETCH(int, steps); @@ -4732,6 +4745,7 @@ void tst_QDateTimeEdit::stepIntoDSTGap() QTest::keyClick(&edit, steps > 0 ? Qt::Key_Up : Qt::Key_Down, {}); QCOMPARE(edit.dateTime(), end); +#endif } QTEST_MAIN(tst_QDateTimeEdit) |