1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-01 12:19:28 +00:00

logarithm_test: assert that feclearexcept succeeds

This helps ensure that test preconditons are fulfilled.

MFC after:	3 days
Reported by:	Coverity
CID:		1346572
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-05-29 18:49:28 +00:00
parent 2dd512c37f
commit b97ee15f62
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319158

View File

@ -137,7 +137,7 @@ run_log2_tests(void)
* We should insist that log2() return exactly the correct
* result and not raise an inexact exception for powers of 2.
*/
feclearexcept(FE_ALL_EXCEPT);
assert(feclearexcept(FE_ALL_EXCEPT) == 0);
for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) {
assert(log2f(ldexpf(1.0, i)) == i);
assert(fetestexcept(ALL_STD_EXCEPT) == 0);