add char* string test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7419 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7e2154ed19
commit
6d39fe1341
2 changed files with 18 additions and 0 deletions
|
|
@ -35,6 +35,13 @@ struct A
|
||||||
{ return get(n); }
|
{ return get(n); }
|
||||||
|
|
||||||
std::vector<std::string> m_strings;
|
std::vector<std::string> m_strings;
|
||||||
|
|
||||||
|
|
||||||
|
virtual void process_text(const char *text)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void call_process_func() { process_text("hello"); }
|
||||||
};
|
};
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ class B(A):
|
||||||
|
|
||||||
def get_first(self):
|
def get_first(self):
|
||||||
return A.get_first(self) + " world!"
|
return A.get_first(self) + " world!"
|
||||||
|
|
||||||
|
def process_text(self, string):
|
||||||
|
self.smem = "hello"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -15,3 +18,11 @@ b.get(0)
|
||||||
if b.get_first() != "hello world!":
|
if b.get_first() != "hello world!":
|
||||||
print b.get_first()
|
print b.get_first()
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
||||||
|
b.call_process_func()
|
||||||
|
|
||||||
|
if b.smem != "hello":
|
||||||
|
print smem
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue