PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. from li_boost_shared_ptr_bits import *
  2. def check(nd):
  3. nd.i = 200
  4. i = nd.i
  5. try:
  6. nd.notexist = 100
  7. passed = 0
  8. except:
  9. passed = 1
  10. if not passed:
  11. raise "Test failed"
  12. nd = NonDynamic()
  13. check(nd)
  14. b = boing(nd)
  15. check(b)
  16. ################################
  17. v = VectorIntHolder()
  18. v.push_back(IntHolder(11))
  19. v.push_back(IntHolder(22))
  20. v.push_back(IntHolder(33))
  21. sum = sum(v)
  22. if sum != 66:
  23. raise "sum is wrong"
  24. ################################
  25. p = HiddenDestructor.create()