From 98a3a5b3f6647afc35fd81baa931a4d924896c12 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 2 Dec 2020 22:30:10 +0100 Subject: [PATCH] strsignal-tests: Fix test failure on macOS 10.13. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported by Martin Storsjö in . * tests/test-strsignal.c (ASSERT_DESCRIPTION): Allow the actual result to be longer than the expected result. --- ChangeLog | 8 ++++++++ tests/test-strsignal.c | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae48d2dcdb..cbe4558d53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-12-02 Bruno Haible + + strsignal-tests: Fix test failure on macOS 10.13. + Reported by Martin Storsjö in + . + * tests/test-strsignal.c (ASSERT_DESCRIPTION): Allow the actual result + to be longer than the expected result. + 2020-12-02 Bruno Haible Fix compilation errors in test-math-c++.cc on FreeBSD 12.2/arm64. diff --git a/tests/test-strsignal.c b/tests/test-strsignal.c index 0316d40fab..1f8aeba160 100644 --- a/tests/test-strsignal.c +++ b/tests/test-strsignal.c @@ -28,10 +28,12 @@ SIGNATURE_CHECK (strsignal, char *, (int)); #include "macros.h" #if HAVE_DECL_SYS_SIGLIST -# define ASSERT_DESCRIPTION(got, expect) +# define ASSERT_DESCRIPTION(actual, expected) #else -/* In this case, we can guarantee some signal descriptions. */ -# define ASSERT_DESCRIPTION(got, expect) ASSERT (!strcmp (got, expect)) +/* In this case, we can guarantee some signal descriptions. + But allow the actual result to be longer than the expected result. */ +# define ASSERT_DESCRIPTION(actual, expected) \ + ASSERT (strncmp (actual, expected, strlen (expected)) == 0) #endif int -- 2.39.5