summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-554.cs
blob: 6de449eb1e798ef14ba4896f613f2c456f73ef73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Reflection;

namespace Mono.Test
{
	class Program
	{
		public static int Main ()
		{
			Type t = typeof (B);
			InterfaceMapping map = t.GetInterfaceMap (typeof (ITest));

			foreach (MethodInfo m in map.TargetMethods) {
				if (m.Name.Contains ("."))
					return 3;
			}

			if (map.TargetMethods.Length != 3)
				return 1;

			MethodInfo[] methods = t.GetMethods (BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
			if (methods.Length != 0)
				return 2;

			return 0;
		}
	}

	public interface ITest
	{
		bool Success
		{
			get;
		}

		void Run ();
		void Gen<T> ();
	}

	public class A
	{
		public bool Success
		{
			get { return true; }
		}

		public void Run ()
		{
		}

		public void Gen<U> ()
		{
		}
	}

	public class B : A, ITest
	{
	}
}