Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libm fix test; clearing the exception does not ret...



details:   https://anonhg.NetBSD.org/src/rev/833417740539
branches:  trunk
changeset: 347400:833417740539
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 24 10:04:53 2016 +0000

description:
fix test; clearing the exception does not return the old exception bitmask.

diffstat:

 tests/lib/libm/t_ilogb.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (39 lines):

diff -r 888b234fa699 -r 833417740539 tests/lib/libm/t_ilogb.c
--- a/tests/lib/libm/t_ilogb.c  Wed Aug 24 10:03:32 2016 +0000
+++ b/tests/lib/libm/t_ilogb.c  Wed Aug 24 10:04:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ilogb.c,v 1.4 2016/08/24 09:13:44 christos Exp $ */
+/* $NetBSD: t_ilogb.c,v 1.5 2016/08/24 10:04:53 christos Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -40,15 +40,15 @@
 
 #else
 # define ATF_CHECK_RAISED_INVALID do { \
-       int r; \
-       r = feclearexcept(FE_ALL_EXCEPT); \
-       ATF_CHECK(r == FE_INVALID); \
+       int r = fetestexcept(FE_ALL_EXCEPT); \
+       ATF_CHECK_MSG(r == FE_INVALID, "r=%#x != %#x\n", r, FE_INVALID); \
+       (void)feclearexcept(FE_ALL_EXCEPT); \
 } while (/*CONSTCOND*/0)
 
 # define ATF_CHECK_RAISED_NOTHING do { \
-       int r; \
-       r = feclearexcept(FE_ALL_EXCEPT); \
-       ATF_CHECK(r == 0); \
+       int r = fetestexcept(FE_ALL_EXCEPT); \
+       ATF_CHECK_MSG(r == 0, "r=%#x != 0\n", r); \
+       (void)feclearexcept(FE_ALL_EXCEPT); \
 } while (/*CONSTCOND*/0)
 #endif
 
@@ -60,7 +60,6 @@
 
 ATF_TC_BODY(ilogb, tc)
 {
-  atf_tc_expect_fail("PR lib/51427");
 
        ATF_CHECK(ilogbf(0) == FP_ILOGB0);
        ATF_CHECK_RAISED_INVALID;



Home | Main Index | Thread Index | Old Index