Author: zoltan
Date: 2007-12-05 08:19:05 -0500 (Wed, 05 Dec 2007)
New Revision: 90763
Modified:
trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog
trunk/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
Log:
2007-12-05 Zoltan Varga <[EMAIL PROTECTED]>
* FieldInfoTest.cs: Add tests for #346160.
Modified: trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog 2007-12-05
13:18:22 UTC (rev 90762)
+++ trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog 2007-12-05
13:19:05 UTC (rev 90763)
@@ -1,3 +1,7 @@
+2007-12-05 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * FieldInfoTest.cs: Add tests for #346160.
+
2007-12-03 Zoltan Varga <[EMAIL PROTECTED]>
* FieldInfoTest.cs: Add GetRawDefaultValue () tests.
Modified: trunk/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
2007-12-05 13:18:22 UTC (rev 90762)
+++ trunk/mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs
2007-12-05 13:19:05 UTC (rev 90763)
@@ -240,6 +240,27 @@
#endif
}
+ class Foo {
+ public static int static_field;
+ public int field;
+ }
+
+ [ExpectedException (typeof (ArgumentException))]
+ public void GetValueWrongObject ()
+ {
+ Foo f = new Foo ();
+
+ typeof (Foo).GetField ("field").GetValue (typeof (int));
+ }
+
+ public void GetValueWrongObjectStatic ()
+ {
+ Foo f = new Foo ();
+
+ // This is allowed in MS.NET
+ typeof (Foo).GetField ("static_field").GetValue (typeof
(int));
+ }
+
#if NET_2_0
#if !TARGET_JVM // ReflectionOnlyLoad not supported for TARGET_JVM
[Test]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches