diff --git a/CSharpTranslator/tests/Tester/Misc/Namespaces/child.cs b/CSharpTranslator/tests/Tester/Misc/Namespaces/child.cs new file mode 100755 index 0000000..514dcb9 --- /dev/null +++ b/CSharpTranslator/tests/Tester/Misc/Namespaces/child.cs @@ -0,0 +1,22 @@ +using System; + +// Test translation for lock statements + +namespace Tester.Parent.Child +{ + + public class ChildClass + { + + private ParentClass myp = null; + + + public ChildClass(int val) + { + myp = new ParentClass(val); + int tmp = myp.GetHashCode(); + } + + } + +} diff --git a/CSharpTranslator/tests/Tester/Misc/Namespaces/parent.cs b/CSharpTranslator/tests/Tester/Misc/Namespaces/parent.cs new file mode 100755 index 0000000..fee9f21 --- /dev/null +++ b/CSharpTranslator/tests/Tester/Misc/Namespaces/parent.cs @@ -0,0 +1,41 @@ +using System; + +// Test translation for lock statements + +namespace Tester.Parent +{ + +public class ParentClass { + + private int loc = 0; + + + public ParentClass(int val) + { + loc = val; + } + + public int GetLoc() + { + return loc; + } + + public override int GetHashCode(){ + return 5; + } + + private class ChildOne { + public int COloc = 0; + private class ChildChildOne + { + public ChildChildOne() { } + + public ChildOne p = new ChildOne(); + public ParentClass gp = new ParentClass(4); + } + } + + +} + +} diff --git a/CSharpTranslator/tests/Tester/Misc/locker.cs b/CSharpTranslator/tests/Tester/Misc/locker.cs new file mode 100755 index 0000000..67f63be --- /dev/null +++ b/CSharpTranslator/tests/Tester/Misc/locker.cs @@ -0,0 +1,31 @@ +using System; + +// Test translation for lock statements + +namespace Tester.Locker +{ +class B { + public virtual void foo() { + lock(this) + Console.WriteLine("summat"); + } +} +class D : B { + public new void foo() { + lock (new String[5]) + { + Console.WriteLine("and"); + Console.WriteLine("nuttin"); + } + } +} + +public class Test5 { + public static void T5Main(){ + B b = new D(); + b.foo(); + Console.WriteLine("Done"); + } +} + +} diff --git a/CSharpTranslator/tests/Tester/Tester.csproj b/CSharpTranslator/tests/Tester/Tester.csproj index 40c54ab..7a3b862 100644 --- a/CSharpTranslator/tests/Tester/Tester.csproj +++ b/CSharpTranslator/tests/Tester/Tester.csproj @@ -1,4 +1,4 @@ - + Debug @@ -45,6 +45,9 @@ + + +