Apply C# test updates for directors with std::wstring supplied by wsfulton
This commit is contained in:
parent
3377b63dad
commit
9fd59650cf
3 changed files with 48 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ CPP_TEST_CASES = \
|
||||||
csharp_namespace_system_collision \
|
csharp_namespace_system_collision \
|
||||||
csharp_prepost \
|
csharp_prepost \
|
||||||
csharp_typemaps \
|
csharp_typemaps \
|
||||||
|
director_wstring \
|
||||||
enum_thorough_simple \
|
enum_thorough_simple \
|
||||||
enum_thorough_typesafe \
|
enum_thorough_typesafe \
|
||||||
exception_partial_info \
|
exception_partial_info \
|
||||||
|
|
|
||||||
41
Examples/test-suite/csharp/director_wstring_runme.cs
Normal file
41
Examples/test-suite/csharp/director_wstring_runme.cs
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -40,9 +40,15 @@ struct A
|
||||||
std::vector<std::wstring> m_strings;
|
std::vector<std::wstring> m_strings;
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(SWIGCSHARP)
|
||||||
virtual void process_text(const wchar_t *text)
|
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
|
virtual std::wstring multiple_params_val(const std::wstring& p1, const std::wstring& p2, std::wstring p3, std::wstring p4) const
|
||||||
{ return get_first(); }
|
{ return get_first(); }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue