1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.
This commit is contained in:
Alan Modra
2013-08-17 18:38:26 +09:30
parent e0f7a38046
commit 0edf96c28f
2 changed files with 7 additions and 3 deletions

View File

@ -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] = '-';
}
}