Sat Mar 10 20:11:01 2012 UTC ()
Point to PR port-i386/46108 when failing on i386.


(jruoho)
diff -r1.3 -r1.4 src/tests/lib/libm/t_atan.c

cvs diff -r1.3 -r1.4 src/tests/lib/libm/t_atan.c (expand / switch to unified diff)

--- src/tests/lib/libm/t_atan.c 2012/02/28 08:58:39 1.3
+++ src/tests/lib/libm/t_atan.c 2012/03/10 20:11:01 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: t_atan.c,v 1.3 2012/02/28 08:58:39 pgoyette Exp $ */ 1/* $NetBSD: t_atan.c,v 1.4 2012/03/10 20:11:01 jruoho Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2011 The NetBSD Foundation, Inc. 4 * Copyright (c) 2011 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jukka Ruohonen. 8 * by Jukka Ruohonen.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,29 @@ @@ -20,27 +20,29 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <atf-c.h> 32#include <atf-c.h>
 33#include <atf-c/config.h>
33#include <math.h> 34#include <math.h>
 35#include <string.h>
34 36
35/* 37/*
36 * atan(3) 38 * atan(3)
37 */ 39 */
38ATF_TC(atan_nan); 40ATF_TC(atan_nan);
39ATF_TC_HEAD(atan_nan, tc) 41ATF_TC_HEAD(atan_nan, tc)
40{ 42{
41 atf_tc_set_md_var(tc, "descr", "Test atan(NaN) == NaN"); 43 atf_tc_set_md_var(tc, "descr", "Test atan(NaN) == NaN");
42} 44}
43 45
44ATF_TC_BODY(atan_nan, tc) 46ATF_TC_BODY(atan_nan, tc)
45{ 47{
46#ifndef __vax__ 48#ifndef __vax__
@@ -53,62 +55,71 @@ ATF_TC_BODY(atan_nan, tc) @@ -53,62 +55,71 @@ ATF_TC_BODY(atan_nan, tc)
53 55
54ATF_TC(atan_inf_neg); 56ATF_TC(atan_inf_neg);
55ATF_TC_HEAD(atan_inf_neg, tc) 57ATF_TC_HEAD(atan_inf_neg, tc)
56{ 58{
57 atf_tc_set_md_var(tc, "descr", "Test atan(-Inf) == -pi/2"); 59 atf_tc_set_md_var(tc, "descr", "Test atan(-Inf) == -pi/2");
58} 60}
59 61
60ATF_TC_BODY(atan_inf_neg, tc) 62ATF_TC_BODY(atan_inf_neg, tc)
61{ 63{
62#ifndef __vax__ 64#ifndef __vax__
63 const double x = -1.0L / 0.0L; 65 const double x = -1.0L / 0.0L;
64 const double eps = 1.0e-40; 66 const double eps = 1.0e-40;
65 67
 68 if (strcmp(atf_config_get("atf_arch"), "i386") == 0)
 69 atf_tc_expect_fail("PR port-i386/46108");
 70
66 if (fabs(atan(x) + M_PI_2) > eps) 71 if (fabs(atan(x) + M_PI_2) > eps)
67 atf_tc_fail_nonfatal("atan(-Inf) != -pi/2"); 72 atf_tc_fail_nonfatal("atan(-Inf) != -pi/2");
68#endif 73#endif
69} 74}
70 75
71ATF_TC(atan_inf_pos); 76ATF_TC(atan_inf_pos);
72ATF_TC_HEAD(atan_inf_pos, tc) 77ATF_TC_HEAD(atan_inf_pos, tc)
73{ 78{
74 atf_tc_set_md_var(tc, "descr", "Test atan(+Inf) == pi/2"); 79 atf_tc_set_md_var(tc, "descr", "Test atan(+Inf) == pi/2");
75} 80}
76 81
77ATF_TC_BODY(atan_inf_pos, tc) 82ATF_TC_BODY(atan_inf_pos, tc)
78{ 83{
79#ifndef __vax__ 84#ifndef __vax__
80 const double x = +1.0L / 0.0L; 85 const double x = +1.0L / 0.0L;
81 const double eps = 1.0e-40; 86 const double eps = 1.0e-40;
82 87
 88 if (strcmp(atf_config_get("atf_arch"), "i386") == 0)
 89 atf_tc_expect_fail("PR port-i386/46108");
 90
83 if (fabs(atan(x) - M_PI_2) > eps) 91 if (fabs(atan(x) - M_PI_2) > eps)
84 atf_tc_fail_nonfatal("atan(+Inf) != pi/2"); 92 atf_tc_fail_nonfatal("atan(+Inf) != pi/2");
85#endif 93#endif
86} 94}
87 95
88ATF_TC(atan_tan); 96ATF_TC(atan_tan);
89ATF_TC_HEAD(atan_tan, tc) 97ATF_TC_HEAD(atan_tan, tc)
90{ 98{
91 atf_tc_set_md_var(tc, "descr", "Test atan(tan(x)) == x"); 99 atf_tc_set_md_var(tc, "descr", "Test atan(tan(x)) == x");
92} 100}
93 101
94ATF_TC_BODY(atan_tan, tc) 102ATF_TC_BODY(atan_tan, tc)
95{ 103{
96#ifndef __vax__ 104#ifndef __vax__
97 const double x[] = { 0.0, 1.0, M_PI / 2, M_PI / 3, M_PI / 6 }; 105 const double x[] = { 0.0, 1.0, M_PI / 2, M_PI / 3, M_PI / 6 };
98 const double eps = 1.0e-40; 106 const double eps = 1.0e-40;
99 double y; 107 double y;
100 size_t i; 108 size_t i;
101 109
 110 if (strcmp(atf_config_get("atf_arch"), "i386") == 0)
 111 atf_tc_expect_fail("PR port-i386/46108");
 112
102 for (i = 0; i < __arraycount(x); i++) { 113 for (i = 0; i < __arraycount(x); i++) {
103 114
104 y = atan(tan(x[i])); 115 y = atan(tan(x[i]));
105 116
106 if (fabs(y - x[i]) > eps) 117 if (fabs(y - x[i]) > eps)
107 atf_tc_fail_nonfatal("atan(tan(%0.03f)) != %0.03f", 118 atf_tc_fail_nonfatal("atan(tan(%0.03f)) != %0.03f",
108 x[i], x[i]); 119 x[i], x[i]);
109 } 120 }
110#endif 121#endif
111} 122}
112 123
113ATF_TC(atan_zero_neg); 124ATF_TC(atan_zero_neg);
114ATF_TC_HEAD(atan_zero_neg, tc) 125ATF_TC_HEAD(atan_zero_neg, tc)