]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
unit-tests: Force a CET/CEST timezone Windows understands
authorMartin Willi <martin@revosec.ch>
Wed, 2 Apr 2014 10:29:32 +0000 (12:29 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:11 +0000 (15:53 +0200)
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

index 1a2f74c04087807dffa5930c27fb73495820079e..abca4620eb9ad3ff7b8a259f55c8a8a2e1c1e122 100644 (file)
@@ -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");