/trunk/Examples/test-suite/python/overload_extendc_runme.py
Python | 22 lines | 18 code | 3 blank | 1 comment | 8 complexity | 064554951c5c0a3c50f19bee02d81791 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- 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