This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv3 2/3] Refactor tst-strtod-round.c for type-generic-ness
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 24 May 2016 17:40:38 +0000
- Subject: Re: [PATCHv3 2/3] Refactor tst-strtod-round.c for type-generic-ness
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1464041464 dot git dot murphyp at linux dot vnet dot ibm dot com> <8e5e98006235dcad1d036d3e71e51615cfd79286 dot 1464041464 dot git dot murphyp at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1605241519530 dot 23091 at digraph dot polyomino dot org dot uk> <33b9acbd-5caf-c2c8-cf00-c8d50f5c2399 at linux dot vnet dot ibm dot com>
On Tue, 24 May 2016, Paul E. Murphy wrote:
> My intent for the header is to move all the type specific bits into
> one file to make the test themselves type-generic. If we want it to be
> exclusively common code supporting type generic tests, I should push
> all of the changes to tst-strtod.h back into tst-strtod-round.c.
I think it should just be common code. The right way to make a test
type-generic varies case by case; a type-generic test may still contain
code relating to individual types as long as it's well-factored to make
adding new types as simple as possible and the per-type code can't readily
share things with other tests through a common header.
(I am expecting existing type-generic tests such as
tst-strtod-nan-locale-main.c to be included in the addition of float128
support, whether or not they are first adapted to use tst-strtod.h to
avoid references to particular types within the tests.)
> My thinking was that in the future, gen-tst-strtod-round could be
> extended slightly to generate full test cases for strtod, and thus
I don't think that's appropriate. It could plausibly test for exceptions
/ errno in addition to what it already tests, but tests for e.g. how much
of the string is consumed (for strings with extra text after a number),
locales, infinities / NaNs etc. seem outside its scope.
--
Joseph S. Myers
joseph@codesourcery.com