Fix platorm inconsistency in Python default argument handling.

32 bit and 64 bit compiled versions of SWIG generated different Python files
when default arguments were outside the range of 32 bit signed integers.
The default arguments specified in Python are now only those that are in the
range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.

Closes #1108
This commit is contained in:
William S Fulton 2017-10-06 21:57:04 +01:00
commit 4a7976a5d8
4 changed files with 48 additions and 0 deletions

View file

@ -139,6 +139,24 @@ def run(module_name):
print "booltest2 failed"
tricky_failure = True
if tricky.max_32bit_int1() != 0x7FFFFFFF:
print "max_32bit_int1 failed"
tricky_failure = True
if tricky.min_32bit_int1() != -2147483648:
print "min_32bit_int1 failed"
tricky_failure = True
if tricky.max_32bit_int2() != 0x7FFFFFFF:
print "max_32bit_int2 failed"
tricky_failure = True
if tricky.min_32bit_int2() != -2147483648:
print "min_32bit_int2 failed"
tricky_failure = True
tricky.too_big_32bit_int1()
tricky.too_small_32bit_int1()
tricky.too_big_32bit_int2()
tricky.too_small_32bit_int2()
if tricky_failure:
raise RuntimeError