2004-03-09 Joshua Tauberer <tauberer@for.net>
authorJoshua Tauberer <joshua@mono-cvs.ximian.com>
Tue, 9 Mar 2004 20:32:10 +0000 (20:32 -0000)
committerJoshua Tauberer <joshua@mono-cvs.ximian.com>
Tue, 9 Mar 2004 20:32:10 +0000 (20:32 -0000)
* test-232.cs: Tests for { ... }-style array creation

svn path=/trunk/mcs/; revision=23846

mcs/tests/ChangeLog
mcs/tests/Makefile
mcs/tests/README.tests
mcs/tests/test-232.cs [new file with mode: 0644]

index 097a92aded87e0c8c06829e93fbbb622fdde247a..a5722e7b7f533b35c88159a4256de31b9c37f9b7 100755 (executable)
@@ -1,3 +1,7 @@
+2004-03-09  Joshua Tauberer <tauberer@for.net>
+
+       * test-232.cs: Tests for { ... }-style array creation
+
 2004-02-25  Marek Safar <marek.safar@seznam.cz>
 
        * Makefile: Enable test-230.
index f4aaf43d5b6cac0a6e4b470db95d5935a5f076eb..8f3930f9df99f91504276c8cb942afbd623c6c49 100644 (file)
@@ -36,7 +36,7 @@ TEST_SOURCES = \
        test-201 test-202 test-203 test-204 test-205 test-206 test-207 test-208 test-209 test-210 \
        test-211 test-212 test-213 test-214 test-215 test-216 test-217 test-218 test-219 test-220 \
        test-221 test-222 test-223 test-224 test-225 test-226 test-227          test-229 test-230 \
-       test-231                                                                                  \
+       test-231 test-232                                                                         \
        cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-6 cls-test-7 cls-test-10  \
        cls-test-11 cls-test-14 cls-test-15 cls-test-16
 
index 37406820097976e6c297e8135e4190f0f5e0d8b7..2b6df66912b97cd3a4dae343d7586733303eb0a6 100644 (file)
@@ -51,7 +51,7 @@ Test cases listed by Category:
 
 * Arrays and array creation
 
-  test-165.cs, test-167.cs
+  test-165.cs, test-167.cs, test-232.cs
 
 * Labels and goto
 
@@ -449,6 +449,10 @@ test-231.cs:
 ------------
 Test for emitting callvirt when we need it.
 
+test-232.cs:
+------------
+Tests for {...}-style array creation
+
 verify-1.cs
 -----------
 Test whether we do not jump out of the method in a Try/Finally block.
diff --git a/mcs/tests/test-232.cs b/mcs/tests/test-232.cs
new file mode 100644 (file)
index 0000000..119d43b
--- /dev/null
@@ -0,0 +1,115 @@
+using System;
+using System.Reflection;
+
+public class CtorInfoTest
+{
+       public static void Main(string[] args)
+       {
+               // uses static initialization
+               int[] iarray = // int array, int constants
+               {
+                       0,
+                       1,
+                       2,
+                       3,
+                       4,
+                       5,
+                       6,
+               };
+               
+               // mcs used to throw with 7 or more elements in the array initializer
+               ConstructorInfo[] ciarray = // ref array, null constants
+               {
+                       null,
+                       null,
+                       null,
+                       null,
+                       null,
+                       null,
+                       null,
+               };
+
+               string[] scarray = // string array, string constants
+               {
+                       "a",
+                       "b",
+                       "c",
+                       "d",
+                       "e",
+                       "f",
+                       "g",
+               };
+
+               string[] snarray = // string array, null constants
+               {
+                       null,
+                       null,
+                       null,
+                       null,
+                       null,
+                       null,
+                       null,
+               };
+
+               decimal[] darray = // decimal constants
+               {
+                       0M,
+                       1M,
+                       2M,
+                       3M,
+                       4M,
+                       5M,
+                       6M,
+                       7M,
+               };
+
+               IConvertible[] lcarray = // boxed integer constants
+               {
+                       1,
+                       2,
+                       3,
+                       4,
+                       5,
+                       6,
+                       7,
+               };
+               
+               AttributeTargets[] atarray = // enum constants
+               {
+                       AttributeTargets.Assembly,
+                       AttributeTargets.Module,
+                       AttributeTargets.Class,
+                       AttributeTargets.Struct,
+                       AttributeTargets.Enum,
+                       AttributeTargets.Constructor,
+                       AttributeTargets.Method,
+                       AttributeTargets.Property,
+                       AttributeTargets.Field,
+                       AttributeTargets.Event,
+                       AttributeTargets.Interface,
+                       AttributeTargets.Parameter,
+                       AttributeTargets.Delegate,
+                       AttributeTargets.ReturnValue,
+                       AttributeTargets.All,
+               };
+
+               System.Enum[] eatarray = // boxed enum constants
+               {
+                       AttributeTargets.Assembly,
+                       AttributeTargets.Module,
+                       AttributeTargets.Class,
+                       AttributeTargets.Struct,
+                       AttributeTargets.Enum,
+                       AttributeTargets.Constructor,
+                       AttributeTargets.Method,
+                       AttributeTargets.Property,
+                       AttributeTargets.Field,
+                       AttributeTargets.Event,
+                       AttributeTargets.Interface,
+                       AttributeTargets.Parameter,
+                       AttributeTargets.Delegate,
+                       AttributeTargets.ReturnValue,
+                       AttributeTargets.All,
+               };
+       }
+}