From 549502bcb20ed6a91fc7afaaaa9e23f382d56632 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 2 Apr 2014 12:29:32 +0200 Subject: [PATCH] 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. --- src/libstrongswan/tests/suites/test_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstrongswan/tests/suites/test_utils.c b/src/libstrongswan/tests/suites/test_utils.c index 1a2f74c04..abca4620e 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");