change runtime examples to run with old python versions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8376 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0969072b63
commit
00c8d50988
7 changed files with 19 additions and 19 deletions
|
|
@ -34,7 +34,7 @@ class PyClass(director_basic.MyClass):
|
|||
pass
|
||||
|
||||
def vmethod(self, b):
|
||||
b.x += 31
|
||||
b.x = b.x + 31
|
||||
return b
|
||||
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ class PyMulti(director_basic.Foo, director_basic.MyClass):
|
|||
|
||||
|
||||
def vmethod(self, b):
|
||||
b.x += 31
|
||||
b.x = b.x + 31
|
||||
return b
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ i = 0
|
|||
for d in v3:
|
||||
if d != i:
|
||||
raise RuntimeError
|
||||
i += 1
|
||||
i = i + 1
|
||||
|
||||
|
||||
m3 = Matrix3()
|
||||
|
|
@ -25,9 +25,9 @@ for v3 in m3:
|
|||
for d in v3:
|
||||
if d != i + j:
|
||||
raise RuntimeError
|
||||
j += 1
|
||||
j = j + 1
|
||||
pass
|
||||
i += 1
|
||||
i = i + 1
|
||||
pass
|
||||
|
||||
for i in range(0,len(m3)):
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ s.append("c")
|
|||
|
||||
sum = ""
|
||||
for i in s:
|
||||
sum += i
|
||||
sum = sum + i
|
||||
|
||||
if sum != "abc":
|
||||
raise RuntimeError
|
||||
|
|
@ -26,7 +26,7 @@ b = s.begin()
|
|||
e = s.end()
|
||||
sum = ""
|
||||
while (b != e):
|
||||
sum += b.next()
|
||||
sum = sum + b.next()
|
||||
if sum != "abc":
|
||||
raise RuntimeError
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ b = s.rbegin()
|
|||
e = s.rend()
|
||||
sum = ""
|
||||
while (b != e):
|
||||
sum += b.next()
|
||||
sum = sum + b.next()
|
||||
|
||||
if sum != "cba":
|
||||
raise RuntimeError
|
||||
|
|
@ -66,7 +66,7 @@ b = s.begin()
|
|||
e = s.end()
|
||||
sum = ""
|
||||
while (b != e):
|
||||
sum += b.next()
|
||||
sum = sum + b.next()
|
||||
if sum != "ac":
|
||||
raise RuntimeError
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ s.insert("hello")
|
|||
|
||||
sum = ()
|
||||
for i in s:
|
||||
sum += (i,)
|
||||
sum = sum + (i,)
|
||||
|
||||
if sum != (1, 'hello', (1, 2)):
|
||||
raise RuntimeError
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import li_std_stream as std
|
||||
from li_std_stream import *
|
||||
|
||||
|
||||
|
||||
a = std.A()
|
||||
a = A()
|
||||
|
||||
o = std.ostringstream()
|
||||
o = ostringstream()
|
||||
|
||||
o << a << " " << 2345 << " " << 1.435
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ if li_std_string.test_const_reference(x) != x:
|
|||
s = li_std_string.string("he")
|
||||
#s += "ll"
|
||||
#s.append('o')
|
||||
s += "llo"
|
||||
s = s + "llo"
|
||||
|
||||
if s != x:
|
||||
print s, x
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import li_std_wstream as std
|
||||
from li_std_wstream import *
|
||||
|
||||
|
||||
|
||||
a = std.A()
|
||||
a = A()
|
||||
|
||||
o = std.wostringstream()
|
||||
o = wostringstream()
|
||||
|
||||
o << a << u" " << 2345 << u" " << 1.435 << std.wends
|
||||
o << a << u" " << 2345 << u" " << 1.435 << wends
|
||||
|
||||
if o.str() != "A class 2345 1.435\0":
|
||||
print "\"%s\"" % (o.str(),)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ if li_std_wstring.test_const_reference(x) != x:
|
|||
|
||||
|
||||
s = li_std_wstring.wstring(u"he")
|
||||
s += u"llo"
|
||||
s = s + u"llo"
|
||||
|
||||
if s != x:
|
||||
print s, x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue