From: <zy...@us...> - 2008-07-14 11:03:56
|
Revision: 4919 http://jython.svn.sourceforge.net/jython/?rev=4919&view=rev Author: zyasoft Date: 2008-07-14 04:03:54 -0700 (Mon, 14 Jul 2008) Log Message: ----------- Removed inapplicable test due to different algorithm in expandtabs which cannot overflow in Jython Modified Paths: -------------- branches/asm/Lib/test/string_tests.py branches/asm/Lib/test/test_str.py Modified: branches/asm/Lib/test/string_tests.py =================================================================== --- branches/asm/Lib/test/string_tests.py 2008-07-14 10:52:18 UTC (rev 4918) +++ branches/asm/Lib/test/string_tests.py 2008-07-14 11:03:54 UTC (rev 4919) @@ -251,7 +251,11 @@ self.checkraises(TypeError, 'hello', 'expandtabs', 42, 42) # This test is only valid when sizeof(int) == sizeof(void*) == 4. - if sys.maxint < (1 << 32) and struct.calcsize('P') == 4: + + # Jython uses a different algorithm for which overflows cannot occur; + # but memory exhaustion of course can. So not applicable. + if (sys.maxint < (1 << 32) and not test_support.is_jython + and struct.calcsize('P') == 4): self.checkraises(OverflowError, '\ta\n\tb', 'expandtabs', sys.maxint) @@ -678,7 +682,7 @@ def test_replace_overflow(self): # Check for overflow checking on 32 bit machines - if sys.maxint != 2147483647 or struct.calcsize("P") > 4: + if sys.maxint != 2147483647 or test_support.is_jython or struct.calcsize("P") > 4: return A2_16 = "A" * (2**16) self.checkraises(OverflowError, A2_16, "replace", "", A2_16) Modified: branches/asm/Lib/test/test_str.py =================================================================== --- branches/asm/Lib/test/test_str.py 2008-07-14 10:52:18 UTC (rev 4918) +++ branches/asm/Lib/test/test_str.py 2008-07-14 11:03:54 UTC (rev 4919) @@ -89,7 +89,10 @@ # This test only affects 32-bit platforms because expandtabs can only take # an int as the max value, not a 64-bit C long. If expandtabs is changed # to take a 64-bit long, this test should apply to all platforms. - if sys.maxint > (1 << 32) or struct.calcsize('P') != 4: + + # Jython uses a different algorithm for which overflows cannot occur; + # but memory exhaustion of course can. So not applicable. + if sys.maxint > (1 << 32) or test_support.is_jython or struct.calcsize('P') != 4: return self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxint) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |