swig/Examples/test-suite/python/overload_extendc_runme.py
William S Fulton 1800d7914f default args in C code test added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6454 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-10-20 21:06:10 +00:00

22 lines
463 B
Python

import overload_extendc
f = overload_extendc.Foo()
if f.test(3) != 1:
raise RuntimeError
if f.test("hello") != 2:
raise RuntimeError
if f.test(3.5,2.5) != 3:
raise RuntimeError
if f.test("hello",20) != 1020:
raise RuntimeError
if f.test("hello",20,100) != 120:
raise RuntimeError
# C default args
if f.test(f) != 30:
raise RuntimeError
if f.test(f,100) != 120:
raise RuntimeError
if f.test(f,100,200) != 300:
raise RuntimeError