]> git.ipfire.org Git - thirdparty/glibc.git/commit
More thoroughly test underflow / errno in tst-strtod-round
authorJoseph Myers <josmyers@redhat.com>
Tue, 27 Aug 2024 12:38:01 +0000 (12:38 +0000)
committerArjun Shankar <arjun@redhat.com>
Fri, 27 Sep 2024 15:25:43 +0000 (17:25 +0200)
commit9cfeccf65ab8aedb2353d89a1ef8b4e775d6f925
treec4535584e6470326871af50cd86b733aae5d25c8
parent293e4e3c90e390fa0b839c66f388a723ac6787e2
More thoroughly test underflow / errno in tst-strtod-round

Add tests of underflow in tst-strtod-round, and thus also test for
errno being unchanged when there is neither overflow nor underflow.
The errno setting before the function call to test for being unchanged
is adjusted to set errno to 12345 instead of 0, so that any bugs where
strtod sets errno to 0 would be detected.

This doesn't add any new test inputs for tst-strtod-round, and in
particular doesn't cover the edge cases of underflow the way
tst-strtod-underflow does (none of the existing test inputs for
tst-strtod-round actually exercise cases that have underflow with
before-rounding tininess detection but not with after-rounding
tininess detection), but at least it provides some coverage (as per
the recent discussions) that ordinary non-overflowing non-underflowing
inputs to these functions do not set errno.

Tested for x86_64.

(cherry picked from commit d73ed2601b7c3c93c3529149a3d7f7b6177900a8)
stdlib/gen-tst-strtod-round.c
stdlib/tst-strtod-round-data.h
stdlib/tst-strtod-round-skeleton.c