From 20b8c3518b06d893bc74c439dcb83a3512feca89 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 29 Jul 2024 15:05:16 +0200 Subject: [PATCH] Fix #if-ery for MS-specific tst_QDateTime exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Mårten Nordheim --- tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index c5d86f7bc30..f96a4c18b16 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -10,9 +10,13 @@ #include // for qTzSet(), qTzName() #include +#if defined(Q_OS_WIN) && !QT_CONFIG(icu) +# define USING_WIN_TZ +#endif + #ifdef Q_OS_WIN # include -# 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