summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-09-11 18:32:30 (GMT)
committerGuido van Rossum <guido@python.org>2002-09-11 18:32:30 (GMT)
commitc8060a68ffc3d9051c3c876c1d21cba8330dbb10 (patch)
tree0c92af2d2180613d8608808c9b548c00a0f55343
parent4061cbee9c2dd6fd6d186f525af8925a44f4d2fc (diff)
downloadcpython-c8060a68ffc3d9051c3c876c1d21cba8330dbb10.zip
cpython-c8060a68ffc3d9051c3c876c1d21cba8330dbb10.tar.gz
cpython-c8060a68ffc3d9051c3c876c1d21cba8330dbb10.tar.bz2
The list(xrange(sys.maxint / 4)) test blew up on 64-bit platforms.
Because ob_size is a 32-bit int but sys.maxint is LONG_MAX which is a 64-bit value, there's no way to make this test succeed on a 64-bit platform. So just skip it when sys.maxint isn't 0x7fffffff. Backport candidate.
-rw-r--r--Lib/test/test_b1.py36
1 files changed, 21 insertions, 15 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py
index 5536246..c90cadb 100644
--- a/Lib/test/test_b1.py
+++ b/Lib/test/test_b1.py
@@ -533,21 +533,27 @@ if list((0, 1, 2, 3)) != [0, 1, 2, 3]: raise TestFailed, 'list((0, 1, 2, 3))'
if list('') != []: raise TestFailed, 'list('')'
if list('spam') != ['s', 'p', 'a', 'm']: raise TestFailed, "list('spam')"
-try:
- # Verify clearing of bug #556025
- # this assumes that the max data size (sys.maxint) == max address size
- # this also assumes that the address size is at least 4 bytes
- # with 8 byte addresses, the bug is not well tested
- #
- # Note: This test is expected to SEGV under Cygwin 1.3.12 or earlier
- # due to a newlib bug. See the following mailing list thread for the
- # details:
- # http://sources.redhat.com/ml/newlib/2002/msg00369.html
- list(xrange(sys.maxint / 4))
-except MemoryError:
- pass
-else:
- raise TestFailed, 'list(xrange(sys.maxint / 4))'
+if sys.maxint == 0x7fffffff:
+ # This test can currently only work on 32-bit machines.
+ # XXX If/when PySequence_Length() returns a ssize_t, it should be
+ # XXX re-enabled.
+ try:
+ # Verify clearing of bug #556025.
+ # This assumes that the max data size (sys.maxint) == max
+ # address size this also assumes that the address size is at
+ # least 4 bytes with 8 byte addresses, the bug is not well
+ # tested
+ #
+ # Note: This test is expected to SEGV under Cygwin 1.3.12 or
+ # earlier due to a newlib bug. See the following mailing list
+ # thread for the details:
+
+ # http://sources.redhat.com/ml/newlib/2002/msg00369.html
+ list(xrange(sys.maxint / 4))
+ except MemoryError:
+ pass
+ else:
+ raise TestFailed, 'list(xrange(sys.maxint / 4))'
print 'long'
if long(314) != 314L: raise TestFailed, 'long(314)'