From 6c46718f9f0dc0756860988c36eacdefe1cd27a6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 Aug 2000 06:35:22 +0000 Subject: Update. * stdio-common/vfprintf.c: Handle %F format. * stdio-common/printf-parse.h (parse_one_spec): Likewise. Reported by Joseph S. Myers . * stdio-common/tstdiomisc.c: Add test for %F printf format. * po/zh.po: New file. --- stdio-common/tstdiomisc.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'stdio-common/tstdiomisc.c') diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c index 1affac5b51..55d77b0f29 100644 --- a/stdio-common/tstdiomisc.c +++ b/stdio-common/tstdiomisc.c @@ -1,4 +1,8 @@ +#include +#include #include +#include +#include int t1 (void) @@ -42,6 +46,36 @@ t2 (void) return result; } +int +F (void) +{ + char buf[20]; + wchar_t wbuf[10]; + int result; + + snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX, + DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX); + result = strcmp (buf, "nan NAN") != 0; + printf ("expected \"nan NAN\", got \"%s\"\n", buf); + + snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX, DBL_MAX * DBL_MAX); + result |= strcmp (buf, "inf INF") != 0; + printf ("expected \"inf INF\", got \"%s\"\n", buf); + + swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F", + DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX, + DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX); + result |= wcscmp (wbuf, L"nan NAN") != 0; + printf ("expected L\"nan NAN\", got L\"%S\"\n", wbuf); + + swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F", + DBL_MAX * DBL_MAX, DBL_MAX * DBL_MAX); + result |= wcscmp (wbuf, L"inf INF") != 0; + printf ("expected L\"inf INF\", got L\"%S\"\n", wbuf); + + return result; +} + int main (int argc, char *argv[]) { @@ -49,6 +83,7 @@ main (int argc, char *argv[]) result |= t1 (); result |= t2 (); + result |= F (); result |= fflush (stdout) == EOF; -- cgit v1.2.3