Tests for abstract & others. Breaks aot build in current svn-head, so
it's mostly for DarxKies use :)
Index: Kernel/Tests/CS/Abstract.cs
===================================================================
--- Kernel/Tests/CS/Abstract.cs (wersja 0)
+++ Kernel/Tests/CS/Abstract.cs (wersja 0)
@@ -0,0 +1,107 @@
+namespace SharpOS.Kernel.Tests.CS
+{
+ public class Abstract
+ {
+ private abstract class Base
+ {
+ protected int number;
+
+ public Base ()
+ {
+ this.number = 0;
+ }
+
+ public Base (int number)
+ {
+ this.number = number;
+ }
+
+ public abstract int Number {
+ get;
+ }
+
+ public int GetNumber ()
+ {
+ return number;
+ }
+
+ public int Get37 ()
+ {
+ return 37;
+ }
+
+ public virtual int Get50override100 ()
+ {
+ return 50;
+ }
+
+ public abstract int GetAbstract42 ();
+ }
+
+ private class SubClass : Base
+ {
+ public SubClass () { }
+ public SubClass (int number) : base (number) { }
+
+ public override int Number
+ {
+ get { return number; }
+ }
+
+ public int GetInheritedNumber ()
+ {
+ return GetNumber ();
+ }
+
+ public override int Get50override100 ()
+ {
+ return 100;
+ }
+
+ public override int GetAbstract42 ()
+ {
+ return 42;
+ }
+ }
+
+ public static uint CMPGetAbstractProperty ()
+ {
+ if (new SubClass (37).Number == 37)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallInherited ()
+ {
+ if (new SubClass (37).GetNumber () == 37)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallProxiedInherited ()
+ {
+ if (new SubClass (37).GetInheritedNumber() == 37)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallOverridden ()
+ {
+ if (new SubClass ().Get50override100() == 100)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallAbstractMember ()
+ {
+ if (new SubClass ().GetAbstract42() == 42)
+ return 1;
+
+ return 0;
+ }
+ }
+}
Index: Kernel/Tests/CS/Inheritance.cs
===================================================================
--- Kernel/Tests/CS/Inheritance.cs (wersja 733)
+++ Kernel/Tests/CS/Inheritance.cs (kopia robocza)
@@ -89,5 +89,13 @@
return 0;
}
+
+ public static uint CMPCallShadowedMemberFromBase ()
+ {
+ if ((new SubClass () as Base).Get58shadowWith69() == 58)
+ return 1;
+
+ return 0;
+ }
}
}
Index: Kernel/Tests/CS/Interface.cs
===================================================================
--- Kernel/Tests/CS/Interface.cs (wersja 0)
+++ Kernel/Tests/CS/Interface.cs (wersja 0)
@@ -0,0 +1,77 @@
+namespace SharpOS.Kernel.Tests.CS
+{
+ public class Interface
+ {
+ private interface Iface1
+ {
+ int GetNumber ();
+ int Get100 ();
+ int Number
+ {
+ get;
+ }
+ }
+
+ private interface Iface2
+ {
+ int GetNumber ();
+ }
+
+ private class Class : Iface1, Iface2
+ {
+ public Class () { }
+
+ public int Number
+ {
+ get { return 42; }
+ }
+
+ public int Get100 ()
+ {
+ return 100;
+ }
+
+ int Iface1.GetNumber ()
+ {
+ return 42;
+ }
+
+ int Iface2.GetNumber ()
+ {
+ return 69;
+ }
+ }
+
+ public static uint CMPGetProperty ()
+ {
+ if (new Class ().Number == 42)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallGet100 ()
+ {
+ if (new Class ().Get100() == 100)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallChosenInterface1 ()
+ {
+ if ((new Class () as Iface1).GetNumber() == 42)
+ return 1;
+
+ return 0;
+ }
+
+ public static uint CMPCallChosenInterface2 ()
+ {
+ if ((new Class () as Iface2).GetNumber() == 69)
+ return 1;
+
+ return 0;
+ }
+ }
+}
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
SharpOS-Developers mailing list
SharpOS-Developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sharpos-developers