aboutsummaryrefslogtreecommitdiff
path: root/string/tester.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /string/tester.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.zip
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'string/tester.c')
-rw-r--r--string/tester.c37
1 files changed, 5 insertions, 32 deletions
diff --git a/string/tester.c b/string/tester.c
index cccef3a..5f0a851 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1,5 +1,5 @@
/* Tester for string functions.
- Copyright (C) 1995-2001, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,10 @@
#include <strings.h>
#include <fcntl.h>
+#ifndef HAVE_GNU_LD
+#define _sys_nerr sys_nerr
+#define _sys_errlist sys_errlist
+#endif
#define STREQ(a, b) (strcmp((a), (b)) == 0)
@@ -344,9 +348,6 @@ test_strncat (void)
(void) strncat (one, "gh", 2);
equal (one, "abcdgh", 12); /* Count and length equal. */
-
- (void) strncat (one, "ij", (size_t)-1); /* set sign bit in count */
- equal (one, "abcdghij", 13);
}
static void
@@ -367,8 +368,6 @@ test_strncmp (void)
check (strncmp ("abce", "abc", 3) == 0, 11); /* Count == length. */
check (strncmp ("abcd", "abce", 4) < 0, 12); /* Nudging limit. */
check (strncmp ("abc", "def", 0) == 0, 13); /* Zero count. */
- check (strncmp ("abc", "", (size_t)-1) > 0, 14); /* set sign bit in count */
- check (strncmp ("abc", "abc", (size_t)-2) == 0, 15);
}
static void
@@ -435,29 +434,6 @@ test_strlen (void)
}
static void
-test_strnlen (void)
-{
- it = "strnlen";
- check (strnlen ("", 10) == 0, 1); /* Empty. */
- check (strnlen ("a", 10) == 1, 2); /* Single char. */
- check (strnlen ("abcd", 10) == 4, 3); /* Multiple chars. */
- check (strnlen ("foo", (size_t)-1) == 3, 4); /* limits of n. */
-
- {
- char buf[4096];
- int i;
- char *p;
- for (i=0; i < 0x100; i++)
- {
- p = (char *) ((unsigned long int)(buf + 0xff) & ~0xff) + i;
- strcpy (p, "OK");
- strcpy (p+3, "BAD/WRONG");
- check (strnlen (p, 100) == 2, 5+i);
- }
- }
-}
-
-static void
test_strchr (void)
{
it = "strchr";
@@ -1410,9 +1386,6 @@ main (void)
/* strlen. */
test_strlen ();
- /* strnlen. */
- test_strnlen ();
-
/* strchr. */
test_strchr ();