mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-130317: Skip test_pack_unpack_roundtrip_for_nans() on x86 (#133155)
Reduce also the number of iterations from 1000 to 10 to ease debugging failures and prevent "command line too line" error when tests are re-run.
This commit is contained in:
parent
60202609a2
commit
0f23e84cda
1 changed files with 9 additions and 2 deletions
|
@ -180,10 +180,17 @@ class CAPIFloatTest(unittest.TestCase):
|
||||||
self.assertEqual(value2, value)
|
self.assertEqual(value2, value)
|
||||||
|
|
||||||
@unittest.skipUnless(HAVE_IEEE_754, "requires IEEE 754")
|
@unittest.skipUnless(HAVE_IEEE_754, "requires IEEE 754")
|
||||||
|
# Skip on x86 (32-bit), since these tests fail. The problem is that sNaN
|
||||||
|
# doubles become qNaN doubles just by the C calling convention, there is no
|
||||||
|
# way to preserve sNaN doubles between C function calls. But tests pass
|
||||||
|
# on Windows x86.
|
||||||
|
@unittest.skipIf((sys.maxsize == 2147483647) and not(sys.platform == 'win32'),
|
||||||
|
'test fails on x86 (32-bit)')
|
||||||
def test_pack_unpack_roundtrip_for_nans(self):
|
def test_pack_unpack_roundtrip_for_nans(self):
|
||||||
pack = _testcapi.float_pack
|
pack = _testcapi.float_pack
|
||||||
unpack = _testcapi.float_unpack
|
unpack = _testcapi.float_unpack
|
||||||
for _ in range(1000):
|
|
||||||
|
for _ in range(10):
|
||||||
for size in (2, 4, 8):
|
for size in (2, 4, 8):
|
||||||
sign = random.randint(0, 1)
|
sign = random.randint(0, 1)
|
||||||
signaling = random.randint(0, 1)
|
signaling = random.randint(0, 1)
|
||||||
|
@ -203,7 +210,7 @@ class CAPIFloatTest(unittest.TestCase):
|
||||||
data1 = data if endian == BIG_ENDIAN else data[::-1]
|
data1 = data if endian == BIG_ENDIAN else data[::-1]
|
||||||
value = unpack(data1, endian)
|
value = unpack(data1, endian)
|
||||||
if signaling and sys.platform == 'win32':
|
if signaling and sys.platform == 'win32':
|
||||||
# On this platform sNaN becomes qNaN when returned
|
# On Windows x86, sNaN becomes qNaN when returned
|
||||||
# from function. That's a known bug, e.g.
|
# from function. That's a known bug, e.g.
|
||||||
# https://developercommunity.visualstudio.com/t/155064
|
# https://developercommunity.visualstudio.com/t/155064
|
||||||
# (see also gh-130317).
|
# (see also gh-130317).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue