lib_xxxx tests renamed to li_xxxx as a workaround in glib which Mono C# uses - libraries wont be loaded if they start with lib
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6591 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5f7c3f7e26
commit
c611933db3
16 changed files with 911 additions and 14 deletions
74
SWIG/Examples/test-suite/python/li_std_string_runme.py
Normal file
74
SWIG/Examples/test-suite/python/li_std_string_runme.py
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import lib_std_string
|
||||
|
||||
x="hello"
|
||||
|
||||
|
||||
|
||||
if lib_std_string.test_ccvalue(x) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if lib_std_string.test_cvalue(x) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if lib_std_string.test_value(x) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if lib_std_string.test_const_reference(x) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
|
||||
s = lib_std_string.string("he")
|
||||
#s += "ll"
|
||||
#s.append('o')
|
||||
s += "llo"
|
||||
|
||||
if s != x:
|
||||
print s, x
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if s[1:4] != x[1:4]:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if lib_std_string.test_value(s) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if lib_std_string.test_const_reference(s) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
a = lib_std_string.A(s)
|
||||
|
||||
if lib_std_string.test_value(a) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if lib_std_string.test_const_reference(a) != x:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
b = lib_std_string.string(" world")
|
||||
|
||||
if a + b != "hello world":
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if a + " world" != "hello world":
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
if "hello" + b != "hello world":
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
c = "hello" + b
|
||||
if c.find_last_of("l") != 9:
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
s = "hello world"
|
||||
|
||||
b = lib_std_string.B("hi")
|
||||
|
||||
b.name = lib_std_string.string("hello")
|
||||
if b.name != "hello":
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
|
||||
b.a = lib_std_string.A("hello")
|
||||
if b.a != "hello":
|
||||
raise RuntimeError, "bad string mapping"
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue