aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/tst-fphex.c
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
committerZack Weinberg <zackw@panix.com>2017-06-08 15:39:03 -0400
commit5046dbb4a7eba5eccfd258f92f4735c9ffc8d069 (patch)
tree4470480d904b65cf14ca524f96f79eca818c3eaf /stdio-common/tst-fphex.c
parent199fc19d3aaaf57944ef036e15904febe877fc93 (diff)
downloadglibc-zack/build-layout-experiment.tar
glibc-zack/build-layout-experiment.tar.gz
glibc-zack/build-layout-experiment.tar.bz2
glibc-zack/build-layout-experiment.zip
Prepare for radical source tree reorganization.zack/build-layout-experiment
All top-level files and directories are moved into a temporary storage directory, REORG.TODO, except for files that will certainly still exist in their current form at top level when we're done (COPYING, COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which are moved to the new directory OldChangeLogs, instead), and the generated file INSTALL (which is just deleted; in the new order, there will be no generated files checked into version control).
Diffstat (limited to 'stdio-common/tst-fphex.c')
-rw-r--r--stdio-common/tst-fphex.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/stdio-common/tst-fphex.c b/stdio-common/tst-fphex.c
deleted file mode 100644
index c2e8961d62..0000000000
--- a/stdio-common/tst-fphex.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Test program for %a printf formats. */
-
-#include <stdio.h>
-#include <string.h>
-
-#ifndef WIDE
-# define STR_LEN strlen
-# define STR_CMP strcmp
-# define SPRINT snprintf
-# define CHAR_T char
-# define PRINT printf
-# define L_(Str) Str
-# define S "%s"
-#else
-# 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
-
-struct testcase
-{
- double value;
- const CHAR_T *fmt;
- const CHAR_T *expect;
-};
-
-static const struct testcase testcases[] =
- {
- { 0x0.0030p+0, L_("%a"), L_("0x1.8p-11") },
- { 0x0.0040p+0, L_("%a"), L_("0x1p-10") },
- { 0x0.0030p+0, L_("%040a"), L_("0x00000000000000000000000000000001.8p-11") },
- { 0x0.0040p+0, L_("%040a"), L_("0x0000000000000000000000000000000001p-10") },
- { 0x0.0040p+0, L_("%40a"), L_(" 0x1p-10") },
- { 0x0.0040p+0, L_("%#40a"), L_(" 0x1.p-10") },
- { 0x0.0040p+0, L_("%-40a"), L_("0x1p-10 ") },
- { 0x0.0040p+0, L_("%#-40a"), L_("0x1.p-10 ") },
- { 0x0.0030p+0, L_("%040e"), L_("00000000000000000000000000007.324219e-04") },
- { 0x0.0040p+0, L_("%040e"), L_("00000000000000000000000000009.765625e-04") },
- };
-
-
-static int
-do_test (void)
-{
- const struct testcase *t;
- int result = 0;
-
- for (t = testcases;
- t < &testcases[sizeof testcases / sizeof testcases[0]];
- ++t)
- {
- CHAR_T buf[1024];
- 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)
- {
- PRINT (L_("" S "\tExpected \"" S "\" (%Zu)\n\tGot \""
- S "\" (%d, %Zu)\n"),
- t->fmt, t->expect, STR_LEN (t->expect),
- buf, n, STR_LEN (buf));
- result = 1;
- }
- }
-
- return result;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"