* modules/getlogin-tests (Depends-on): Remove xalloc. (test_getlogin_LDADD): Remove @LIBINTL@. * tests/test-getlogin.c: Do not include xalloc.h. (main): Use a static rather than heap storage. --- ChangeLog | 6 ++++++ modules/getlogin-tests | 3 +-- tests/test-getlogin.c | 7 +++---- 3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 6da050ff2d..b143d1311b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-04-17 Paul Eggert <egg...@cs.ucla.edu> + getlogin-tests: remove xalloc dependency + * modules/getlogin-tests (Depends-on): Remove xalloc. + (test_getlogin_LDADD): Remove @LIBINTL@. + * tests/test-getlogin.c: Do not include xalloc.h. + (main): Use a static rather than heap storage. + Pacify GCC 15’s new -Wtrailing-whitespace option * m4/builtin-expect.m4 (gl___BUILTIN_EXPECT): * m4/iconv.m4 (AM_ICONV_LINK, AM_ICONV): diff --git a/modules/getlogin-tests b/modules/getlogin-tests index 6484ffe251..8637b2ea7e 100644 --- a/modules/getlogin-tests +++ b/modules/getlogin-tests @@ -6,11 +6,10 @@ tests/macros.h Depends-on: bool -xalloc configure.ac: Makefile.am: TESTS += test-getlogin check_PROGRAMS += test-getlogin -test_getlogin_LDADD = $(LDADD) @LIBINTL@ $(GETLOGIN_LIB) +test_getlogin_LDADD = $(LDADD) $(GETLOGIN_LIB) diff --git a/tests/test-getlogin.c b/tests/test-getlogin.c index 11f67de542..35ca3e0980 100644 --- a/tests/test-getlogin.c +++ b/tests/test-getlogin.c @@ -24,8 +24,6 @@ #include "signature.h" SIGNATURE_CHECK (getlogin, char *, (void)); -#include "xalloc.h" - #include "test-getlogin.h" int @@ -45,10 +43,11 @@ main (void) test_getlogin_result (buf, err); /* Check that getlogin() does not merely return getenv ("LOGNAME"). */ - putenv (xstrdup ("LOGNAME=ygvfibmslhkmvoetbrcegzwydorcke")); + static char set_LOGNAME[] = "LOGNAME=ygvfibmslhkmvoetbrcegzwydorcke"; + putenv (set_LOGNAME); buf = getlogin (); ASSERT (!(buf != NULL - && strcmp (buf, "ygvfibmslhkmvoetbrcegzwydorcke") == 0)); + && strcmp (buf, set_LOGNAME + sizeof "LOGNAME") == 0)); return test_exit_status; } -- 2.49.0