Merge pull request #5210 from alexrp/profiler-runtime-settings
[mono.git] / mono / tests / iface6.cs
1 using System;
2
3 interface IA
4 {
5         int Add(int i);
6 }
7
8 interface IB
9 {
10         int Add(int i); 
11 }
12
13 interface IC : IA, IB {}
14
15 interface IE : ICloneable, IDisposable {
16         void doom ();
17 }
18
19 class D : IC, IB
20 {
21         int IA.Add (int i) {
22                 return 5;
23         }
24         
25         int IB.Add (int i) {
26                 return 6;
27         }
28 }
29
30 class E: IE, IC {
31         public E() {
32         }
33         public void doom () {
34                 return;
35         }
36         public Object Clone () {
37                 return null;
38         }
39         public void Dispose () {}
40         int IA.Add (int i) {
41                 return 7;
42         }
43         
44         int IB.Add (int i) {
45                 return 8;
46         }
47 }
48
49 class C
50 {
51         static int Test(IC n) {
52
53                 if (((IA)n).Add(0) != 5)
54                         return 1;
55
56                 if (((IB)n).Add(0) != 6)
57                         return 1;
58
59
60                 return 0;
61         }
62
63         static void Test2(IE ie) {
64                 ie.doom ();
65                 object o = ie.Clone();
66                 ie.Dispose ();
67         }
68
69         static int Main()
70         {
71                 D d = new D();
72                 E e = new E();
73                 int a = Test (e);
74                 Test2 (e);
75                 
76                 return Test (d);
77         }
78 }
79