Thu May 9 14:00:59 2024 UTC (10d)
tests/lib/libm/t_infinity: Remove broken long double conditional.

LDBL_MAX is always defined, so this branch is dead.  (If LDBL_MAX is
not defined, that's a bug in the architecture's float.h, not a reason
to skip a test.)


(riastradh)
diff -r1.6 -r1.7 src/tests/lib/libm/t_infinity.c

cvs diff -r1.6 -r1.7 src/tests/lib/libm/t_infinity.c (expand / switch to unified diff)

--- src/tests/lib/libm/t_infinity.c 2012/09/26 07:24:38 1.6
+++ src/tests/lib/libm/t_infinity.c 2024/05/09 14:00:58 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: t_infinity.c,v 1.6 2012/09/26 07:24:38 jruoho Exp $ */ 1/* $NetBSD: t_infinity.c,v 1.7 2024/05/09 14:00:58 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002, 2008 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 Martin Husemann <martin@NetBSD.org>. 8 * by Martin Husemann <martin@NetBSD.org>.
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.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
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#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__RCSID("$NetBSD: t_infinity.c,v 1.6 2012/09/26 07:24:38 jruoho Exp $"); 32__RCSID("$NetBSD: t_infinity.c,v 1.7 2024/05/09 14:00:58 riastradh Exp $");
33 33
34#include <atf-c.h> 34#include <atf-c.h>
35#include <math.h> 35#include <math.h>
36#include <float.h> 36#include <float.h>
37#include <stdlib.h> 37#include <stdlib.h>
38 38
39ATF_TC(infinity_float); 39ATF_TC(infinity_float);
40ATF_TC_HEAD(infinity_float, tc) 40ATF_TC_HEAD(infinity_float, tc)
41{ 41{
42 atf_tc_set_md_var(tc, "descr", 42 atf_tc_set_md_var(tc, "descr",
43 "check FPU generated infinite float values"); 43 "check FPU generated infinite float values");
44} 44}
45 45
@@ -79,41 +79,35 @@ ATF_TC_BODY(infinity_double, tc) @@ -79,41 +79,35 @@ ATF_TC_BODY(infinity_double, tc)
79 ATF_REQUIRE(isinf(v)); 79 ATF_REQUIRE(isinf(v));
80 ATF_REQUIRE(fpclassify(v) == FP_INFINITE); 80 ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
81} 81}
82 82
83ATF_TC(infinity_long_double); 83ATF_TC(infinity_long_double);
84ATF_TC_HEAD(infinity_long_double, tc) 84ATF_TC_HEAD(infinity_long_double, tc)
85{ 85{
86 atf_tc_set_md_var(tc, "descr", 86 atf_tc_set_md_var(tc, "descr",
87 "check FPU generated infinite long double values"); 87 "check FPU generated infinite long double values");
88} 88}
89 89
90ATF_TC_BODY(infinity_long_double, tc) 90ATF_TC_BODY(infinity_long_double, tc)
91{ 91{
92 
93#ifndef LDBL_MAX 
94 atf_tc_skip("no long double support on this architecture"); 
95 return; 
96#else 
97 long double v; 92 long double v;
98 93
99 v = LDBL_MAX; 94 v = LDBL_MAX;
100 v *= v; 95 v *= v;
101 ATF_REQUIRE(isinf(v)); 96 ATF_REQUIRE(isinf(v));
102 ATF_REQUIRE(fpclassify(v) == FP_INFINITE); 97 ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
103 98
104 v = -LDBL_MAX; 99 v = -LDBL_MAX;
105 v *= v; 100 v *= v;
106 ATF_REQUIRE(isinf(v)); 101 ATF_REQUIRE(isinf(v));
107 ATF_REQUIRE(fpclassify(v) == FP_INFINITE); 102 ATF_REQUIRE(fpclassify(v) == FP_INFINITE);
108#endif 
109} 103}
110 104
111ATF_TP_ADD_TCS(tp) 105ATF_TP_ADD_TCS(tp)
112{ 106{
113 107
114 ATF_TP_ADD_TC(tp, infinity_float); 108 ATF_TP_ADD_TC(tp, infinity_float);
115 ATF_TP_ADD_TC(tp, infinity_double); 109 ATF_TP_ADD_TC(tp, infinity_double);
116 ATF_TP_ADD_TC(tp, infinity_long_double); 110 ATF_TP_ADD_TC(tp, infinity_long_double);
117 111
118 return atf_no_error(); 112 return atf_no_error();
119} 113}