While the nstrftime, c-nstrftime tests now work in my Windows 10 machine,
they still fail on the GitHub Windows 10 machines:

CET-1CEST,M3.5.0,M10.5.0/3: expected "1970-01-01 01:00:00 +0100 (CET)", got 
"1970-01-01 00:00:00 +0000 (Coordinated Universal Time)"
CET-1CEST,M3.5.0,M10.5.0/3: expected "1985-11-05 01:53:21 +0100 (CET)", got 
"1985-11-05 00:53:21 +0000 (Coordinated Universal Time)"
PST8PDT,M3.2.0,M11.1.0: expected "2001-09-08 18:46:42 -0700 (PDT)", got 
"2001-09-08 17:46:42 -0800 (PDT)"
CET-1CEST,M3.5.0,M10.5.0/3: expected "2001-09-09 03:46:42 +0200 (CEST)", got 
"2001-09-09 01:46:42 +0000 (Coordinated Universal Time)"

This patch fixes the failures for mingw on these machines. Apparently
native Windows knows the gmt-offset of the time zones in the winter time,
but not in the summer time (DST).


2024-06-03  Bruno Haible  <br...@clisp.org>

        nstrftime, c-nstrftime tests: Avoid some failures on native Windows.
        * tests/test-nstrftime.h (TZ): Use time zone names that are supported by
        native Windows.
        (LT): Disable two more tests on native Windows.

diff --git a/tests/test-nstrftime.h b/tests/test-nstrftime.h
index 50c270440d..b822f3acd1 100644
--- a/tests/test-nstrftime.h
+++ b/tests/test-nstrftime.h
@@ -102,7 +102,11 @@ struct tzalloc_test
 static struct tzalloc_test TZ[] =
   {
 #define Pacific 0
+#if defined _WIN32 && !defined __CYGWIN__
+    { 0, "PST8PDT"                     },
+#else
     { 0, "PST8PDT,M3.2.0,M11.1.0"      },
+#endif
 
 #define Arizona 1
     { 0, "MST7"                        },
@@ -111,7 +115,11 @@ static struct tzalloc_test TZ[] =
     { 0, 0                             },
 
 #define CentEur 3
+#if defined _WIN32 && !defined __CYGWIN__
+    { 0, "CET-1CEST"                   },
+#else
     { 0, "CET-1CEST,M3.5.0,M10.5.0/3"  },
+#endif
 
 #define Japan 4
     { 0, "JST-9"                       },
@@ -163,10 +171,14 @@ static struct localtime_rz_test LT[] =
     { TZ+CentEur,  500000001, "1985-11-05 01:53:21 +0100 (CET)",  1 },
     { TZ+Japan  ,  500000001, "1985-11-05 09:53:21 +0900 (JST)",  0 },
     { TZ+NZ     ,  500000001, "1985-11-05 13:53:21 +1300 (NZDT)", 0 },
+#if !(defined _WIN32 && !defined __CYGWIN__)
     { TZ+Pacific, 1000000002, "2001-09-08 18:46:42 -0700 (PDT)",  0 },
+#endif
     { TZ+Arizona, 1000000002, "2001-09-08 18:46:42 -0700 (MST)",  0 },
     { TZ+UTC    , 1000000002, "2001-09-09 01:46:42 +0000 (UTC)",  0 },
+#if !(defined _WIN32 && !defined __CYGWIN__)
     { TZ+CentEur, 1000000002, "2001-09-09 03:46:42 +0200 (CEST)", 0 },
+#endif
     { TZ+Japan  , 1000000002, "2001-09-09 10:46:42 +0900 (JST)",  0 },
 #if !(defined _WIN32 && !defined __CYGWIN__)
     { TZ+NZ     , 1000000002, "2001-09-09 13:46:42 +1200 (NZST)", 0 },




Reply via email to