summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2012-03-08 03:02:24 -0500
committerUlrich Drepper <drepper@gmail.com>2012-03-08 03:02:24 -0500
commitaea5d7277a2ebd2f432bc3196e4a0e2afe8d5878 (patch)
tree5fe757070c71a5c7f577e09b6b276759cb06c396 /stdio-common
parentca2ff9fc0492c42f5407a64dd009baa0df488887 (diff)
downloadglibc-aea5d7277a2ebd2f432bc3196e4a0e2afe8d5878.tar.gz
glibc-aea5d7277a2ebd2f432bc3196e4a0e2afe8d5878.tar.xz
glibc-aea5d7277a2ebd2f432bc3196e4a0e2afe8d5878.zip
Clean up tst-fphex test
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/tst-fphex-wide.c8
-rw-r--r--stdio-common/tst-fphex.c29
2 files changed, 14 insertions, 23 deletions
diff --git a/stdio-common/tst-fphex-wide.c b/stdio-common/tst-fphex-wide.c
index 2fd9f6ae3e..04d913561f 100644
--- a/stdio-common/tst-fphex-wide.c
+++ b/stdio-common/tst-fphex-wide.c
@@ -19,12 +19,6 @@
 
 #include <wchar.h>
 
-#define STR_LEN wcslen
-#define SPRINT swprintf
-#define STR_CMP wcscmp
-#define CHAR_T wchar_t
-#define PRINT wprintf
-#define L_(Str)        L##Str
-#define L "l"
+#define WIDE 1
 
 #include "tst-fphex.c"
diff --git a/stdio-common/tst-fphex.c b/stdio-common/tst-fphex.c
index 4465bfb81a..c2e8961d62 100644
--- a/stdio-common/tst-fphex.c
+++ b/stdio-common/tst-fphex.c
@@ -3,26 +3,22 @@
 #include <stdio.h>
 #include <string.h>
 
-#ifndef STR_LEN
+#ifndef WIDE
 # define STR_LEN strlen
-#endif
-#ifndef STR_CMP
 # define STR_CMP strcmp
-#endif
-#ifndef SPRINT
 # define SPRINT snprintf
-#endif
-#ifndef CHAR_T
 # define CHAR_T char
-#endif
-#ifndef PRINT
 # define PRINT printf
-#endif
-#ifndef L_
 # define L_(Str) Str
-#endif
-#ifndef L
-# define L
+# define S "%s"
+#else
+# define STR_LEN wcslen
+# define SPRINT swprintf
+# define STR_CMP wcscmp
+# define CHAR_T wchar_t
+# define PRINT wprintf
+# define L_(Str) L##Str
+# define S "%ls"
 #endif
 
 struct testcase
@@ -61,8 +57,9 @@ do_test (void)
       int n = SPRINT (buf, sizeof buf / sizeof (buf[0]), t->fmt, t->value);
       if (n != STR_LEN (t->expect) || STR_CMP (buf, t->expect) != 0)
 	{
-	  PRINT (L_("%" L "s\tExpected \"%" L "s\" (%Zu)\n\tGot      \"%" L
-		 "s\" (%d, %Zu)\n"), t->fmt, t->expect, STR_LEN (t->expect),
+	  PRINT (L_("" S "\tExpected \"" S "\" (%Zu)\n\tGot      \""
+		    S "\" (%d, %Zu)\n"),
+		 t->fmt, t->expect, STR_LEN (t->expect),
 		 buf, n, STR_LEN (buf));
 	  result = 1;
 	}