mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-29 14:01:20 +00:00
b9e8c90875
* stdio-common/bug25.c: Include stdlib.h. * support/tst-support_format_dns_packet.c: Include stdio.h, stdlib.h, and string.h. * support/tst-support_record_failure.c: Include string.h. * support/tst-support_record_failure-2.sh: Adjust line number expectations and correct a typo in an error message.
72 lines
1.5 KiB
C
72 lines
1.5 KiB
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
static const char expected[] = "\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55\
|
|
\n\
|
|
a\n\
|
|
abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
|
|
|
|
static int
|
|
do_test (void)
|
|
{
|
|
char *buf = malloc (strlen (expected) + 1);
|
|
snprintf (buf, strlen (expected) + 1,
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
|
|
"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
|
|
"a", "b", "c", "d", 5);
|
|
return strcmp (buf, expected) != 0;
|
|
}
|
|
|
|
#define TEST_FUNCTION do_test ()
|
|
#include "../test-skeleton.c"
|