qt5base-lts/tests/auto/corelib/tools/qdatetime
Edward Welbourne 6c543879a3 Avoid races on TZ in environment via tzset() calls
POSIX specifies that tzset() consults environment variable TZ and
modifies some globals; it also specifies mktime(), localtime() and
strftime() to behave as if they called tzset().  Fortunately, we only
call strftime() from a test and only call localtime() when not
threaded.  Provide wrappers for tzset() and mktime() that share the
lock used by our environment-access code, to prevent races on the
environment (and tzset()'s globals) when we call them.

In the process, re-use tst_QDateTime's TimeZoneRollback in its older
test systemTimeZoneChange() and presume that this can now be tested
cross-platform, since TimeZoneRollback is used in another test where
this works.

Fixes: QTBUG-71030
Change-Id: I79f559b8857ea2803e73501008bf0d7158c6731f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-22 10:07:01 +00:00
..
.gitignore Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
BLACKLIST Blacklist two tests on macOS that a planned CI change shall break 2018-08-24 17:30:01 +00:00
qdatetime.pro Tests: Remove CONFIG += parallel_test. 2015-09-05 07:16:50 +00:00
tst_qdatetime_mac.mm Round to nearest millisecond in QDateTime::fromCFDate() 2016-10-02 13:07:18 +00:00
tst_qdatetime.cpp Avoid races on TZ in environment via tzset() calls 2018-10-22 10:07:01 +00:00