This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, On Thu, May 16, 2013 at 09:09:32AM +0530, Siddhesh Poyarekar wrote: > I've updated this patch to fix another case that the original patch > broke. The case can be seen here: > > https://bugzilla.redhat.com/show_bug.cgi?id=958652 > > Dmitry, could you please run your testsuite against this to see if > anything breaks? It's unlikely, but I'd like to be sure. Yes, it works, thanks. BTW, Pádraig Brady supposed (in http://lists.gnu.org/archive/html/bug-gnulib/2013-04/msg00047.html) that "there are glibc units tests that should be updated", and I see no reason why they shouldn't. How about this one: diff --git a/posix/Makefile b/posix/Makefile index 8265e76..54c6354 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -86,7 +86,7 @@ tests := tstgetopt testfnm runtests runptests \ tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \ bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \ bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \ - tst-pathconf + tst-pathconf tst-getaddrinfo4 xtests := bug-ga2 ifeq (yes,$(build-shared)) test-srcs := globtest diff --git a/posix/tst-getaddrinfo4.c b/posix/tst-getaddrinfo4.c new file mode 100644 index 0000000..6d67fe1 --- /dev/null +++ b/posix/tst-getaddrinfo4.c @@ -0,0 +1,48 @@ +/* Test for [BZ #15339]. */ +#include <stdio.h> +#include <string.h> +#include <netdb.h> + +static int +try (const char *service, int family, int flags) +{ + struct addrinfo hints, *h, *ai; + int res; + + memset(&hints, 0, sizeof hints); + hints.ai_family = family; + hints.ai_flags = flags; + + h = (family || flags) ? &hints : NULL; + res = getaddrinfo ("example.net", service, h, &ai); + switch (res) + { + case 0: + case EAI_AGAIN: + case EAI_NONAME: + printf ("SUCCESS getaddrinfo(service=%s, family=%d, flags=%d): %s: %m\n", + service ?: "NULL", family, flags, gai_strerror (res)); + return 0; + } + printf ("FAIL getaddrinfo(service=%s, family=%d, flags=%d): %s: %m\n", + service ?: "NULL", family, flags, gai_strerror (res)); + return 1; +} + +static int +do_test (void) +{ + int err = 0; + err |= try(NULL, 0, 0); + err |= try(NULL, AF_UNSPEC, AI_ADDRCONFIG); + err |= try(NULL, AF_INET, 0); + err |= try(NULL, AF_INET6, 0); + err |= try("http", 0, 0); + err |= try("http", AF_UNSPEC, AI_ADDRCONFIG); + err |= try("http", AF_INET, 0); + err |= try("http", AF_INET6, 0); + return err; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- ldv
Attachment:
pgpLk591ql___.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |