Add new test
[mono.git] / mcs / tests / test-134.cs
diff --git a/mcs/tests/test-134.cs b/mcs/tests/test-134.cs
new file mode 100755 (executable)
index 0000000..35cb5c0
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// This test checks if we implement all the interfaces inherited
+//
+
+interface IA {
+        void A ();
+}
+
+interface IB : IA {
+        void B ();
+}
+
+interface IC : IA, IB {
+       void C ();
+}
+
+interface ID : IC {
+}
+
+class AA : IC {
+       bool a, b, c;
+       public void A () { a = true; }
+       public void B () { b = true; }
+       public void C () { c = true; }
+
+       public bool OK {
+               get {
+                       return a && b && c;
+               }
+       }
+}
+
+class BB : ID{
+       bool a, b, c;
+       public void A () { a = true; System.Console.WriteLine ("A"); }
+       public void B () { b = true; }
+       public void C () { c = true; }
+
+       public bool OK {
+               get {
+                       return a && b && c;
+               }
+       }
+}
+
+class T: IB {
+        public void A () {}
+        public void B () {}
+
+        static int Main() {
+
+               BB bb = new BB ();
+               bb.A ();
+               bb.B ();
+               bb.C ();
+
+               if (!bb.OK)
+                       return 1;
+
+               AA aa = new AA ();
+               aa.A ();
+               aa.B ();
+               aa.C ();
+               if (!aa.OK)
+                       return 2;
+
+               return 0;
+       }
+}