aboutsummaryrefslogtreecommitdiff
path: root/string/stratcliff.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-09 00:33:53 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-09 00:33:53 +0000
commitd916374445a5b330be71dc5280f4091988ac964d (patch)
tree565bb91f53a94ea0964d2ae296938317f527184c /string/stratcliff.c
parent7b70fef6ae9e858f9d6b8a838dda1ee943dd6c35 (diff)
downloadglibc-d916374445a5b330be71dc5280f4091988ac964d.tar
glibc-d916374445a5b330be71dc5280f4091988ac964d.tar.gz
glibc-d916374445a5b330be71dc5280f4091988ac964d.tar.bz2
glibc-d916374445a5b330be71dc5280f4091988ac964d.zip
Update.
2000-12-08 Ulrich Drepper <drepper@redhat.com> * string/stratcliff.c: Add test for rawmemchr.
Diffstat (limited to 'string/stratcliff.c')
-rw-r--r--string/stratcliff.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/string/stratcliff.c b/string/stratcliff.c
index 10ddc47400..139a5ff57c 100644
--- a/string/stratcliff.c
+++ b/string/stratcliff.c
@@ -1,5 +1,5 @@
/* Test for string function add boundaries of usable memory.
- Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -152,6 +152,27 @@ main (int argc, char *argv[])
}
}
+ /* rawmemchr test */
+ for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
+ {
+ for (middle = MAX (outer, size - 64); middle < size; ++middle)
+ {
+ char *cp;
+ adr[middle] = 'V';
+
+ cp = rawmemchr (&adr[outer], 'V');
+
+ if (cp - &adr[outer] != middle - outer)
+ {
+ printf ("rawmemchr flunked for outer = %d, middle = %d\n",
+ outer, middle, inner);
+ result = 1;
+ }
+
+ adr[middle] = 'T';
+ }
+ }
+
/* strcpy test */
for (outer = size - 1; outer >= MAX (0, size - 128); --outer)
{