PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Python | 34 lines | 23 code | 9 blank | 2 comment | 3 complexity | 7e4cf4aea4c7d962bab98760e1b3bf0f MD5 | raw file
 1from li_boost_shared_ptr_bits import *
 2
 3def check(nd):
 4  nd.i = 200
 5  i = nd.i
 6
 7  try:
 8    nd.notexist = 100
 9    passed = 0
10  except:
11    passed = 1
12
13  if not passed:
14    raise "Test failed"
15
16nd = NonDynamic()
17check(nd)
18b = boing(nd)
19check(b)
20
21################################
22
23v = VectorIntHolder()
24v.push_back(IntHolder(11))
25v.push_back(IntHolder(22))
26v.push_back(IntHolder(33))
27
28sum = sum(v)
29if sum != 66:
30  raise "sum is wrong"
31
32################################
33p = HiddenDestructor.create()
34