From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 19D013858C5E for ; Tue, 13 Jun 2023 18:48:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 19D013858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686682104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WcyVhFqN5pEXip7kx2fgKA5ycdQcFOCIAgocXGuOobY=; b=eJZ9qQ4b8h+WiOGVCcyH340yGcLvSSPQ+/VUDz77hRnA56s1X30sE4LJVfIo4GuvkAxxyt jXLcoesjKf6O84mF9578B3pHXP8yDiz7uVtOgoTQ6VuGQ2LJbQl5pW2HavC478qjt1kJB4 aX1XqNWvcWv36shnmgIO/45UmTX01Ok= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-73-mJXJZbEFPVCcREty6zSTrw-1; Tue, 13 Jun 2023 14:48:21 -0400 X-MC-Unique: mJXJZbEFPVCcREty6zSTrw-1 Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-558a4d70fa9so4809076eaf.1 for ; Tue, 13 Jun 2023 11:48:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686682099; x=1689274099; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WcyVhFqN5pEXip7kx2fgKA5ycdQcFOCIAgocXGuOobY=; b=Uyghj+L6kUIxRaqeoHs0bEl11lfhQ6jYqiq86DwWXN2zeYkIbpQJ0IPVagih5CZBi8 WKw4MB2APGt/8FpW0NyNNX/+qMIB8L4l4jxNJ1nf90JMMjIUHOLQWMM9Shti+I92vmSF 0AXQmACP8GaAEXSIDL3PgCcDJ34whPfMRE56HZuURC2IIxSYfv5NYivUkLCnyRc776dP Buk5tEgqNQGh4Mi1rePhA/MJUaJneOjV3YNUWK9/iurFohN/RSYqH/5QDdxrWVYGk6po gNH3jSWA5QdJnJIrpNyTnng6mCOuAUxMz4HcxSBe1yPSBjK7Igw7dApFucW7bsP82m2h 4HAA== X-Gm-Message-State: AC+VfDzeBDQz0cYL+wyif0SOvQFwqPNJfGpgwGfehpeMVUGkEoo79nIK /zJSWzT6ty2gUmEfbU67rWiTeShXoyjUSF7jtgzFSrUoaA9MeutmCzdOjzK4inxM6vfRjVSETmm 7dsU1yGGEw4DPszQL/Vsrflx5pkN4PFBxkVWc X-Received: by 2002:a4a:d10c:0:b0:558:b386:7a78 with SMTP id k12-20020a4ad10c000000b00558b3867a78mr6602653oor.5.1686682098974; Tue, 13 Jun 2023 11:48:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6xFolaAIW7/i03W9krv648u2SOv1nkXKYk5Tse+98OAjlgv3TBB+3E3Ou98uSt+UDrJBQFkvMNwdmGbdS5Dhg= X-Received: by 2002:a4a:d10c:0:b0:558:b386:7a78 with SMTP id k12-20020a4ad10c000000b00558b3867a78mr6602651oor.5.1686682098707; Tue, 13 Jun 2023 11:48:18 -0700 (PDT) MIME-Version: 1.0 References: <20230613100828.47611-1-dridi.boukelmoune@gmail.com> <20230613100828.47611-2-dridi.boukelmoune@gmail.com> In-Reply-To: <20230613100828.47611-2-dridi.boukelmoune@gmail.com> From: Arjun Shankar Date: Tue, 13 Jun 2023 20:48:07 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] posix: Add test case for gai_strerror() To: Dridi Boukelmoune Cc: libc-alpha@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Signed-off-by: Dridi Boukelmoune This looks good to me. Reviewed-by: Arjun Shankar I'll push this and the other patch in a bit. 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 > + . */ > + > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +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 > -- > 2.40.1 > -- Arjun Shankar he/him/his