|
37 | 37 | math_testcases = os.path.join(test_dir, 'mathdata', 'math_testcases.txt') |
38 | 38 | test_file = os.path.join(test_dir, 'mathdata', 'cmath_testcases.txt') |
39 | 39 |
|
40 | | -skip_on_newlib = unittest.skipIf(sys.platform == 'cygwin', |
41 | | - 'the test fails on newlib C library') |
42 | | - |
43 | 40 |
|
44 | 41 | def to_ulps(x): |
45 | 42 | """Convert a non-NaN float x to an integer, in such a way that |
@@ -925,7 +922,7 @@ def testHypot(self): |
925 | 922 | @requires_IEEE_754 |
926 | 923 | @unittest.skipIf(HAVE_DOUBLE_ROUNDING, |
927 | 924 | "hypot() loses accuracy on machines with double rounding") |
928 | | - @skip_on_newlib |
| 925 | + @support.skip_on_newlib |
929 | 926 | def testHypotAccuracy(self): |
930 | 927 | # Verify improved accuracy in cases that were known to be inaccurate. |
931 | 928 | # |
@@ -1248,7 +1245,7 @@ def testLog1p(self): |
1248 | 1245 | self.assertEqual(math.log1p(INF), INF) |
1249 | 1246 |
|
1250 | 1247 | @requires_IEEE_754 |
1251 | | - @skip_on_newlib |
| 1248 | + @support.skip_on_newlib |
1252 | 1249 | def testLog2(self): |
1253 | 1250 | self.assertRaises(TypeError, math.log2) |
1254 | 1251 |
|
@@ -1281,7 +1278,7 @@ def testLog2(self): |
1281 | 1278 | @requires_IEEE_754 |
1282 | 1279 | # log2() is not accurate enough on Mac OS X Tiger (10.4) |
1283 | 1280 | @support.requires_mac_ver(10, 5) |
1284 | | - @skip_on_newlib |
| 1281 | + @support.skip_on_newlib |
1285 | 1282 | def testLog2Exact(self): |
1286 | 1283 | # Check that we get exact equality for log2 of powers of 2. |
1287 | 1284 | actual = [math.log2(math.ldexp(1.0, n)) for n in range(-1074, 1024)] |
@@ -2621,7 +2618,7 @@ def test_fma_nan_results(self): |
2621 | 2618 | self.assertIsNaN(math.fma(a, math.nan, b)) |
2622 | 2619 | self.assertIsNaN(math.fma(a, b, math.nan)) |
2623 | 2620 |
|
2624 | | - @skip_on_newlib |
| 2621 | + @support.skip_on_newlib |
2625 | 2622 | def test_fma_infinities(self): |
2626 | 2623 | # Cases involving infinite inputs or results. |
2627 | 2624 | positives = [1e-300, 2.3, 1e300, math.inf] |
@@ -2750,7 +2747,7 @@ def test_fma_zero_result(self): |
2750 | 2747 | self.assertIsNegativeZero(math.fma(y-x, -(x+y), -z)) |
2751 | 2748 | self.assertIsPositiveZero(math.fma(x-y, -(x+y), z)) |
2752 | 2749 |
|
2753 | | - @skip_on_newlib |
| 2750 | + @support.skip_on_newlib |
2754 | 2751 | def test_fma_overflow(self): |
2755 | 2752 | a = b = float.fromhex('0x1p512') |
2756 | 2753 | c = float.fromhex('0x1p1023') |
@@ -2784,12 +2781,12 @@ def test_fma_overflow(self): |
2784 | 2781 | c = float.fromhex('0x1.fffffffffffffp+1023') |
2785 | 2782 | self.assertEqual(math.fma(a, b, -c), c) |
2786 | 2783 |
|
2787 | | - @skip_on_newlib |
| 2784 | + @support.skip_on_newlib |
2788 | 2785 | def test_fma_single_round(self): |
2789 | 2786 | a = float.fromhex('0x1p-50') |
2790 | 2787 | self.assertEqual(math.fma(a - 1.0, a + 1.0, 1.0), a*a) |
2791 | 2788 |
|
2792 | | - @skip_on_newlib |
| 2789 | + @support.skip_on_newlib |
2793 | 2790 | def test_random(self): |
2794 | 2791 | # A collection of randomly generated inputs for which the naive FMA |
2795 | 2792 | # (with two rounds) gives a different result from a singly-rounded FMA. |
|
0 commit comments