more cases

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5796 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-03-29 06:01:39 +00:00
commit 2c5dc2113b
4 changed files with 79 additions and 1 deletions

View file

@ -2,6 +2,14 @@ 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"
@ -34,3 +42,32 @@ if lib_std_string.test_value(a) != x:
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 = "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"