Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
2012-05-24 Jeff Law <law@redhat.com>
* stdio-common/Makefile (tests): Add bug25. * stdio-common/bug25.c: New test.
- Loading branch information
Jeff Law
committed
May 25, 2012
1 parent
347c92e
commit b0bc23a
Showing
3 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include <stdio.h> | ||
#include <string.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" |