PageRenderTime 20ms CodeModel.GetById 2ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Python | 59 lines | 35 code | 23 blank | 1 comment | 3 complexity | b0b20a6c5d3bdbd0509bb39219ca9ad9 MD5 | raw file
 1import li_std_pair_extra
 2
 3p = (1,2)
 4p1 = li_std_pair_extra.p_inout(p)
 5p2 = li_std_pair_extra.p_inoutd(p1)
 6
 7d1 = li_std_pair_extra.d_inout(2)
 8
 9i,d2 = li_std_pair_extra.d_inout2(2)
10
11i,p = li_std_pair_extra.p_inout2(p)
12p3,p4 = li_std_pair_extra.p_inout3(p1,p1)
13
14psi = li_std_pair_extra.SIPair("hello",1)
15pci = li_std_pair_extra.CIPair(1,1)
16
17
18#psi.first = "hi"
19
20
21psi = li_std_pair_extra.SIPair("hi",1)
22if psi != ("hi",1):
23  raise RuntimeError
24
25psii = li_std_pair_extra.SIIPair(psi,1)
26
27a = li_std_pair_extra.A()
28b = li_std_pair_extra.B()
29
30pab = li_std_pair_extra.ABPair(a,b);
31
32pab.first = a
33pab.first.val = 2
34
35if pab.first.val != 2:
36  raise RuntimeError
37  
38
39pci = li_std_pair_extra.CIntPair(1,0)
40
41a = li_std_pair_extra.A(5)
42p1 = li_std_pair_extra.pairP1(1,a.this)
43p2 = li_std_pair_extra.pairP2(a,1)
44p3 = li_std_pair_extra.pairP3(a,a)
45
46
47if a.val != li_std_pair_extra.p_identa(p1.this)[1].val:
48  raise RuntimeError
49  
50p = li_std_pair_extra.IntPair(1,10)
51p.first = 1
52
53p = li_std_pair_extra.paircA1(1,a)
54p.first
55p.second
56
57p = li_std_pair_extra.paircA2(1,a)
58pp = li_std_pair_extra.pairiiA(1,p)
59