]> Savannah Git Hosting - gnulib.git/commitdiff
netdb tests: Check for NI_MAXHOST and NI_MAXSERV.
authorCollin Funk <collin.funk1@gmail.com>
Thu, 27 Jun 2024 07:56:04 +0000 (00:56 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Thu, 27 Jun 2024 07:56:04 +0000 (00:56 -0700)
* modules/netdb-tests (Depends-on): Add assert-h.
* tests/test-netdb.c: Check that NI_MAXHOST and NI_MAXSERV are defined
correctly.

ChangeLog
modules/netdb-tests
tests/test-netdb.c

index 61a4bc1236dce3fd67e1bff6c9a938f4cde4676b..1b884b9eeb6734df3efdba8df421557aec31a1a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-06-27  Collin Funk  <collin.funk1@gmail.com>
 
+       netdb tests: Check for NI_MAXHOST and NI_MAXSERV.
+       * modules/netdb-tests (Depends-on): Add assert-h.
+       * tests/test-netdb.c: Check that NI_MAXHOST and NI_MAXSERV are defined
+       correctly.
+
        netdb: Define NI_MAXHOST and NI_MAXSERV.
        * doc/posix-headers/netdb.texi (netdb.h): Document definitions that
        differ from RFC 2553.
index 3590c94aaa2825aaaed2800de8a32e910f137cdd..2f84ec360e82bc8cdb0534c591ef620263f0eefb 100644 (file)
@@ -3,6 +3,7 @@ tests/test-netdb.c
 
 Depends-on:
 netdb-c++-tests
+assert-h
 
 configure.ac:
 
index 9517057a5e769b2ed811de8a72f3cf9da890a147..471ad7969722381b6a1414ad828e667d83dec2d4 100644 (file)
 /* Written by Simon Josefsson <simon@josefsson.org>, 2008.  */
 
 #include <config.h>
+
 #include <netdb.h>
 
+static_assert (NI_MAXHOST == 1025);
+static_assert (NI_MAXSERV == 32);
+
 /* Check that the 'struct hostent' type is defined.  */
 struct hostent t1;