From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 1F9B0383302F for ; Wed, 2 Jun 2021 12:40:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F9B0383302F Received: by mail-pg1-x52a.google.com with SMTP id j12so2120802pgh.7 for ; Wed, 02 Jun 2021 05:40:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wGC/rHJViaoF+H4avWR+Q7eLCoPwRL6EHSY/xQOOmAE=; b=PfYuBNR6vApLOQmp0Q3WSx49TOsRJZYdt/vPwG0Bbx035PoFtDz9DZyP1JRcT004Li JJ4BtwQ6ZZ16aVjXVLj0cXJG2F5lXW2LdTg/3tm81C1vZG02Ke1qj65SSa0VWxdt4cgl psLrvP693CoW7wgp1xrST+KjsxExkWFRmVlEzMxLL4Y6Of0HfDb4Ghr9cBNp9JrQthjH r7ia4Cr9sZFl/mNEfTPPNNoMzxLM1uiddonZzsuCQBjINQhPweAvVTPzwz+4gCsVIzmw N0Xv8qSw9I9VPYvVPWeEfx7wh5VnYQpoFw9bQBW4V9O238jzc54BhTtRxveppBbWllAs 6pEw== X-Gm-Message-State: AOAM5323CXWitmAT2k4Qjf82nYoDV0NZhXPn5NUbu+Oq4fvhikEVo99a l5OvfWOeZDMBQPd1UPL+mtw= X-Google-Smtp-Source: ABdhPJzRbKwxOyQX53AyVqmNuDdG1KXcLC/W+QpyTHOH+GW/OfdM2l+9SJsTIVfSjSYlhsEZ8WF6xQ== X-Received: by 2002:a63:4386:: with SMTP id q128mr34164473pga.397.1622637632243; Wed, 02 Jun 2021 05:40:32 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.56.38.102]) by smtp.gmail.com with ESMTPSA id c17sm17437304pgm.3.2021.06.02.05.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 05:40:31 -0700 (PDT) Received: by gnu-cfl-2.localdomain (Postfix, from userid 1000) id 259B1C0456; Wed, 2 Jun 2021 05:40:30 -0700 (PDT) Date: Wed, 2 Jun 2021 05:40:30 -0700 From: "H.J. Lu" To: Sunil K Pandey , GNU C Library Subject: Re: [PATCH v3] Improve test coverage of strlen function Message-ID: References: <20210531180812.501625-1-skpgkp2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3035.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: Wed, 02 Jun 2021 12:40:44 -0000 On Mon, May 31, 2021 at 11:21:50AM -0700, H.J. Lu wrote: > On Mon, May 31, 2021 at 11:08 AM Sunil K Pandey wrote: > > > > This patch covers the following conditions: > > > > - Strings start with different alignments and end at the page boundary > > with less than 64 byte length. > > - Strings starts with different alignments and cross page boundary with > > fixed length. > > --- > > string/test-strlen.c | 15 ++++++++++++++- > > 1 file changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/string/test-strlen.c b/string/test-strlen.c > > index 6e67d1f1f1..c9a7afb339 100644 > > --- a/string/test-strlen.c > > +++ b/string/test-strlen.c > > @@ -79,7 +79,7 @@ do_test (size_t align, size_t len) > > { > > size_t i; > > > > - align &= 63; > > + align &= (getpagesize () / sizeof (CHAR)) - 1; > > if (align + sizeof (CHAR) * len >= page_size) > > return; > > > > @@ -160,6 +160,19 @@ test_main (void) > > do_test (sizeof (CHAR) * i, (size_t)((1 << i) / 1.5)); > > } > > > > + /* Test strings near page boundary */ > > + > > + size_t maxlength = 64 / sizeof (CHAR) - 1; > > + size_t pagesize = getpagesize () / sizeof (CHAR); > > + > > + for (i = maxlength ; i > 1; --i) > > + { > > + /* String stays on the same page. */ > > + do_test (pagesize - i, i - 1); > > + /* String crosses page boundary. */ > > + do_test (pagesize - i, maxlength); > > + } > > + > > do_random_tests (); > > return ret; > > } > > -- > > 2.31.1 > > > > LGTM. > > Reviewed-by: H.J. Lu > Hi Sunil, I am checking it in for you. Please get an account on sourceware.org: https://sourceware.org/ and use me as sponsor. Thanks. H.J.