@@ -180,10 +180,17 @@ def test_pack_unpack_roundtrip(self):
180
180
self .assertEqual (value2 , value )
181
181
182
182
@unittest .skipUnless (HAVE_IEEE_754 , "requires IEEE 754" )
183
+ # Skip on x86 (32-bit), since these tests fail. The problem is that sNaN
184
+ # doubles become qNaN doubles just by the C calling convention, there is no
185
+ # way to preserve sNaN doubles between C function calls. But tests pass
186
+ # on Windows x86.
187
+ @unittest .skipIf ((sys .maxsize == 2147483647 ) and not (sys .platform == 'win32' ),
188
+ 'test fails on x86 (32-bit)' )
183
189
def test_pack_unpack_roundtrip_for_nans (self ):
184
190
pack = _testcapi .float_pack
185
191
unpack = _testcapi .float_unpack
186
- for _ in range (1000 ):
192
+
193
+ for _ in range (10 ):
187
194
for size in (2 , 4 , 8 ):
188
195
sign = random .randint (0 , 1 )
189
196
signaling = random .randint (0 , 1 )
@@ -203,7 +210,7 @@ def test_pack_unpack_roundtrip_for_nans(self):
203
210
data1 = data if endian == BIG_ENDIAN else data [::- 1 ]
204
211
value = unpack (data1 , endian )
205
212
if signaling and sys .platform == 'win32' :
206
- # On this platform sNaN becomes qNaN when returned
213
+ # On Windows x86, sNaN becomes qNaN when returned
207
214
# from function. That's a known bug, e.g.
208
215
# https://developercommunity.visualstudio.com/t/155064
209
216
# (see also gh-130317).
0 commit comments