From a334319f6530564d22e775935d9c91663623a1b4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 22 Dec 2004 20:10:10 +0000 Subject: (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. --- string/tester.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'string/tester.c') diff --git a/string/tester.c b/string/tester.c index cccef3ad9d..5f0a851104 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 #include +#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 @@ -434,29 +433,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) { @@ -1410,9 +1386,6 @@ main (void) /* strlen. */ test_strlen (); - /* strnlen. */ - test_strnlen (); - /* strchr. */ test_strchr (); -- cgit 1.4.1