From: Bruno Haible Date: Wed, 2 Dec 2020 21:30:10 +0000 (+0100) Subject: strsignal-tests: Fix test failure on macOS 10.13. X-Git-Tag: v1.0~3437 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=98a3a5b3f6647afc35fd81baa931a4d924896c12;p=gnulib.git 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. --- 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