Fix #3475492 - iterating through std::vector wrappers of enumerations.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12916 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3340045d67
commit
50693941c6
13 changed files with 253 additions and 0 deletions
24
Examples/test-suite/python/li_std_vector_enum_runme.py
Normal file
24
Examples/test-suite/python/li_std_vector_enum_runme.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import li_std_vector_enum
|
||||
|
||||
def check(a, b):
|
||||
if (a != b):
|
||||
raise RuntimeError("Not equal: ", a, b)
|
||||
|
||||
ev = li_std_vector_enum.EnumVector()
|
||||
|
||||
check(ev.nums[0], 10)
|
||||
check(ev.nums[1], 20)
|
||||
check(ev.nums[2], 30)
|
||||
|
||||
it = ev.nums.iterator()
|
||||
v = it.value()
|
||||
check(v, 10)
|
||||
it.next()
|
||||
v = it.value()
|
||||
check(v, 20)
|
||||
|
||||
expected = 10
|
||||
for val in ev.nums:
|
||||
check(val, expected)
|
||||
expected += 10
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue