From: Martin Willi Date: Wed, 2 Apr 2014 10:29:32 +0000 (+0200) Subject: unit-tests: Force a CET/CEST timezone Windows understands X-Git-Tag: 5.2.0dr6~24^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=549502bcb20ed6a91fc7afaaaa9e23f382d56632;p=thirdparty%2Fstrongswan.git unit-tests: Force a CET/CEST timezone Windows understands As it is currently unclear what the "three-letter-timezone" for CEST is, we use the German timezone, which actually is CET/CEST. SetEnvironmentVariable() "TZ" does not seem to affect localtime(), so we use _putenv() instead. --- diff --git a/src/libstrongswan/tests/suites/test_utils.c b/src/libstrongswan/tests/suites/test_utils.c index 1a2f74c040..abca4620eb 100644 --- a/src/libstrongswan/tests/suites/test_utils.c +++ b/src/libstrongswan/tests/suites/test_utils.c @@ -701,7 +701,11 @@ Suite *utils_suite_create() TCase *tc; /* force a timezone to match non-UTC conversions */ +#ifdef WIN32 + _putenv("TZ=GST-1GDT"); +#else setenv("TZ", "Europe/Zurich", 1); +#endif tzset(); s = suite_create("utils");