public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] string: Expand page cross test cases in test-strcmp.c
@ 2022-03-25 18:19 Noah Goldstein
  0 siblings, 0 replies; only message in thread
From: Noah Goldstein @ 2022-03-25 18:19 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=22833848e3a2ef3bebef088cea7fcf281972672a

commit 22833848e3a2ef3bebef088cea7fcf281972672a
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Wed Mar 23 16:57:39 2022 -0500

    string: Expand page cross test cases in test-strcmp.c
    
    Test cases for when both `s1` and `s2` are near the end of a page
    where previously missing.
    Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Diff:
---
 string/test-strcmp.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index 0abce769d0..ece03c6d0b 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -392,7 +392,7 @@ check3 (void)
 int
 test_main (void)
 {
-  size_t i, j;
+  size_t i, j, k;
   const size_t test_len = MIN(TEST_LEN, 3 * 4096);
   test_init ();
   check();
@@ -453,6 +453,19 @@ test_main (void)
           do_test (j, getpagesize () - j - 1, i, 127, 1);
           do_test (j, getpagesize () - j - 1, i, 127, -1);
 
+          for (k = 2; k <= 128; k += k)
+            {
+              do_test (getpagesize () - k, getpagesize () - j - 1, i, 127, 0);
+              do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, 127,
+                       0);
+              do_test (getpagesize () - k, getpagesize () - j - 1, i, 127, 1);
+              do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, 127,
+                       1);
+              do_test (getpagesize () - k, getpagesize () - j - 1, i, 127, -1);
+              do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, 127,
+                       -1);
+            }
+
           if (i < 32)
             {
               i += 1;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-25 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 18:19 [glibc] string: Expand page cross test cases in test-strcmp.c Noah Goldstein

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).