2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-492.cs
blob45d65cf0f06335882b75381ec444229537d59268
1 using System;
2 using System.Reflection;
4 namespace Test {
5 [AttributeUsage (AttributeTargets.All, AllowMultiple = true)]
6 public class My1Attribute : Attribute
8 public My1Attribute (object o)
10 if (o != null)
11 throw new ApplicationException ();
15 public class My2Attribute : Attribute
17 public My2Attribute (string[] s)
19 if (s.Length != 0)
20 throw new ApplicationException ();
24 public class My3Attribute : Attribute
26 public My3Attribute (byte b)
28 if (b != 0xFF)
29 throw new ApplicationException ();
34 [My3(unchecked((byte)-1))]
35 [My1((object)null)]
36 [My1(null)]
37 [My2(new string[0])]
38 public class Test {
39 static public int Main() {
40 System.Reflection.MemberInfo info = typeof (Test);
41 object[] attributes = info.GetCustomAttributes (false);
43 if (attributes.Length != 4)
44 return 1;
46 for (int i = 0; i < attributes.Length; i ++) {
47 Console.WriteLine (attributes [i]);
50 return 0;