Browse Source

missing.

svn path=/trunk/mono/; revision=6418
Paolo Molaro 23 years ago
parent
commit
cf9da09578
1 changed files with 32 additions and 0 deletions
  1. 32 0
      mono/tests/cattr-field.cs

+ 32 - 0
mono/tests/cattr-field.cs

@@ -0,0 +1,32 @@
+using System;
+
+[My(val=2,sval="str",bb=0,S="Buh",P=4)]
+class T {
+	static int Main() {
+		object[] a = Attribute.GetCustomAttributes (typeof (T), true);
+		My attr = (My)a [0];
+		if (attr.val != 2)
+			return 1;
+		if (attr.P != 4)
+			return 2;
+		if (attr.S != "Buh")
+			return 3;
+		return 0;
+	}
+}
+
+class My : Attribute {
+	public int val;
+	public uint prop;
+	public string s;
+	public string sval;
+	public byte bb;
+	public uint P {
+		set {prop = value;}
+		get {return prop;}
+	}
+	public string S {
+		set {s = value;}
+		get {return s;}
+	}
+}