Author: marek
Date: 2007-01-14 09:31:14 -0500 (Sun, 14 Jan 2007)
New Revision: 70980

Added:
   trunk/mcs/tests/test-553.cs
Modified:
   trunk/mcs/tests/test-454.cs
Log:
New tests.

Modified: trunk/mcs/tests/test-454.cs
===================================================================
--- trunk/mcs/tests/test-454.cs 2007-01-14 14:27:33 UTC (rev 70979)
+++ trunk/mcs/tests/test-454.cs 2007-01-14 14:31:14 UTC (rev 70980)
@@ -1,10 +1,16 @@
-// string array initializer is allowed as a parameter type.
+// Test various kinds of arrays as custom attribute parameters
 using System;
 
+enum EnumType {
+       X,
+       Y
+};
+
 class FooAttribute : Attribute
 {
        public string [] StringValues;
        public object [] ObjectValues;
+       public EnumType [] EnumValues;
        public Type [] Types;
 
        public FooAttribute ()
@@ -14,11 +20,12 @@
 
 [Foo (StringValues = new string [] {"foo", "bar", "baz"},
        ObjectValues = new object [] {1, 'A', "B"},
+       EnumValues = new EnumType [] { EnumType.X, EnumType.Y },
        Types = new Type [] {typeof (int), typeof (Type)}
        )]
 class Test
 {
-       public static void Main () 
+       public static int Main () 
        {
                FooAttribute foo = (FooAttribute) typeof (Test)
                        .GetCustomAttributes (false) [0];
@@ -28,9 +35,13 @@
                        || 1 != (int) foo.ObjectValues [0]
                        || 'A' != (char) foo.ObjectValues [1]
                        || "B" != (string) foo.ObjectValues [2]
+                       || EnumType.X != foo.EnumValues [0]
+                       || EnumType.Y != foo.EnumValues [1]
                        || foo.Types [0] != typeof (int)
                        || foo.Types [1] != typeof (Type)
                        )
-                       throw new ApplicationException ();
+                       return 1;
+               
+               return 0;
        }
-}
+}
\ No newline at end of file

Added: trunk/mcs/tests/test-553.cs
===================================================================
--- trunk/mcs/tests/test-553.cs 2007-01-14 14:27:33 UTC (rev 70979)
+++ trunk/mcs/tests/test-553.cs 2007-01-14 14:31:14 UTC (rev 70980)
@@ -0,0 +1,16 @@
+class A
+{
+       public virtual void Add (object o)
+       {
+       }
+}
+
+class B : A
+{
+       public virtual bool Add (object o)
+       {
+               return false;
+       }
+       
+       public static void Main () {}
+}
\ No newline at end of file


Property changes on: trunk/mcs/tests/test-553.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to