summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-04-13 20:41:09 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-04-13 20:41:09 (GMT)
commite9bbe8b87ba2874efba0474af5cc7d5941dbf742 (patch)
tree11bce10b5fb219abaa247d6b5bf273b1d0c04bca /Lib
parente2cef885a25967605007248cb158671b765df002 (diff)
downloadcpython-e9bbe8b87ba2874efba0474af5cc7d5941dbf742.zip
cpython-e9bbe8b87ba2874efba0474af5cc7d5941dbf742.tar.gz
cpython-e9bbe8b87ba2874efba0474af5cc7d5941dbf742.tar.bz2
Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal.
Initial patch by Daniel Riti.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_marshal.py30
1 files changed, 3 insertions, 27 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index c817caf..7c52ee3 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -23,36 +23,12 @@ class HelperMixin:
class IntTestCase(unittest.TestCase, HelperMixin):
def test_ints(self):
- # Test the full range of Python ints.
- n = sys.maxsize
+ # Test a range of Python ints larger than the machine word size.
+ n = sys.maxsize ** 2
while n:
for expected in (-n, n):
self.helper(expected)
- n = n >> 1
-
- def test_int64(self):
- # Simulate int marshaling on a 64-bit box. This is most interesting if
- # we're running the test on a 32-bit box, of course.
-
- def to_little_endian_string(value, nbytes):
- b = bytearray()
- for i in range(nbytes):
- b.append(value & 0xff)
- value >>= 8
- return b
-
- maxint64 = (1 << 63) - 1
- minint64 = -maxint64-1
-
- for base in maxint64, minint64, -maxint64, -(minint64 >> 1):
- while base:
- s = b'I' + to_little_endian_string(base, 8)
- got = marshal.loads(s)
- self.assertEqual(base, got)
- if base == -1: # a fixed-point for shifting right 1
- base = 0
- else:
- base >>= 1
+ n = n >> 1
def test_bool(self):
for b in (True, False):