44import os
55import re
66import itertools
7+ import struct # IronPython: for platform architecture detection
78import socket
89import sys
910import weakref
@@ -715,7 +716,6 @@ def test_weakref(self):
715716 gc_collect ()
716717 self .assertIs (wr (), None )
717718
718- @unittest .skipIf (sys .implementation .name == "ironpython" , "TODO" )
719719class LargeMmapTests (unittest .TestCase ):
720720
721721 def setUp (self ):
@@ -748,7 +748,8 @@ def test_large_offset(self):
748748
749749 def test_large_filesize (self ):
750750 with self ._make_test_file (0x17FFFFFFF , b" " ) as f :
751- if sys .maxsize < 0x180000000 :
751+ #if sys.maxsize < 0x180000000: # original CPython test
752+ if struct .calcsize ('P' ) * 8 == 32 : # IronPython: better detection of 32-bit platform
752753 # On 32 bit platforms the file is larger than sys.maxsize so
753754 # mapping the whole file should fail -- Issue #16743
754755 with self .assertRaises (OverflowError ):
@@ -768,11 +769,13 @@ def _test_around_boundary(self, boundary):
768769 with mmap .mmap (f .fileno (), 0 , access = mmap .ACCESS_READ ) as m :
769770 self .assertEqual (m [start :end ], tail )
770771
771- @unittest .skipUnless (sys .maxsize > _4G , "test cannot run on 32-bit systems" )
772+ #@unittest.skipUnless(sys.maxsize > _4G, "test cannot run on 32-bit systems") # original CPython decorator
773+ @unittest .skipUnless (struct .calcsize ('P' ) * 8 > 32 , "test cannot run on 32-bit systems" ) # IronPython: better detection of 32-bit platform
772774 def test_around_2GB (self ):
773775 self ._test_around_boundary (_2G )
774776
775- @unittest .skipUnless (sys .maxsize > _4G , "test cannot run on 32-bit systems" )
777+ #@unittest.skipUnless(sys.maxsize > _4G, "test cannot run on 32-bit systems") # original CPython decorator
778+ @unittest .skipUnless (struct .calcsize ('P' ) * 8 > 32 , "test cannot run on 32-bit systems" ) # IronPython: better detection of 32-bit platform
776779 def test_around_4GB (self ):
777780 self ._test_around_boundary (_4G )
778781
0 commit comments