[PATCHv3 2/3] Refactor tst-strtod-round.c for type-generic-ness
Joseph Myers
joseph@codesourcery.com
Tue May 24 17:43:00 GMT 2016
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
More information about the Libc-alpha
mailing list