2008-09-07 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sun, 7 Sep 2008 14:11:28 +0000 (14:11 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sun, 7 Sep 2008 14:11:28 +0000 (14:11 -0000)
* FieldInfoTest.cs: Add tests for #424077.

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

mcs/class/corlib/Test/System.Reflection/ChangeLog
mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs

index e4bcbdd7cfd15102f4c133d4be654c18f354deae..19eb0c5caeb9fc904bbc9a0367c9ef886e17f5dd 100644 (file)
@@ -1,3 +1,7 @@
+2008-09-07  Zoltan Varga  <vargaz@gmail.com>
+
+       * FieldInfoTest.cs: Add tests for #424077.
+
 2008-06-30  Rodrigo Kumpera <rkumpera@novell.com>
 
        * MethodBase.cs: Fix the 1.0 build.
index 996ce25e1efc090341c50a3911ffbab02e429815..86add904876df26027ad5d40a0bf0592152903b2 100644 (file)
@@ -447,6 +447,27 @@ namespace MonoTests.System.Reflection
                        typeof (FieldInfoTest).GetField ("non_const_field").GetRawConstantValue ();
                }
 
+#if NET_2_0
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void GetValueOpenGeneric ()
+               {
+                       typeof(Foo<>).GetField ("field").GetValue (null);
+               }
+
+               [Test]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void SetValueOpenGeneric ()
+               {
+                       typeof(Foo<>).GetField ("field").GetValue (null);
+               }
+
+               public class Foo<T>
+               {
+                       public static int field;
+               }
+#endif
+
                public enum IntEnum {
                        First = 1,
                        Second = 2,