From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 52EB03858D34 for ; Thu, 2 Jul 2020 19:55:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 52EB03858D34 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-AhxFbQVuOPSugv0gN6nVFg-1; Thu, 02 Jul 2020 15:55:42 -0400 X-MC-Unique: AhxFbQVuOPSugv0gN6nVFg-1 Received: by mail-qt1-f200.google.com with SMTP id o11so20065478qti.23 for ; Thu, 02 Jul 2020 12:55:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0jbqu6LGlOhHmW96qEps+16S3oU6KrK75wo1dVlMfz4=; b=Fhn+aF9JW2y8RD7JNDgusJdfFXuGQ1rij2Qki0noBsfJvm7ejwXYGnQrrBmHrUwJr+ mq0XofObABCcXuoWgTTM5T635bCUD4ugX92jZV2+XxrQUeUCuN4Ozil6K5SQlagdKT5X 4VUd2BgesqyHzOIsZWDluchqwEiBc46tXaON9B0qqfCVnbnZO7g088uRoxMF/Usmvl3n JJsZENWmnQO1AG4BQomVrBBK6zoCuGs+mZpqFGcFtC0QuiTMPucSjH2J3fqxxWbSbCRb bfdnunmUEWSHBp4S6iWzuIVpJGIBt+VwLP1alZrWCZsM+Csk7Nbntb3Iuap1Jht+Sxy5 6nng== X-Gm-Message-State: AOAM532twumS8NXiK4wV1aUcFak4cVN/sI7d00gK6nkOoOpCnN2IWq79 44So21QVZrrVwISpDlmfyVkqS29GmFLwH7yWNtHTb8uzOgna1ktwfohqRnN07SRO3B0KfMDgKfY f7/yQHaautzL6hi0RMSRK X-Received: by 2002:a37:b941:: with SMTP id j62mr20286468qkf.233.1593719741732; Thu, 02 Jul 2020 12:55:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDZtON5bLa93E4ij7d1kWs7eespRzUKquID1eFoq79FF8yWg6Q+KnCSK1vQmz3Roz5G+0XIg== X-Received: by 2002:a37:b941:: with SMTP id j62mr20286446qkf.233.1593719741408; Thu, 02 Jul 2020 12:55:41 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id d136sm4762724qke.47.2020.07.02.12.55.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 12:55:40 -0700 (PDT) Subject: Re: [PATCH v5 09/13] string: Add strsignal test To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20200619134352.297146-1-adhemerval.zanella@linaro.org> <20200619134352.297146-9-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat Message-ID: <4cbe13d7-ed52-0add-d0f6-3e9b8508e466@redhat.com> Date: Thu, 2 Jul 2020 15:55:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200619134352.297146-9-adhemerval.zanella@linaro.org> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.2 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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2020 19:55:45 -0000 On 6/19/20 9:43 AM, Adhemerval Zanella wrote: > Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, > and s390x-linux-gnu. OK for master if you fix the typo. No regressions on x86_64 and i686. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell > --- > string/Makefile | 5 +++- > string/tst-strsignal.c | 57 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 61 insertions(+), 1 deletion(-) > create mode 100644 string/tst-strsignal.c > > diff --git a/string/Makefile b/string/Makefile > index e1cca5516b..470ff77ded 100644 > --- a/string/Makefile > +++ b/string/Makefile > @@ -65,6 +65,8 @@ tests := tester inl-tester noinl-tester testcopy test-ffs \ > # This test allocates a lot of memory and can run for a long time. > xtests = tst-strcoll-overflow > > +tests-container += tst-strsignal OK. > + > # This test needs libdl. > ifeq (yes,$(build-shared)) > tests += test-strerror-errno > @@ -105,7 +107,7 @@ $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out > > LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \ > tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \ > - da_DK.ISO-8859-1 en_GB.UTF-8 > + da_DK.ISO-8859-1 en_GB.UTF-8 pt_BR.UTF-8 OK. Ugly. This list should be one per line and alpha-sorted. Some other day. > include ../gen-locales.mk > > $(objpfx)test-strcasecmp.out: $(gen-locales) > @@ -115,5 +117,6 @@ $(objpfx)tst-strxfrm2.out: $(gen-locales) > # bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1. > $(objpfx)bug-strcoll2.out: $(gen-locales) > $(objpfx)tst-strcoll-overflow.out: $(gen-locales) > +$(objpfx)tst-strsignal.out: $(gen-locales) OK. > > endif > diff --git a/string/tst-strsignal.c b/string/tst-strsignal.c > new file mode 100644 > index 0000000000..93a46dbc78 > --- /dev/null > +++ b/string/tst-strsignal.c > @@ -0,0 +1,57 @@ > +/* Test for strsignal. OK. > + > + Copyright (C) 2020 Free Software Foundation, Inc. > + 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 > + OK. Test a few operations of strsignal. > +static int > +do_test (void) > +{ > + xsetlocale (LC_ALL, "C"); > + > + TEST_COMPARE_STRING (strsignal (SIGINT), "Interrupt"); > + TEST_COMPARE_STRING (strsignal (-1), "Unknown signal -1"); > +#ifdef SIGRTMIN > + TEST_COMPARE_STRING (strsignal (SIGRTMIN), "Real-time signal 0"); > +#endif > +#ifdef SIGRTMAX > + TEST_COMPARE_STRING (strsignal (SIGRTMAX+1), "Unknown signal 65"); > +#endif > + > + xsetlocale (LC_ALL, "pt_BR.UTF-8"); > + > + TEST_COMPARE_STRING (strsignal (SIGINT), "Interrup\xc3\xa7\xc3\xa3\x6f"); > + TEST_COMPARE_STRING (strsignal (-1), "Sinal desconhecido -1"); > +#ifdef SIGRTMI ^^^^^^^ Typo. SIGRTMIN. > + TEST_COMPARE_STRING (strsignal (SIGRTMIN), "Sinal de tempo-real 0"); > +#endif > +#ifdef SIGRTMAX > + TEST_COMPARE_STRING (strsignal (SIGRTMAX+1), "Sinal desconhecido 65"); > +#endif > + > + return 0; > +} > + > +#include > -- Cheers, Carlos.