about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-08-04 17:47:24 -0400
committerUlrich Drepper <drepper@gmail.com>2011-08-04 17:47:24 -0400
commit16292eddd77f66002e2104848e75a0fb4d316692 (patch)
tree1e553fc5bc5d62f117ffc7e4ee414c66003c88f7
parentcb7e923b71493bde61b408a1e2c88895abac7ced (diff)
downloadglibc-16292eddd77f66002e2104848e75a0fb4d316692.tar.gz
glibc-16292eddd77f66002e2104848e75a0fb4d316692.tar.xz
glibc-16292eddd77f66002e2104848e75a0fb4d316692.zip
Provide better output in string tests
If IMPL is called with a macro for the first parameter the macro does not
get expanded before the string is stored in the impl_t data structure.
-rw-r--r--ChangeLog3
-rw-r--r--string/test-string.h6
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a0c04c966..f8212a61c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-08-04  Ulrich Drepper  <drepper@gmail.com>
 
+	* string/test-string.h (IMPL): Use __STRING to expand name and then
+	stringify it.
+
 	* string/test-strcmp.c: Unify most of the WIDE and !WIDE code.  Lots
 	of cleanups.
 
diff --git a/string/test-string.h b/string/test-string.h
index 1aea4c9cb9..e384940469 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -1,5 +1,5 @@
 /* Test and measure string and memory functions.
-   Copyright (C) 1999, 2002, 2004, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2004, 2008, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Jakub Jelinek <jakub@redhat.com>, 1999.
 
@@ -18,6 +18,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <sys/cdefs.h>
+
 typedef struct
 {
   const char *name;
@@ -29,7 +31,7 @@ extern impl_t __start_impls[], __stop_impls[];
 #define IMPL(name, test) \
   impl_t tst_ ## name							\
   __attribute__ ((section ("impls"), aligned (sizeof (void *))))	\
-    = { #name, (void (*) (void))name, test };
+       = { __STRING (name), (void (*) (void))name, test };
 
 #ifdef TEST_MAIN