[Python-checkins] python/dist/src/Lib/test test_b1.py,1.42.4.5,1.42.4.6 test_long.py,1.15,1.15.14.1

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
2003年1月28日 11:41:09 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16314a/Lib/test
Modified Files:
 Tag: release22-maint
	test_b1.py test_long.py 
Log Message:
backport:
Fix SF bug# 676155, RuntimeWarning with tp_compare
Check return value of PyLong_AsDouble(), it can return an error.
Index: test_b1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/Attic/test_b1.py,v
retrieving revision 1.42.4.5
retrieving revision 1.42.4.6
diff -C2 -d -r1.42.4.5 -r1.42.4.6
*** test_b1.py	8 Oct 2002 21:03:26 -0000	1.42.4.5
--- test_b1.py	28 Jan 2003 19:40:31 -0000	1.42.4.6
***************
*** 98,101 ****
--- 98,105 ----
 if fcmp(coerce(1L, 1.1), (1.0, 1.1)): raise TestFailed, 'coerce(1L, 1.1)'
 
+ try: coerce(0.5, long("12345" * 1000))
+ except OverflowError: pass
+ else: raise TestFailed, 'coerce(0.5, long("12345" * 1000))'
+ 
 print 'compile'
 compile('print 1\n', '', 'exec')
Index: test_long.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_long.py,v
retrieving revision 1.15
retrieving revision 1.15.14.1
diff -C2 -d -r1.15 -r1.15.14.1
*** test_long.py	5 Sep 2001 00:53:44 -0000	1.15
--- test_long.py	28 Jan 2003 19:40:33 -0000	1.15.14.1
***************
*** 340,346 ****
 verify(float(long(x)) == x)
 
 huge = 1L << 30000
 mhuge = -huge
! namespace = {'huge': huge, 'mhuge': mhuge, 'math': math}
 for test in ["float(huge)", "float(mhuge)",
 "complex(huge)", "complex(mhuge)",
--- 340,347 ----
 verify(float(long(x)) == x)
 
+ shuge = '12345' * 1000
 huge = 1L << 30000
 mhuge = -huge
! namespace = {'huge': huge, 'mhuge': mhuge, 'shuge': shuge, 'math': math}
 for test in ["float(huge)", "float(mhuge)",
 "complex(huge)", "complex(mhuge)",
***************
*** 355,359 ****
 "math.sin(huge)", "math.sin(mhuge)",
 "math.sqrt(huge)", "math.sqrt(mhuge)", # should do better
! "math.floor(huge)", "math.floor(mhuge)"]:
 
 try:
--- 356,361 ----
 "math.sin(huge)", "math.sin(mhuge)",
 "math.sqrt(huge)", "math.sqrt(mhuge)", # should do better
! "math.floor(huge)", "math.floor(mhuge)",
! "float(shuge) == long(shuge)"]:
 
 try:

AltStyle によって変換されたページ (->オリジナル) /