This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 2/2] Add tests for the long double version of ecvt and fcvt


* Gabriel F. T. Gomes:

> diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt-template.c
> similarity index 60%
> rename from misc/tst-efgcvt.c
> rename to misc/tst-efgcvt-template.c
> index 5a598f49e3..69d253826c 100644
> --- a/misc/tst-efgcvt.c
> +++ b/misc/tst-efgcvt-template.c
> @@ -29,73 +29,74 @@

> +  { L (0.0), 0, 1, "" },

Do you need the L macro?  I would expect you can write the literal and
let the compiler handle the conversation.

> +  { L (10.0), 0, 2, "" },
> +  { L (10.0), 1, 2, "1" },
> +  { L (10.0), 5, 2, "10000" },
> +  { L (-12.0), 5, 2, "12000" },
> +  { L (0.2), 4, 0, "2000" },
> +  { L (0.02), 4, -1, "2000" },
> +  { L (5.5), 1, 1, "6" },
> +  { L (1.0), -1, 1, "" },
> +  { L (0.01), 2, -1, "10" },
> +  { L (100.0), -2, 3, "" },
> +  { L (100.0), -5, 3, "" },
> +  { L (100.0), -4, 3, "" },
> +  { L (100.01), -4, 3, "" },
> +  { L (123.01), -4, 3, "" },
> +  { L (126.71), -4, 3, "" },
> +  { L (0.0), 4, 1, "0000" },
>  #if DBL_MANT_DIG == 53
> -  { 0x1p-1074, 3, -323, "494" },
> -  { -0x1p-1074, 3, -323, "494" },
> +  { L (0x1p-1074), 3, -323, "494" },
> +  { L (-0x1p-1074), 3, -323, "494" },
>  #endif

The preprocessor condition seems wrong for the long double version of
the tests.  Does something like DBL_MANT_DIG even exist for IBM long
double?

My feeling is that we need an EXTRA_ECVT_TESTS macro, or separate
(second) test array definition.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]