From a7751b8ef4aca39c7d8ca06c0877837f38f7bfce Mon Sep 17 00:00:00 2001 From: Jb Evain Date: Tue, 15 Jan 2008 10:06:30 +0000 Subject: [PATCH] 2008-01-15 Jb Evain * MethodInfoTest.cs: Add test for null arguments to MakeGenericMethod (#353849). svn path=/trunk/mcs/; revision=92930 --- .../corlib/Test/System.Reflection/ChangeLog | 5 +++++ .../Test/System.Reflection/MethodInfoTest.cs | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mcs/class/corlib/Test/System.Reflection/ChangeLog b/mcs/class/corlib/Test/System.Reflection/ChangeLog index 98509dc0f9d..14f16f9e4e3 100644 --- a/mcs/class/corlib/Test/System.Reflection/ChangeLog +++ b/mcs/class/corlib/Test/System.Reflection/ChangeLog @@ -1,3 +1,8 @@ +2008-01-15 Jb Evain + + * MethodInfoTest.cs: Add test for null arguments to + MakeGenericMethod (#353849). + 2008-01-06 Gert Driesen * AssemblyNameTest.cs: Improved tests for ProcessorArchictecture. diff --git a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs index 9dc9c5d3ed9..08a67696fae 100644 --- a/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs +++ b/mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs @@ -395,6 +395,26 @@ namespace MonoTests.System.Reflection .MakeGenericMethod (); } + public void SimpleGenericMethod () {} + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void MakeGenericMethodWithNullArray () + { + MethodInfo gmi = this.GetType ().GetMethod ("SimpleGenericMethod"); + + gmi.MakeGenericMethod ((Type []) null); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void MakeGenericMethodWithNullValueInTypesArray () + { + MethodInfo gmi = this.GetType ().GetMethod ("SimpleGenericMethod"); + + gmi.MakeGenericMethod (new Type [] { typeof (int), null }); + } + public static int? pass_nullable (int? i) { return i; -- 2.25.1