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
[BZ #3902]
2007-01-22 Ulrich Drepper <drepper@redhat.com> [BZ #3902] * stdio-common/_itoa.c (_itoa): Make sure at least a zero is emitted. * stdio-common/Makefile (tests): Add bug17. * stdio-common/bug17.c: New file.
- Loading branch information
Ulrich Drepper
committed
Jan 22, 2007
1 parent
439201d
commit 6cae395
Showing
4 changed files
with
44 additions
and
3 deletions.
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
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,31 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
static int | ||
do_test (void) | ||
{ | ||
static const char expect[] = "0, 0, 0"; | ||
char buf[100]; | ||
int status = 0; | ||
|
||
static const char fmt1[] = "%0d, %0ld, %0lld"; | ||
snprintf (buf, sizeof (buf), fmt1, 0, 0L, 0LL); | ||
if (strcmp (buf, expect) != 0) | ||
{ | ||
printf ("\"%s\": got \"%s\", expected \"%s\"\n", fmt1, buf, expect); | ||
status = 1; | ||
} | ||
|
||
static const char fmt2[] = "%0u, %0lu, %0llu"; | ||
snprintf (buf, sizeof (buf), fmt2, 0u, 0uL, 0uLL); | ||
if (strcmp (buf, expect) != 0) | ||
{ | ||
printf ("\"%s\": got \"%s\", expected \"%s\"\n", fmt2, buf, expect); | ||
status = 1; | ||
} | ||
|
||
return status; | ||
} | ||
|
||
#define TEST_FUNCTION do_test () | ||
#include "../test-skeleton.c" |