PR/51839: Ngie Cooper: reset errno to 0 before calling scalbn*

This commit is contained in:
christos 2017-01-13 19:26:03 +00:00
parent 6660f1abd6
commit 5d4836fefb

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_scalbn.c,v 1.11 2014/03/03 10:39:08 martin Exp $ */
/* $NetBSD: t_scalbn.c,v 1.12 2017/01/13 19:26:03 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_scalbn.c,v 1.11 2014/03/03 10:39:08 martin Exp $");
__RCSID("$NetBSD: t_scalbn.c,v 1.12 2017/01/13 19:26:03 christos Exp $");
#include <math.h>
#include <limits.h>
@ -81,6 +81,7 @@ ATF_TC_BODY(scalbn_val, tc)
double rv;
for (i = 0; i < tcnt; i++) {
errno = 0
rv = scalbn(tests[i].inval, tests[i].exp);
ATF_CHECK_EQ_MSG(errno, tests[i].error,
"test %zu: errno %d instead of %d", i, errno,
@ -222,6 +223,7 @@ ATF_TC_BODY(scalbnf_val, tc)
double rv;
for (i = 0; i < tcnt; i++) {
errno = 0
rv = scalbnf(tests[i].inval, tests[i].exp);
ATF_CHECK_EQ_MSG(errno, tests[i].error,
"test %zu: errno %d instead of %d", i, errno,
@ -366,6 +368,7 @@ ATF_TC_BODY(scalbnl_val, tc)
long double rv;
for (i = 0; i < tcnt; i++) {
errno = 0
rv = scalbnl(tests[i].inval, tests[i].exp);
ATF_CHECK_EQ_MSG(errno, tests[i].error,
"test %zu: errno %d instead of %d", i, errno,