From: Bruno Haible Date: Mon, 27 May 2024 22:35:03 +0000 (+0200) Subject: nstrftime, c-nstrftime tests: Avoid test failures on native Windows. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0adb4d33d18c80740c3fdcdd26488b568cfd24af;p=gnulib.git nstrftime, c-nstrftime tests: Avoid test failures on native Windows. * doc/posix-functions/tzset.texi: Add a reference. * tests/test-nstrftime.h (TZ): Use time zone names that are supported by native Windows. (LT): Disable a test of New Zealand DST. --- diff --git a/ChangeLog b/ChangeLog index d06307f7a0..9ba81c3b5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-05-27 Bruno Haible + + nstrftime, c-nstrftime tests: Avoid test failures on native Windows. + * doc/posix-functions/tzset.texi: Add a reference. + * tests/test-nstrftime.h (TZ): Use time zone names that are supported by + native Windows. + (LT): Disable a test of New Zealand DST. + 2024-05-27 Bruno Haible nstrftime, c-nstrftime tests: Avoid some failures on native Windows. diff --git a/doc/posix-functions/tzset.texi b/doc/posix-functions/tzset.texi index 983789eca7..30901d3488 100644 --- a/doc/posix-functions/tzset.texi +++ b/doc/posix-functions/tzset.texi @@ -16,6 +16,7 @@ when the environment variable @code{TZ} has been set by Cygwin. Portability problems not fixed by Gnulib: @itemize @item +@c https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset Native Windows platforms (mingw, MSVC) support only a subset of POSIX-specified values for the @env{TZ} environment variable, consisting of a time zone abbreviation containing exactly three ASCII diff --git a/tests/test-nstrftime.h b/tests/test-nstrftime.h index d8e2a3915d..50c270440d 100644 --- a/tests/test-nstrftime.h +++ b/tests/test-nstrftime.h @@ -103,18 +103,29 @@ static struct tzalloc_test TZ[] = { #define Pacific 0 { 0, "PST8PDT,M3.2.0,M11.1.0" }, + #define Arizona 1 { 0, "MST7" }, + #define UTC 2 { 0, 0 }, + #define CentEur 3 { 0, "CET-1CEST,M3.5.0,M10.5.0/3" }, + #define Japan 4 { 0, "JST-9" }, + #define NZ 5 +#if defined _WIN32 && !defined __CYGWIN__ + { 0, "NST-13NDT" }, +#else { 0, "NZST-12NZDT,M9.5.0,M4.1.0/3" }, +#endif + #define Unknown 6 { 0, "<-00>0" }, + { 0 } }; @@ -157,7 +168,9 @@ static struct localtime_rz_test LT[] = { TZ+UTC , 1000000002, "2001-09-09 01:46:42 +0000 (UTC)", 0 }, { TZ+CentEur, 1000000002, "2001-09-09 03:46:42 +0200 (CEST)", 0 }, { 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 }, +#endif #if TZ_ANGLE_BRACKETS_SHOULD_WORK && !defined __FreeBSD__ { TZ+Unknown, 0, "1970-01-01 00:00:00 -0000 (-00)", 0 }, { TZ+Unknown, 500000001, "1985-11-05 00:53:21 -0000 (-00)", 0 },