diff options
author | Alan Modra <amodra@gmail.com> | 2013-08-17 18:38:26 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2013-10-04 10:42:15 +0930 |
commit | 0edf96c28fca19355143a7c252bca10c6547a3c6 (patch) | |
tree | 9338a69a1fcd7e30496fc08576ab9fdf5deb0df4 | |
parent | e0f7a3804683f1ab3c41dfc82894bfb18d731341 (diff) | |
download | glibc-0edf96c28fca19355143a7c252bca10c6547a3c6.tar glibc-0edf96c28fca19355143a7c252bca10c6547a3c6.tar.gz glibc-0edf96c28fca19355143a7c252bca10c6547a3c6.tar.bz2 glibc-0edf96c28fca19355143a7c252bca10c6547a3c6.zip |
string/tester memrchr test
http://sourceware.org/ml/libc-alpha/2013-08/msg00095.html
I found this useful at one stage when I was seeing a huge number of
memrchr failures all of test number 10.
* string/tester.c (test_memrchr): Increment reported test cycle.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | string/tester.c | 6 |
2 files changed, 7 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2013-10-04 Alan Modra <amodra@gmail.com> + * string/tester.c (test_memrchr): Increment reported test cycle. + +2013-10-04 Alan Modra <amodra@gmail.com> + * string/test-memcpy.c (do_one_test): When reporting errors, print string address and don't overrun end of string. diff --git a/string/tester.c b/string/tester.c index 2fe520caf1..f1ea4381d4 100644 --- a/string/tester.c +++ b/string/tester.c @@ -704,7 +704,7 @@ test_memrchr (void) more than 128 byte chunks: */ { char buf[128 + sizeof(long)]; - long align, len, i, pos; + long align, len, i, pos, n = 9; for (align = 0; align < (long) sizeof(long); ++align) { for (len = 0; len < (long) (sizeof(buf) - align); ++len) { @@ -715,9 +715,9 @@ test_memrchr (void) #if 0 printf("align %d, len %d, pos %d\n", align, len, pos); #endif - check(memrchr(buf + align, 'x', len) == buf + align + pos, 9); + check(memrchr(buf + align, 'x', len) == buf + align + pos, n++); check(memrchr(buf + align + pos + 1, 'x', len - (pos + 1)) == NULL, - 10); + n++); buf[align + pos] = '-'; } } |