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:
William S Fulton 2012-03-13 07:10:24 +00:00
commit 50693941c6
13 changed files with 253 additions and 0 deletions

View 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