public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
To: Arjun Shankar <arjun@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 2/2] posix: Add test case for gai_strerror()
Date: Tue, 13 Jun 2023 19:08:46 +0000	[thread overview]
Message-ID: <CAJYncsi07iSZxe-k0oWUt5kBCH0GJ4nKPRru0jZqLmc-HTqefA@mail.gmail.com> (raw)
In-Reply-To: <CAG_osabsJtVcJgrtuuen0x7debT+=CLpY77pDwqScysLANYGpA@mail.gmail.com>

On Tue, Jun 13, 2023 at 6:48 PM Arjun Shankar <arjun@redhat.com> wrote:
>
> > Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
>
> This looks good to me.
>
> Reviewed-by: Arjun Shankar <arjun@redhat.com>
>
> I'll push this and the other patch in a bit. Thanks!

Likewise, thanks!

> > ---
> >  posix/Makefile           |  1 +
> >  posix/tst-gai_strerror.c | 43 ++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 44 insertions(+)
> >  create mode 100644 posix/tst-gai_strerror.c
> >
> > diff --git a/posix/Makefile b/posix/Makefile
> > index e19b74cd67..ad43cbdec6 100644
> > --- a/posix/Makefile
> > +++ b/posix/Makefile
> > @@ -275,6 +275,7 @@ tests := \
> >    tst-fnmatch6 \
> >    tst-fnmatch7 \
> >    tst-fork \
> > +  tst-gai_strerror \
> >    tst-getaddrinfo \
> >    tst-getaddrinfo2 \
> >    tst-getaddrinfo3 \
> > diff --git a/posix/tst-gai_strerror.c b/posix/tst-gai_strerror.c
> > new file mode 100644
> > index 0000000000..7d886df2a4
> > --- /dev/null
> > +++ b/posix/tst-gai_strerror.c
> > @@ -0,0 +1,43 @@
> > +/* Test for gai_strerror()
> > +   Copyright The GNU Toolchain Authors.
> > +   This file is part of the GNU C Library.
> > +
> > +   The GNU C Library is free software; you can redistribute it and/or
> > +   modify it under the terms of the GNU Lesser General Public
> > +   License as published by the Free Software Foundation; either
> > +   version 2.1 of the License, or (at your option) any later version.
> > +
> > +   The GNU C Library is distributed in the hope that it will be useful,
> > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > +   Lesser General Public License for more details.
> > +
> > +   You should have received a copy of the GNU Lesser General Public
> > +   License along with the GNU C Library; if not, see
> > +   <https://www.gnu.org/licenses/>.  */
> > +
> > +#include <sys/types.h>
> > +#include <sys/socket.h>
> > +#include <netdb.h>
> > +#include <stdlib.h>
> > +#include <locale.h>
> > +
> > +#include <support/support.h>
> > +#include <support/check.h>
> > +
> > +static int
> > +do_test (void)
> > +{
> > +  unsetenv ("LANGUAGE");
> > +
> > +  xsetlocale (LC_ALL, "C");
> > +
> > +  TEST_COMPARE_STRING (gai_strerror (1), "Unknown error");
> > +  TEST_COMPARE_STRING (gai_strerror (0), "Success");
> > +  TEST_COMPARE_STRING (gai_strerror (EAI_OVERFLOW),
> > +                       "Result too large for supplied buffer");
> > +
> > +  return 0;
> > +}
> > +
> > +#include <support/test-driver.c>
> > --
> > 2.40.1
> >
>
>
> --
> Arjun Shankar
> he/him/his
>

      reply	other threads:[~2023-06-13 19:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 10:08 [PATCH v2 1/2] posix: Handle success in gai_strerror() Dridi Boukelmoune
2023-06-13 10:08 ` [PATCH v2 2/2] posix: Add test case for gai_strerror() Dridi Boukelmoune
2023-06-13 18:48   ` Arjun Shankar
2023-06-13 19:08     ` Dridi Boukelmoune [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJYncsi07iSZxe-k0oWUt5kBCH0GJ4nKPRru0jZqLmc-HTqefA@mail.gmail.com \
    --to=dridi.boukelmoune@gmail.com \
    --cc=arjun@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).