2009-07-30 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 30 Jul 2009 11:20:57 +0000 (11:20 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 30 Jul 2009 11:20:57 +0000 (11:20 -0000)
* FieldInfoTest.cs: Add a test for #525733.

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

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

index 76797aaa2605256fda8a43bc4c012e7d65d983a6..cd5548062e41ec0625002873eb2634ddb173030d 100644 (file)
@@ -1,3 +1,7 @@
+2009-07-30  Zoltan Varga  <vargaz@gmail.com>
+
+       * FieldInfoTest.cs: Add a test for #525733.
+
 2009-07-27 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * AssemblyTest.cs: Add test for empty string passed to
index 0fb77ffbba6720cf3dbdd641c6c86ebbc2e50738..620b3ffe8b14c81f71935ff4f046849e42351cb7 100644 (file)
@@ -229,6 +229,19 @@ namespace MonoTests.System.Reflection
                                Assert.IsNull (ex.ParamName, "#5");
                        }
                }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void GetFieldFromHandle2_Incompatible ()
+               {
+                       RuntimeFieldHandle fh = typeof (FieldInfoTest<int>).GetField ("TestField").FieldHandle;
+
+                       FieldInfoTest<string> instance = new FieldInfoTest<string> ();
+                       Type t2 = instance.GetType ();
+                       RuntimeTypeHandle th = t2.TypeHandle;
+
+                       FieldInfo fi2 = FieldInfo.GetFieldFromHandle (fh, th);
+               }
 #endif
 
                [Test]