From 072446f34f4003515d6d23c5ee768412f42dd0ad Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 21 Oct 2005 11:01:40 +0000 Subject: [PATCH] add the runtime case git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7702 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/director_wstring.i | 4 +-- .../python/director_wstring_runme.py | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Examples/test-suite/python/director_wstring_runme.py diff --git a/Examples/test-suite/director_wstring.i b/Examples/test-suite/director_wstring.i index f386b20ec..b0fbdafe9 100644 --- a/Examples/test-suite/director_wstring.i +++ b/Examples/test-suite/director_wstring.i @@ -37,11 +37,11 @@ struct A std::vector m_strings; - virtual void process_text(const char *text) + virtual void process_text(const wchar_t *text) { } - void call_process_func() { process_text("hello"); } + void call_process_func() { process_text(L"hello"); } }; %} diff --git a/Examples/test-suite/python/director_wstring_runme.py b/Examples/test-suite/python/director_wstring_runme.py new file mode 100644 index 000000000..f3f29de5e --- /dev/null +++ b/Examples/test-suite/python/director_wstring_runme.py @@ -0,0 +1,28 @@ +from director_wstring import * + +class B(A): + def __init__(self,string): + A.__init__(self,string) + + def get_first(self): + return A.get_first(self) + u" world!" + + def process_text(self, string): + self.smem = u"hello" + + + +b = B(u"hello") + +b.get(0) +if b.get_first() != u"hello world!": + print b.get_first() + raise RuntimeError + + +b.call_process_func() + +if b.smem != u"hello": + print smem + raise RuntimeError +