diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-07-24 23:06:44 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-07-24 23:06:44 +0000 |
commit | c158fc76d93909a9e18263b04e6635105998ac17 (patch) | |
tree | af2ba622558d116de97e98f24f13e8b3ee272bc1 /string/test-memset.c | |
parent | 95029045a3371b79df9669a90b1ce59177c560b4 (diff) | |
download | glibc-c158fc76d93909a9e18263b04e6635105998ac17.tar glibc-c158fc76d93909a9e18263b04e6635105998ac17.tar.gz glibc-c158fc76d93909a9e18263b04e6635105998ac17.tar.bz2 glibc-c158fc76d93909a9e18263b04e6635105998ac17.zip |
(do_one_test): Compare effect of call, not only return value.
Add a few cassts to avoid warnings.
Diffstat (limited to 'string/test-memset.c')
-rw-r--r-- | string/test-memset.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/string/test-memset.c b/string/test-memset.c index 9ae774162f..6ea8455e01 100644 --- a/string/test-memset.c +++ b/string/test-memset.c @@ -1,5 +1,5 @@ /* Test and measure memset functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -49,10 +49,12 @@ static void do_one_test (impl_t *impl, char *s, int c, size_t n) { char *res = CALL (impl, s, c, n); - if (res != s) + char tstbuf[n]; + if (res != s + || simple_memset (tstbuf, c, n) != tstbuf + || memcmp (s, tstbuf, n) != 0) { - error (0, 0, "Wrong result in function %s %p != %p", impl->name, - res, s); + error (0, 0, "Wrong result in function %s", impl->name); ret = 1; return; } @@ -87,7 +89,7 @@ do_test (size_t align, int c, size_t len) printf ("Length %4zd, alignment %2zd, c %2d:", len, align, c); FOR_EACH_IMPL (impl, 0) - do_one_test (impl, buf1 + align, c, len); + do_one_test (impl, (char *) buf1 + align, c, len); if (HP_TIMING_AVAIL) putchar ('\n'); @@ -143,7 +145,7 @@ do_random_tests (void) if (p[i + align] == c) p[i + align] = o; } - res = CALL (impl, p + align, c, len); + res = (unsigned char *) CALL (impl, (char *) p + align, c, len); if (res != p + align) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd) %p != %p", @@ -191,7 +193,7 @@ test_main (void) printf ("\t%s", impl->name); putchar ('\n'); - for (c = 0; c <= 65; c += 65) + for (c = 0; c <= 130; c += 65) { for (i = 0; i < 18; ++i) do_test (0, c, 1 << i); |