mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
Clean up tst-fphex test
This commit is contained in:
parent
ca2ff9fc04
commit
aea5d7277a
@ -1,3 +1,11 @@
|
|||||||
|
2012-03-08 Ulrich Drepper <drepper@gmail.com>
|
||||||
|
|
||||||
|
* stdio-common/tst-fphex.c: Various cleanups. The macros cannot
|
||||||
|
be defined individually, they must be defined as a block. Define
|
||||||
|
S for printing a string instead of hidint the different by using a
|
||||||
|
macro for adding the 'l'.
|
||||||
|
* stdio-common/tst-fphex-wide.c: Adjust.
|
||||||
|
|
||||||
2012-03-07 Marek Polacek <polacek@redhat.com>
|
2012-03-07 Marek Polacek <polacek@redhat.com>
|
||||||
|
|
||||||
* stdio-common/tst-long-dbl-fphex.c: Fix test for non ldbl-96 targets.
|
* stdio-common/tst-long-dbl-fphex.c: Fix test for non ldbl-96 targets.
|
||||||
|
@ -19,12 +19,6 @@
|
|||||||
|
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
#define STR_LEN wcslen
|
#define WIDE 1
|
||||||
#define SPRINT swprintf
|
|
||||||
#define STR_CMP wcscmp
|
|
||||||
#define CHAR_T wchar_t
|
|
||||||
#define PRINT wprintf
|
|
||||||
#define L_(Str) L##Str
|
|
||||||
#define L "l"
|
|
||||||
|
|
||||||
#include "tst-fphex.c"
|
#include "tst-fphex.c"
|
||||||
|
@ -3,26 +3,22 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef STR_LEN
|
#ifndef WIDE
|
||||||
# define STR_LEN strlen
|
# define STR_LEN strlen
|
||||||
#endif
|
|
||||||
#ifndef STR_CMP
|
|
||||||
# define STR_CMP strcmp
|
# define STR_CMP strcmp
|
||||||
#endif
|
|
||||||
#ifndef SPRINT
|
|
||||||
# define SPRINT snprintf
|
# define SPRINT snprintf
|
||||||
#endif
|
|
||||||
#ifndef CHAR_T
|
|
||||||
# define CHAR_T char
|
# define CHAR_T char
|
||||||
#endif
|
|
||||||
#ifndef PRINT
|
|
||||||
# define PRINT printf
|
# define PRINT printf
|
||||||
#endif
|
|
||||||
#ifndef L_
|
|
||||||
# define L_(Str) Str
|
# define L_(Str) Str
|
||||||
#endif
|
# define S "%s"
|
||||||
#ifndef L
|
#else
|
||||||
# define L
|
# 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
|
#endif
|
||||||
|
|
||||||
struct testcase
|
struct testcase
|
||||||
@ -61,8 +57,9 @@ do_test (void)
|
|||||||
int n = SPRINT (buf, sizeof buf / sizeof (buf[0]), t->fmt, t->value);
|
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)
|
if (n != STR_LEN (t->expect) || STR_CMP (buf, t->expect) != 0)
|
||||||
{
|
{
|
||||||
PRINT (L_("%" L "s\tExpected \"%" L "s\" (%Zu)\n\tGot \"%" L
|
PRINT (L_("" S "\tExpected \"" S "\" (%Zu)\n\tGot \""
|
||||||
"s\" (%d, %Zu)\n"), t->fmt, t->expect, STR_LEN (t->expect),
|
S "\" (%d, %Zu)\n"),
|
||||||
|
t->fmt, t->expect, STR_LEN (t->expect),
|
||||||
buf, n, STR_LEN (buf));
|
buf, n, STR_LEN (buf));
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user