From 6d39fe1341fd2f7664cd930e331901d31848aac7 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 9 Sep 2005 17:58:43 +0000 Subject: [PATCH] add char* string test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7419 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Examples/test-suite/director_string.i | 7 +++++++ .../test-suite/python/director_string_runme.py | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/SWIG/Examples/test-suite/director_string.i b/SWIG/Examples/test-suite/director_string.i index c815375e3..30ae20ce3 100644 --- a/SWIG/Examples/test-suite/director_string.i +++ b/SWIG/Examples/test-suite/director_string.i @@ -35,6 +35,13 @@ struct A { return get(n); } std::vector m_strings; + + + virtual void process_text(const char *text) + { + } + + void call_process_func() { process_text("hello"); } }; %} diff --git a/SWIG/Examples/test-suite/python/director_string_runme.py b/SWIG/Examples/test-suite/python/director_string_runme.py index d30cddbb7..6b225df33 100644 --- a/SWIG/Examples/test-suite/python/director_string_runme.py +++ b/SWIG/Examples/test-suite/python/director_string_runme.py @@ -6,6 +6,9 @@ class B(A): def get_first(self): 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!": print b.get_first() raise RuntimeError + + +b.call_process_func() + +if b.smem != "hello": + print smem + raise RuntimeError +