bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mark McLoughlin] [PATCH] gnulib/tests: allow test-getaddrinfo to pass w


From: Jim Meyering
Subject: [Mark McLoughlin] [PATCH] gnulib/tests: allow test-getaddrinfo to pass when offline
Date: Mon, 26 Jan 2009 10:03:21 +0100

Hi Simon,

Mark McLoughlin noticed that the getaddrinfo test fails
when there's no network, and sent the patch below.

This looks like a good idea.
Though maybe we should make it skip the test (return 77) after saying why:

      fprintf (stderr, "skipping getaddrinfo test: no network?\n")

If you like it, let me know and I'll take care of it.


  Subject: [PATCH] gnulib/tests: allow test-getaddrinfo to pass when offline
  From: Mark McLoughlin <address@hidden>
  To: Jim Meyering <address@hidden>
  Cc: libvir-list <address@hidden>
  Date: Mon, 26 Jan 2009 08:30:27 +0000
  Message-Id: <address@hidden>

  Sometimes - yes, even in the latter part of the first decade
  of the twenty first century - one doesn't have access to the
  Internet while one is hacking.

  Signed-off-by: Mark McLoughlin <address@hidden>
  ---
   gnulib/tests/test-getaddrinfo.c |    5 +++++
   1 files changed, 5 insertions(+), 0 deletions(-)

  diff --git a/gnulib/tests/test-getaddrinfo.c b/gnulib/tests/test-getaddrinfo.c
  index a887cb1..246021a 100644
  --- a/gnulib/tests/test-getaddrinfo.c
  +++ b/gnulib/tests/test-getaddrinfo.c
  @@ -64,6 +64,11 @@ int simple (char *host, char *service)

     if (res != 0)
       {
  +      /* EAI_AGAIN is returned if no network is available. Don't fail
  +      the test merely because someone is down the country on their
  +      in-law's farm. */
  +      if (res == EAI_AGAIN)
  +     return 0;
         /* IRIX reports EAI_NONAME for "https".  Don't fail the test
           merely because of this.  */
         if (res == EAI_NONAME)
  --
  1.6.0.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]