diff options
author | Marek Safar <marek.safar@gmail.com> | 2006-02-28 01:46:25 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2006-02-28 01:46:25 +0300 |
commit | 495b44170fd02e82cfefb985128218ea61758e38 (patch) | |
tree | 69b4826faccb648a2e63b82d021c68dc3ceaabe4 /mcs | |
parent | ce9291281593887d381a429ab947004424c376d2 (diff) |
2006-02-27 Marek Safar <marek.safar@seznam.cz>
* test-492.cs: Another attribute tests.
svn path=/trunk/mcs/; revision=57359
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/tests/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/tests/known-issues-gmcs | 1 | ||||
-rw-r--r-- | mcs/tests/test-492.cs | 53 |
3 files changed, 58 insertions, 0 deletions
diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog index 2c63ebabb8c..edfa77218f2 100644 --- a/mcs/tests/ChangeLog +++ b/mcs/tests/ChangeLog @@ -1,3 +1,7 @@ +2006-02-27 Marek Safar <marek.safar@seznam.cz> + + * test-492.cs: Another attribute tests. + 2006-02-14 Martin Baulig <martin@ximian.com> * known-issues-gmcs: Add test-473.cs. diff --git a/mcs/tests/known-issues-gmcs b/mcs/tests/known-issues-gmcs index 8814f0419fc..91ac1488ade 100644 --- a/mcs/tests/known-issues-gmcs +++ b/mcs/tests/known-issues-gmcs @@ -15,6 +15,7 @@ test-cls-01.cs test-partial-07.cs test-partial-11.cs test-partial-12.cs +test-492.cs test-473.cs diff --git a/mcs/tests/test-492.cs b/mcs/tests/test-492.cs new file mode 100644 index 00000000000..45ed1bdbfde --- /dev/null +++ b/mcs/tests/test-492.cs @@ -0,0 +1,53 @@ +using System;
+using System.Reflection;
+
+namespace Test {
+ [AttributeUsage (AttributeTargets.All, AllowMultiple = true)]
+ public class My1Attribute : Attribute
+ {
+ public My1Attribute (object o)
+ {
+ if (o != null)
+ throw new ApplicationException ();
+ }
+ }
+
+ public class My2Attribute : Attribute
+ {
+ public My2Attribute (string[] s)
+ {
+ if (s.Length != 0)
+ throw new ApplicationException ();
+ }
+ }
+
+ public class My3Attribute : Attribute
+ {
+ public My3Attribute (byte b)
+ {
+ if (b != 0xFF)
+ throw new ApplicationException ();
+ }
+ }
+
+
+ [My3(unchecked((byte)-1))]
+ [My1((object)null)]
+ [My1(null)]
+ [My2(new string[0])]
+ public class Test {
+ static public int Main() {
+ System.Reflection.MemberInfo info = typeof (Test);
+ object[] attributes = info.GetCustomAttributes (false);
+
+ if (attributes.Length != 4)
+ return 1;
+
+ for (int i = 0; i < attributes.Length; i ++) {
+ Console.WriteLine (attributes [i]);
+ }
+
+ return 0;
+ }
+ }
+}
|