From: Collin Funk Date: Thu, 27 Jun 2024 07:56:04 +0000 (-0700) Subject: netdb tests: Check for NI_MAXHOST and NI_MAXSERV. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0482c81bd9dd80b66e3419276fdfd6cf9373774d;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 61a4bc1236..1b884b9eeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2024-06-27 Collin Funk + 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. diff --git a/modules/netdb-tests b/modules/netdb-tests index 3590c94aaa..2f84ec360e 100644 --- a/modules/netdb-tests +++ b/modules/netdb-tests @@ -3,6 +3,7 @@ tests/test-netdb.c Depends-on: netdb-c++-tests +assert-h configure.ac: diff --git a/tests/test-netdb.c b/tests/test-netdb.c index 9517057a5e..471ad79697 100644 --- a/tests/test-netdb.c +++ b/tests/test-netdb.c @@ -17,8 +17,12 @@ /* Written by Simon Josefsson , 2008. */ #include + #include +static_assert (NI_MAXHOST == 1025); +static_assert (NI_MAXSERV == 32); + /* Check that the 'struct hostent' type is defined. */ struct hostent t1;