PageRenderTime 69ms CodeModel.GetById 61ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/python/callback_runme.py

#
Python | 31 lines | 21 code | 10 blank | 0 comment | 9 complexity | bcd7b968e7f797400f992091edc33ee6 MD5 | raw file
 1import _callback
 2from callback import *
 3
 4if foo(2) != 2:
 5  raise RuntimeError
 6
 7if A_bar(2) != 4:
 8  raise RuntimeError
 9
10if foobar(3, _callback.foo) != foo(3):
11  raise RuntimeError  
12
13if foobar(3, foo) != foo(3):
14  raise RuntimeError  
15
16if foobar(3, A_bar) != A_bar(3):
17  raise RuntimeError
18
19if foobar(3, foof) != foof(3):
20  raise RuntimeError
21
22if foobar_i(3, foo_i) != foo_i(3):
23  raise RuntimeError
24
25
26if foobar_d(3.5, foo_d) != foo_d(3.5):
27  raise RuntimeError
28
29a = A()
30if foobarm(3, a, A.foom_cb_ptr) != a.foom(3):
31  raise RuntimeError