aboutsummaryrefslogtreecommitdiff
path: root/string/tst-strlen.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-07-26 08:37:08 -0700
committerUlrich Drepper <drepper@redhat.com>2010-07-26 08:37:08 -0700
commit24fb0f88ed29d21b6034559e9c55545f22556bc0 (patch)
tree51b61ee2442da648a3fc724437188b2a99aadcff /string/tst-strlen.c
parent8e96b93aa7855683d0be3c65ce81e66d0786ba84 (diff)
downloadglibc-24fb0f88ed29d21b6034559e9c55545f22556bc0.zip
glibc-24fb0f88ed29d21b6034559e9c55545f22556bc0.tar.gz
glibc-24fb0f88ed29d21b6034559e9c55545f22556bc0.tar.bz2
Add optimized x86-64 implementation of strnlen.
While at it, beef up the test suite for strnlen and add performance tests for it, too.
Diffstat (limited to 'string/tst-strlen.c')
-rw-r--r--string/tst-strlen.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/string/tst-strlen.c b/string/tst-strlen.c
index a1e1159..8cbe441 100644
--- a/string/tst-strlen.c
+++ b/string/tst-strlen.c
@@ -31,11 +31,21 @@ main(int argc, char *argv[])
buf[words * 4 + 3] = (last & 8) != 0 ? 'e' : '\0';
buf[words * 4 + 4] = '\0';
- if (strlen (buf) != words * 4 + lens[last]
- || strnlen (buf, -1) != words * 4 + lens[last])
+ if (strlen (buf) != words * 4 + lens[last])
{
- printf ("failed for base=%Zu, words=%Zu, and last=%Zu\n",
- base, words, last);
+ printf ("\
+strlen failed for base=%Zu, words=%Zu, and last=%Zu (is %zd, expected %zd)\n",
+ base, words, last,
+ strlen (buf), words * 4 + lens[last]);
+ return 1;
+ }
+
+ if (strnlen (buf, -1) != words * 4 + lens[last])
+ {
+ printf ("\
+strnlen failed for base=%Zu, words=%Zu, and last=%Zu (is %zd, expected %zd)\n",
+ base, words, last,
+ strnlen (buf, -1), words * 4 + lens[last]);
return 1;
}
}