Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libm If one of the tests with eps fails, print the...



details:   https://anonhg.NetBSD.org/src/rev/96b1b9860a25
branches:  trunk
changeset: 778384:96b1b9860a25
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Mar 23 23:45:31 2012 +0000

description:
If one of the tests with eps fails, print the failing eps.

diffstat:

 tests/lib/libm/t_acos.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 2563bc4d078d -r 96b1b9860a25 tests/lib/libm/t_acos.c
--- a/tests/lib/libm/t_acos.c   Fri Mar 23 23:14:34 2012 +0000
+++ b/tests/lib/libm/t_acos.c   Fri Mar 23 23:45:31 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_acos.c,v 1.2 2011/09/18 04:48:38 jruoho Exp $ */
+/* $NetBSD: t_acos.c,v 1.3 2012/03/23 23:45:31 matt Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -138,8 +138,9 @@
                y = acos(cos(x[i]));
 
                if (fabs(y - x[i]) > eps)
-                       atf_tc_fail_nonfatal("acos(cos(%0.03f)) != %0.03f",
-                           x[i], x[i]);
+                       atf_tc_fail_nonfatal(
+                           "acos(cos(%0.03f)) != %0.03f (eps=%0.03e)",
+                           x[i], x[i], fabs(y - x[i]));
        }
 #endif
 }
@@ -250,8 +251,9 @@
                y = acosf(cosf(x[i]));
 
                if (fabsf(y - x[i]) > eps)
-                       atf_tc_fail_nonfatal("acosf(cosf(%0.03f)) != %0.03f",
-                           x[i], x[i]);
+                       atf_tc_fail_nonfatal(
+                           "acosf(cosf(%0.03f)) != %0.03f (eps=%0.03e)",
+                           x[i], x[i], fabs(y - x[i]));
        }
 #endif
 }



Home | Main Index | Thread Index | Old Index