Fix #if-ery for MS-specific tst_QDateTime exceptions

The issues with its timezone data are only relevant when we're
actually using the backend based on its registry. So introduce the
same USING_WIN_TZ define as tst_QTimeZone uses and apply it to some
exceptions previously testing Q_OS_WIN. For clarity, also use it for
the second pace feature ICU was tested.

Change-Id: Ibf88bc72260dda6eae3317b3ff3117670e6531b2
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Edward Welbourne 2024-07-29 15:05:16 +02:00
parent 4e60a6b556
commit 20b8c3518b

View File

@ -10,9 +10,13 @@
#include <private/qtenvironmentvariables_p.h> // for qTzSet(), qTzName()
#include <private/qcomparisontesthelper_p.h>
#if defined(Q_OS_WIN) && !QT_CONFIG(icu)
# define USING_WIN_TZ
#endif
#ifdef Q_OS_WIN
# include <qt_windows.h>
# if !QT_CONFIG(icu)
# ifdef USING_WIN_TZ
// The native MS back-end for time-zones lacks info about historic transitions:
# define INADEQUATE_TZ_DATA
# endif
@ -3629,7 +3633,7 @@ void tst_QDateTime::zoneAtTime_data()
# define NONANDROIDROW(name, zone, date, offset) ADDROW(name, zone, date, offset)
#endif
#ifndef Q_OS_WIN
#ifndef USING_WIN_TZ
// Bracket a few noteworthy transitions:
ADDROW("before:ACWST", "Australia/Eucla", QDate(1974, 10, 26), 31500); // 8:45
NONANDROIDROW("after:ACWST", "Australia/Eucla", QDate(1974, 10, 27), 35100); // 9:45