Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

60
mcs/tests/test-30.cs Normal file
View File

@@ -0,0 +1,60 @@
//
// Tests whether we implement the correct methods from interfaces
//
using System;
interface IA {
void Draw ();
}
interface IB {
void Draw ();
}
class X : IA, IB {
public bool ia_called;
public bool ib_called;
void IA.Draw ()
{
ia_called = true;
}
void IB.Draw ()
{
ib_called = true;
}
}
class test {
public static int Main ()
{
X x = new X ();
((IA) x).Draw ();
Console.WriteLine ("IA: " + x.ia_called);
Console.WriteLine ("IB: " + x.ib_called);
if (x.ib_called)
return 1;
if (!x.ia_called)
return 2;
X y = new X ();
((IB) y).Draw ();
Console.WriteLine ("IA: " + x.ia_called);
Console.WriteLine ("IB: " + x.ib_called);
if (!y.ib_called)
return 3;
if (y.ia_called)
return 4;
Console.WriteLine ("All tests pass");
return 0;
}
}