aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string/test-strncmp.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 1a87f0e73e..bba9e3d2dc 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -573,7 +573,7 @@ check_overflow (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 ();
@@ -705,6 +705,31 @@ test_main (void)
do_test_n (j, getpagesize () - j - 1, i, ULONG_MAX - i, 0, 127, 0);
do_test_n (j, getpagesize () - j - 1, i, ULONG_MAX - i, 0, 127, 1);
do_test_n (j, getpagesize () - j - 1, i, ULONG_MAX - i, 0, 127, -1);
+
+ for (k = 2; k <= 128; k += k)
+ {
+ do_test (getpagesize () - k, getpagesize () - j - 1, i - 1, i,
+ 127, 0);
+ do_test (getpagesize () - k - 1, getpagesize () - j - 1, i - 1,
+ i, 127, 0);
+ do_test (getpagesize () - k, getpagesize () - j - 1, i + 1, i,
+ 127, 0);
+ do_test (getpagesize () - k - 1, getpagesize () - j - 1, i + 1,
+ i, 127, 0);
+ do_test (getpagesize () - k, getpagesize () - j - 1, i, i, 127,
+ 0);
+ do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, i,
+ 127, 0);
+ do_test (getpagesize () - k, getpagesize () - j - 1, i + 1, i,
+ 127, -1);
+ do_test (getpagesize () - k - 1, getpagesize () - j - 1, i + 1,
+ i, 127, -1);
+ do_test (getpagesize () - k, getpagesize () - j - 1, i + 1, i,
+ 127, 1);
+ do_test (getpagesize () - k - 1, getpagesize () - j - 1, i + 1,
+ i, 127, 1);
+ }
+
if (i < 32)
{
i += 1;