From 45d67a6fb1d6d789af7b4c4447e6f37441a25332 Mon Sep 17 00:00:00 2001 From: jbevain Date: Tue, 6 Apr 2010 15:38:58 +0000 Subject: [PATCH] fix ET tests for 4.0 git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@154860 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- .../Test/System.Linq.Expressions/ExpressionTest.cs | 17 ++++++++++++++--- .../System.Linq.Expressions/ExpressionTest_TypeIs.cs | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs b/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs index 200f5247d9..d524e80f5c 100644 --- a/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs +++ b/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs @@ -47,18 +47,25 @@ namespace MonoTests.System.Linq.Expressions { Expression.GetFuncType (null); } + static Type [] GetTestTypeArray (int length) + { + return Enumerable.Range (0, length - 1) + .Select (i => typeof (int)) + .ToArray (); + } + [Test] [ExpectedException (typeof (ArgumentException))] public void GetFuncTypeArgEmpty () { - Expression.GetFuncType (new Type [0]); + Expression.GetFuncType (Type.EmptyTypes); } [Test] [ExpectedException (typeof (ArgumentException))] public void GetFuncTypeArgTooBig () { - Expression.GetFuncType (new Type [6]); + Expression.GetFuncType (GetTestTypeArray (64)); } [Test] @@ -91,7 +98,7 @@ namespace MonoTests.System.Linq.Expressions { [ExpectedException (typeof (ArgumentException))] public void GetActionTypeArgTooBig () { - Expression.GetActionType (new Type [5]); + Expression.GetActionType (GetTestTypeArray (45)); } [Test] @@ -126,7 +133,9 @@ namespace MonoTests.System.Linq.Expressions { var p = Expression.Parameter (typeof (string), null); Assert.AreEqual (null, p.Name); Assert.AreEqual (typeof (string), p.Type); +#if !NET_4_0 Assert.AreEqual ("", p.ToString ()); +#endif } [Test] @@ -135,7 +144,9 @@ namespace MonoTests.System.Linq.Expressions { var p = Expression.Parameter (typeof (string), ""); Assert.AreEqual ("", p.Name); Assert.AreEqual (typeof (string), p.Type); +#if !NET_4_0 Assert.AreEqual ("", p.ToString ()); +#endif } [Test] diff --git a/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_TypeIs.cs b/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_TypeIs.cs index 914aaa5c34..9935548d70 100644 --- a/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_TypeIs.cs +++ b/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_TypeIs.cs @@ -104,6 +104,7 @@ namespace MonoTests.System.Linq.Expressions Assert.IsTrue (baz_is_bar (new Baz ())); } +#if !NET_4_0 // dlr still has the bug [Test] [Category ("NotDotNet")] [ExpectedException (typeof (ArgumentException))] @@ -111,6 +112,7 @@ namespace MonoTests.System.Linq.Expressions { Expression.TypeIs ("yoyo".ToConstant (), typeof (void)); } +#endif public static void TacTac () { -- 2.11.4.GIT