[Python-checkins] python/dist/src/Lib/test test_b1.py,1.53,1.54

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 11 Sep 2002 11:32:33 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv24258

Modified Files:
	test_b1.py 
Log Message:
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.


Index: test_b1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** test_b1.py	29 Aug 2002 14:22:51 -0000	1.53
--- test_b1.py	11 Sep 2002 18:32:30 -0000	1.54
***************
*** 534,552 ****
  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))'
  
  print 'long'
--- 534,558 ----
  if list('spam') != ['s', 'p', 'a', 'm']: raise TestFailed, "list('spam')"
  
! 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'