Author: gert
Date: 2007-10-16 07:33:06 -0400 (Tue, 16 Oct 2007)
New Revision: 87575
Modified:
trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog
Log:
* AssemblyTest.cs: Added test for bug #334203. Use more meaningful name
for test for bug #49114.
Modified: trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
2007-10-16 11:11:06 UTC (rev 87574)
+++ trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
2007-10-16 11:33:06 UTC (rev 87575)
@@ -63,19 +63,49 @@
Assert.IsNull (obj, "#03");
}
- [Test]
+ [Test] // bug #49114
#if NET_2_0
[Category ("NotWorking")]
[ExpectedException (typeof (ArgumentException))]
#else
[ExpectedException (typeof (TypeLoadException))]
#endif
- public void TestGetType ()
+ public void GetType_TypeName_Invalid ()
{
- // Bug #49114
typeof (int).Assembly.GetType ("&blabla", true, true);
}
+ [Test] // bug #334203
+ [Category ("NotWorking")]
+ public void GetType_TypeName_AssemblyName ()
+ {
+ Assembly a = typeof (int).Assembly;
+ string typeName = typeof (string).AssemblyQualifiedName;
+ try {
+ a.GetType (typeName, true, false);
+ Assert.Fail ("#A1");
+#if NET_2_0
+ } catch (ArgumentException ex) {
+ Assert.AreEqual (typeof (ArgumentException),
ex.GetType (), "#A2");
+ Assert.IsNull (ex.InnerException, "#A3");
+ Assert.IsNotNull (ex.Message, "#A4");
+ Assert.IsNull (ex.ParamName, "#A5");
+ }
+#else
+ } catch (TypeLoadException ex) {
+ Assert.AreEqual (typeof (TypeLoadException),
ex.GetType (), "#A2");
+ Assert.IsNull (ex.InnerException, "#A3");
+ Assert.IsNotNull (ex.Message, "#A4");
+ Assert.IsTrue (ex.Message.IndexOf (typeName) !=
-1, "#A5");
+ }
+#endif
+
+ Type type = a.GetType (typeName, false);
+ Assert.IsNull (type, "#B1");
+ type = a.GetType (typeName, false, true);
+ Assert.IsNull (type, "#B2");
+ }
+
[Test]
public void GetEntryAssembly ()
{
Modified: trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog 2007-10-16
11:11:06 UTC (rev 87574)
+++ trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog 2007-10-16
11:33:06 UTC (rev 87575)
@@ -1,3 +1,8 @@
+2007-10-16 Gert Driesen <[EMAIL PROTECTED]>
+
+ * AssemblyTest.cs: Added test for bug #334203. Use more meaningful name
+ for test for bug #49114.
+
2007-10-04 Raja R Harinath <[EMAIL PROTECTED]>
* AssemblyTest.cs (bug328812): New test.
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches