@@ -106,7 +106,7 @@ def wait_for_handle(handle, timeout):
106106#
107107
108108try :
109- from ctypes import Structure , c_int , c_double
109+ from ctypes import Structure , c_int , c_double , c_longlong
110110except ImportError :
111111 Structure = object
112112 c_int = c_double = None
@@ -1637,6 +1637,7 @@ class _TestValue(BaseTestCase):
16371637 ('i' , 4343 , 24234 ),
16381638 ('d' , 3.625 , - 4.25 ),
16391639 ('h' , - 232 , 234 ),
1640+ ('q' , 2 ** 33 , 2 ** 34 ),
16401641 ('c' , latin ('x' ), latin ('y' ))
16411642 ]
16421643
@@ -3179,7 +3180,8 @@ def test_free_from_gc(self):
31793180class _Foo (Structure ):
31803181 _fields_ = [
31813182 ('x' , c_int ),
3182- ('y' , c_double )
3183+ ('y' , c_double ),
3184+ ('z' , c_longlong ,)
31833185 ]
31843186
31853187class _TestSharedCTypes (BaseTestCase ):
@@ -3191,9 +3193,10 @@ def setUp(self):
31913193 self .skipTest ("requires multiprocessing.sharedctypes" )
31923194
31933195 @classmethod
3194- def _double (cls , x , y , foo , arr , string ):
3196+ def _double (cls , x , y , z , foo , arr , string ):
31953197 x .value *= 2
31963198 y .value *= 2
3199+ z .value *= 2
31973200 foo .x *= 2
31983201 foo .y *= 2
31993202 string .value *= 2
@@ -3203,18 +3206,20 @@ def _double(cls, x, y, foo, arr, string):
32033206 def test_sharedctypes (self , lock = False ):
32043207 x = Value ('i' , 7 , lock = lock )
32053208 y = Value (c_double , 1.0 / 3.0 , lock = lock )
3209+ z = Value (c_longlong , 2 ** 33 , lock = lock )
32063210 foo = Value (_Foo , 3 , 2 , lock = lock )
32073211 arr = self .Array ('d' , list (range (10 )), lock = lock )
32083212 string = self .Array ('c' , 20 , lock = lock )
32093213 string .value = latin ('hello' )
32103214
3211- p = self .Process (target = self ._double , args = (x , y , foo , arr , string ))
3215+ p = self .Process (target = self ._double , args = (x , y , z , foo , arr , string ))
32123216 p .daemon = True
32133217 p .start ()
32143218 p .join ()
32153219
32163220 self .assertEqual (x .value , 14 )
32173221 self .assertAlmostEqual (y .value , 2.0 / 3.0 )
3222+ self .assertEqual (z .value , 2 ** 34 )
32183223 self .assertEqual (foo .x , 6 )
32193224 self .assertAlmostEqual (foo .y , 4.0 )
32203225 for i in range (10 ):
@@ -3225,12 +3230,14 @@ def test_synchronize(self):
32253230 self .test_sharedctypes (lock = True )
32263231
32273232 def test_copy (self ):
3228- foo = _Foo (2 , 5.0 )
3233+ foo = _Foo (2 , 5.0 , 2 ** 33 )
32293234 bar = copy (foo )
32303235 foo .x = 0
32313236 foo .y = 0
3237+ foo .z = 0
32323238 self .assertEqual (bar .x , 2 )
32333239 self .assertAlmostEqual (bar .y , 5.0 )
3240+ self .assertEqual (bar .z , 2 ** 33 )
32343241
32353242#
32363243#
0 commit comments