Two more patches that avoid test failures on Haiku.
2026-01-08 Bruno Haible <[email protected]> time_r tests: Avoid test failure on Haiku. * tests/test-localtime_r.c (main): On Haiku, expect a different tm_zone value than "CET" and "CEST". 2026-01-08 Bruno Haible <[email protected]> get-rusage-data tests: Avoid test failure on Haiku. * tests/test-get-rusage-data.c (main): Disable a failing assertion on Haiku.
>From 8ebbf13477415e48732a0ad33efc07c4678e7d29 Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Fri, 9 Jan 2026 00:46:34 +0100 Subject: [PATCH 1/2] get-rusage-data tests: Avoid test failure on Haiku. * tests/test-get-rusage-data.c (main): Disable a failing assertion on Haiku. --- ChangeLog | 6 ++++++ tests/test-get-rusage-data.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e095dcc195..17f20bd275 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-01-08 Bruno Haible <[email protected]> + + get-rusage-data tests: Avoid test failure on Haiku. + * tests/test-get-rusage-data.c (main): Disable a failing assertion on + Haiku. + 2026-01-08 Bruno Haible <[email protected]> Avoid test failures on Haiku, where -1 behaves like AT_FDCWD. diff --git a/tests/test-get-rusage-data.c b/tests/test-get-rusage-data.c index ca841ff8d5..bb0b9c8f3c 100644 --- a/tests/test-get-rusage-data.c +++ b/tests/test-get-rusage-data.c @@ -61,7 +61,7 @@ main () ASSERT (value2 >= value1); ASSERT (value3 >= value2); -#if !(__GLIBC__ == 2 || MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __OpenBSD__ || defined _WIN32 || defined __CYGWIN__) +#if !(__GLIBC__ == 2 || MUSL_LIBC || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __OpenBSD__ || defined _WIN32 || defined __CYGWIN__ || defined __HAIKU__) /* Allocating 2.5 MB of memory should increase the data segment size. */ ASSERT (value3 > value1); #endif -- 2.52.0
>From 9719eace24e670c872b2d149f0c677eebac0f4aa Mon Sep 17 00:00:00 2001 From: Bruno Haible <[email protected]> Date: Fri, 9 Jan 2026 00:49:08 +0100 Subject: [PATCH 2/2] time_r tests: Avoid test failure on Haiku. * tests/test-localtime_r.c (main): On Haiku, expect a different tm_zone value than "CET" and "CEST". --- ChangeLog | 6 ++++++ tests/test-localtime_r.c | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17f20bd275..91f6427617 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-01-08 Bruno Haible <[email protected]> + + time_r tests: Avoid test failure on Haiku. + * tests/test-localtime_r.c (main): On Haiku, expect a different tm_zone + value than "CET" and "CEST". + 2026-01-08 Bruno Haible <[email protected]> get-rusage-data tests: Avoid test failure on Haiku. diff --git a/tests/test-localtime_r.c b/tests/test-localtime_r.c index 98b1b3e66d..76ddfe298e 100644 --- a/tests/test-localtime_r.c +++ b/tests/test-localtime_r.c @@ -66,7 +66,8 @@ main (void) /* 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. */ + glibc, musl, macOS, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin, Android, + except on Haiku. */ /* A time point when DST was in effect. */ { @@ -88,7 +89,8 @@ main (void) #endif #if HAVE_STRUCT_TM_TM_ZONE printf ("tm_zone = %s\n", result->tm_zone == NULL ? "(null)" : result->tm_zone); - ASSERT (strcmp (result->tm_zone, "CEST") == 0); + ASSERT (strcmp (result->tm_zone, "CEST") == 0 + || strcmp (result->tm_zone, "GMT+2") == 0 /* Haiku */); #endif } @@ -112,7 +114,8 @@ main (void) #endif #if HAVE_STRUCT_TM_TM_ZONE printf ("tm_zone = %s\n", result->tm_zone == NULL ? "(null)" : result->tm_zone); - ASSERT (strcmp (result->tm_zone, "CET") == 0); + ASSERT (strcmp (result->tm_zone, "CET") == 0 + || strcmp (result->tm_zone, FRENCH_TZ) == 0 /* Haiku */); #endif } { @@ -134,7 +137,8 @@ main (void) #endif #if HAVE_STRUCT_TM_TM_ZONE printf ("tm_zone = %s\n", result->tm_zone == NULL ? "(null)" : result->tm_zone); - ASSERT (strcmp (result->tm_zone, "CEST") == 0); + ASSERT (strcmp (result->tm_zone, "CEST") == 0 + || strcmp (result->tm_zone, "GMT+2") == 0 /* Haiku */); #endif } @@ -158,7 +162,8 @@ main (void) #endif #if HAVE_STRUCT_TM_TM_ZONE printf ("tm_zone = %s\n", result->tm_zone == NULL ? "(null)" : result->tm_zone); - ASSERT (strcmp (result->tm_zone, "CEST") == 0); + ASSERT (strcmp (result->tm_zone, "CEST") == 0 + || strcmp (result->tm_zone, "GMT+2") == 0 /* Haiku */); #endif } { @@ -180,7 +185,8 @@ main (void) #endif #if HAVE_STRUCT_TM_TM_ZONE printf ("tm_zone = %s\n", result->tm_zone == NULL ? "(null)" : result->tm_zone); - ASSERT (strcmp (result->tm_zone, "CET") == 0); + ASSERT (strcmp (result->tm_zone, "CET") == 0 + || strcmp (result->tm_zone, FRENCH_TZ) == 0 /* Haiku */); #endif } -- 2.52.0
