director string testing additions
Add test for C# based on Java example to test strings in and out. Memory cleanup for Java test.
This commit is contained in:
parent
31af3ce9bf
commit
86eaf30735
2 changed files with 77 additions and 12 deletions
58
Examples/test-suite/csharp/director_default_runme.cs
Normal file
58
Examples/test-suite/csharp/director_default_runme.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
|
||||
namespace director_defaultNamespace {
|
||||
|
||||
public class runme
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
{
|
||||
MyFoo a = new MyFoo();
|
||||
a = new MyFoo(10);
|
||||
a.Dispose();
|
||||
}
|
||||
|
||||
{
|
||||
MyFoo a = new MyFoo();
|
||||
if (a.GetMsg() != "MyFoo-default") {
|
||||
throw new Exception( "Test 1 failed" );
|
||||
}
|
||||
if (a.GetMsg("boo") != "MyFoo-boo") {
|
||||
throw new Exception( "Test 2 failed" );
|
||||
}
|
||||
a.Dispose();
|
||||
}
|
||||
|
||||
{
|
||||
Foo b = new Foo();
|
||||
if (b.GetMsg() != "Foo-default") {
|
||||
throw new Exception( "Test 1 failed" );
|
||||
}
|
||||
if (b.GetMsg("boo") != "Foo-boo") {
|
||||
throw new Exception( "Test 2 failed" );
|
||||
}
|
||||
b.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MyFoo : Foo
|
||||
{
|
||||
public MyFoo()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
public MyFoo(int i)
|
||||
: base(i)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Msg(string msg)
|
||||
{
|
||||
return "MyFoo-" + msg;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue