Module Name: src Committed By: isaki Date: Thu Mar 21 02:10:52 UTC 2013
Modified Files: src/tests/lib/libm: t_atan.c Log Message: Fix and revive test of atan_inf_neg, atan_inf_pos and atan_tan on i386. PR port-i386/46108. The machine epsilon 1.0e-40 is too severe and nonsense for double because DBL_EPSILON is about 2.2e-16 . I think that 1.0e-15 is enough good, in this case. XXX However, test of atan_tan should be replaced for other reasons. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libm/t_atan.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libm/t_atan.c diff -u src/tests/lib/libm/t_atan.c:1.6 src/tests/lib/libm/t_atan.c:1.7 --- src/tests/lib/libm/t_atan.c:1.6 Sun Mar 11 06:36:05 2012 +++ src/tests/lib/libm/t_atan.c Thu Mar 21 02:10:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: t_atan.c,v 1.6 2012/03/11 06:36:05 jruoho Exp $ */ +/* $NetBSD: t_atan.c,v 1.7 2013/03/21 02:10:52 isaki Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -64,11 +64,7 @@ ATF_TC_BODY(atan_inf_neg, tc) { #ifndef __vax__ const double x = -1.0L / 0.0L; - const double eps = 1.0e-40; - - if (strcmp(atf_config_get("atf_arch"), "i386") == 0 && - system("cpuctl identify 0 | grep -q QEMU") != 0) - atf_tc_expect_fail("PR port-i386/46108"); + const double eps = 1.0e-15; if (fabs(atan(x) + M_PI_2) > eps) atf_tc_fail_nonfatal("atan(-Inf) != -pi/2"); @@ -85,11 +81,7 @@ ATF_TC_BODY(atan_inf_pos, tc) { #ifndef __vax__ const double x = +1.0L / 0.0L; - const double eps = 1.0e-40; - - if (strcmp(atf_config_get("atf_arch"), "i386") == 0 && - system("cpuctl identify 0 | grep -q QEMU") != 0) - atf_tc_expect_fail("PR port-i386/46108"); + const double eps = 1.0e-15; if (fabs(atan(x) - M_PI_2) > eps) atf_tc_fail_nonfatal("atan(+Inf) != pi/2"); @@ -106,14 +98,10 @@ ATF_TC_BODY(atan_tan, tc) { #ifndef __vax__ const double x[] = { 0.0, 1.0, M_PI / 2, M_PI / 3, M_PI / 6 }; - const double eps = 1.0e-40; + const double eps = 1.0e-15; double y; size_t i; - if (strcmp(atf_config_get("atf_arch"), "i386") == 0 && - system("cpuctl identify 0 | grep -q QEMU") != 0) - atf_tc_expect_fail("PR port-i386/46108"); - for (i = 0; i < __arraycount(x); i++) { y = atan(tan(x[i]));