+2024-03-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ time_r-tests: skip French tests if no Europe/Paris
+ * tests/test-localtime_r.c (main):
+ * tests/test-localtime_r-mt.c (main):
+ If TZ='Europe/Paris' does not work, skip these tests.
+
2024-03-29 Paul Eggert <eggert@cs.ucla.edu>
intprops: pacify GCC < 10 -Wsign-compare
{
setenv ("TZ", FRENCH_TZ, 1);
+ /* Check that this TZ works. */
+ {
+ time_t t = 0; /* 1970-01-01 01:00:00 */
+ struct tm *result = localtime (&t);
+ if (! (result
+ && result->tm_sec == 0
+ && result->tm_min == 0
+ && result->tm_hour == 1
+ && result->tm_mday == 1
+ && result->tm_mon == 1 - 1
+ && result->tm_year == 1970 - 1900
+ && result->tm_wday == 4
+ && result->tm_yday == 0
+ && result->tm_isdst == 0))
+ {
+ fputs ("Skipping test: TZ='Europe/Paris' is not Paris time\n",
+ stderr);
+ return 77;
+ }
+ }
+
/* Create the threads. */
gl_thread_create (thread1_func, NULL);
gl_thread_create (thread2_func, NULL);
{
setenv ("TZ", FRENCH_TZ, 1);
+ /* Check that this TZ works. */
+ {
+ time_t t = 0; /* 1970-01-01 01:00:00 */
+ struct tm *result = localtime (&t);
+ if (! (result
+ && result->tm_sec == 0
+ && result->tm_min == 0
+ && result->tm_hour == 1
+ && result->tm_mday == 1
+ && result->tm_mon == 1 - 1
+ && result->tm_year == 1970 - 1900
+ && result->tm_wday == 4
+ && result->tm_yday == 0
+ && result->tm_isdst == 0))
+ {
+ fputs ("Skipping test: TZ='Europe/Paris' is not Paris time\n",
+ stderr);
+ return 77;
+ }
+ }
+
/* Note: The result->tm_gmtoff values and the result->tm_zone values are the
same (3600, "CET" or 7200, "CEST") across all tested platforms:
glibc, musl, macOS, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin, Android. */