X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Ftests%2Fiface4.cs;h=6cb9df81d683856c1ec82a7408b59130c6a6dc78;hb=e120193ed19d105d3360c7005943cbed8af83549;hp=72d93951dcf5b7d128c499d637396c51a5fb05c3;hpb=f1f8b8a867c800b21b6a03767252403c2f72cae2;p=mono.git diff --git a/mono/tests/iface4.cs b/mono/tests/iface4.cs index 72d93951dcf..6cb9df81d68 100644 --- a/mono/tests/iface4.cs +++ b/mono/tests/iface4.cs @@ -6,10 +6,15 @@ public interface IVehicle { int Turn (); } +public interface IWalker { + int Walk (); +} + public class Base : IVehicle { int IVehicle.Start () { return 1; } public int Stop () { return 2; } public virtual int Turn () { return 3; } + public int Walk () { return 1; } } public class Derived1 : Base { @@ -28,13 +33,18 @@ public class Derived2 : Base, IVehicle { public override int Turn () { return 8; } } +public class Derived3 : Derived1, IWalker { +} + public class Test { static int Main () { Derived1 d1 = new Derived1 (); Derived2 d2 = new Derived2 (); + Derived3 d3 = new Derived3 (); Base b1 = d1; Base b2 = d2; + Base rb = new Base (); if (d1.Turn () != 4) return 1; @@ -42,6 +52,9 @@ public class Test { if (((IVehicle)d1).Turn () != 4) return 2; + if (((Base)d2).Turn () != 8) + return 10; + if (((IVehicle)d2).Turn () != 7) return 3; @@ -51,8 +64,19 @@ public class Test { if (((IVehicle)b2).Turn () != 7) return 5; - //Console.WriteLine ("TEST {0}", ((IVehicle)b2).Turn ()); + if (((IVehicle)rb).Stop () != 2) + return 6; + + if (((IVehicle)d1).Stop () != 2) + return 7; + + if (((IVehicle)d2).Stop () != 6) + return 8; + + if (d3.Walk () != 1) + return 9; + //Console.WriteLine ("TEST {0}", ((IVehicle)b2).Turn ()); return 0; } }