]> Savannah Git Hosting - gnulib.git/commitdiff
getlogin-tests: remove xalloc dependency
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Apr 2025 07:24:27 +0000 (00:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Apr 2025 07:30:25 +0000 (00:30 -0700)
* 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
modules/getlogin-tests
tests/test-getlogin.c

index 6da050ff2df30c0c5c1b2c5173763be898c171a1..b143d1311bedd641116c3af377404653821f078f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2025-04-17  Paul Eggert  <eggert@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):
index 6484ffe251585b431cea14ea48abe9e100f6d2a4..8637b2ea7e06ecdb40e5bf83fe4ce14ff93e5ae9 100644 (file)
@@ -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)
index 11f67de5427882cd7fcb13c33763b60abeff0241..35ca3e0980a0962e8548adde072b75339fd74ba9 100644 (file)
@@ -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;
 }