diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in index 74010c284..600c5953d 100644 --- a/Examples/test-suite/csharp/Makefile.in +++ b/Examples/test-suite/csharp/Makefile.in @@ -25,6 +25,7 @@ CPP_TEST_CASES = \ csharp_namespace_system_collision \ csharp_prepost \ csharp_typemaps \ + director_wstring \ enum_thorough_simple \ enum_thorough_typesafe \ exception_partial_info \ diff --git a/Examples/test-suite/csharp/director_wstring_runme.cs b/Examples/test-suite/csharp/director_wstring_runme.cs new file mode 100644 index 000000000..6f97dcb50 --- /dev/null +++ b/Examples/test-suite/csharp/director_wstring_runme.cs @@ -0,0 +1,41 @@ +using System; +using director_wstringNamespace; + +public class runme +{ + static void Main() + { + runme r = new runme(); + r.run(); + } + + void run() + { + director_wstring_B b = new director_wstring_B("hello"); + + b.get(0); + if (b.get_first() != "hello world!") + throw new ApplicationException("Incorrect get_first:" + b.get_first()); + + b.call_process_func(); + + if (b.smem != "hello") + throw new ApplicationException("Incorrect smem:" + b.smem); + } +} + +class director_wstring_B : A +{ + public String smem; + public director_wstring_B(String first) : base(first) + { + } + public override String get_first() + { + return base.get_first() + " world!"; + } + public override void process_text(String s) + { + this.smem = s; + } +} \ No newline at end of file diff --git a/Examples/test-suite/director_wstring.i b/Examples/test-suite/director_wstring.i index 17761ea59..73900ccf6 100644 --- a/Examples/test-suite/director_wstring.i +++ b/Examples/test-suite/director_wstring.i @@ -40,9 +40,15 @@ struct A std::vector m_strings; +#if !defined(SWIGCSHARP) virtual void process_text(const wchar_t *text) { } +#else + virtual void process_text(const std::wstring& text) + { + } +#endif virtual std::wstring multiple_params_val(const std::wstring& p1, const std::wstring& p2, std::wstring p3, std::wstring p4) const { return get_first(); }