diff options
author | Mike Voorhees <michaelv@unity3d.com> | 2017-05-09 20:08:01 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-05-09 20:48:30 +0300 |
commit | 905fd565d6ff664c9cbe243fec0e50e4d716190c (patch) | |
tree | 1a9c39ec693bb9a946e4ab0b4092853b93fdbc29 /linker/Tests | |
parent | e3c3100f21b4afdcd5180d1c1dc61d24f1e09931 (diff) |
Change some test cases to use types that have not been moved around in newer framework versions
System.Func used to live in System.Core, now it's in mscorlib. As a result, when we run our unit tests against our old mono they fail because the tests only reference mscorlib right now.
We could add a reference to System.Core.dll, but there's really no reason why we need to use System.Func, so let's use IDictionary isntead
Diffstat (limited to 'linker/Tests')
3 files changed, 15 insertions, 12 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameter.cs b/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameter.cs index a656b1775..5f8a4389e 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameter.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameter.cs @@ -1,4 +1,5 @@ -using Mono.Linker.Tests.Cases.Expectations.Assertions; +using System.Collections.Generic; +using Mono.Linker.Tests.Cases.Expectations.Assertions; namespace Mono.Linker.Tests.Cases.Generics { class MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameter { @@ -11,16 +12,16 @@ namespace Mono.Linker.Tests.Cases.Generics { [KeptMember (".ctor()")] public abstract class Base<TSource> { [Kept] - public abstract TResult1 Method<TResult1> (System.Func<TSource, TResult1> arg); + public abstract TResult1 Method<TResult1> (IDictionary<TSource, TResult1> arg); } [KeptMember (".ctor()")] [KeptBaseType (typeof (Base<>), "TResult1")] public class Derived<TSource, TResult1> : Base<TResult1> { [Kept] - public override TResult2 Method<TResult2> (System.Func<TResult1, TResult2> arg) + public override TResult2 Method<TResult2> (IDictionary<TResult1, TResult2> arg) { - return arg (default (TResult1)); + return default (TResult2); } } } diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase.cs b/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase.cs index 78eb14425..37d1305dc 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase.cs @@ -1,4 +1,5 @@ -using Mono.Linker.Tests.Cases.Expectations.Assertions; +using System.Collections.Generic; +using Mono.Linker.Tests.Cases.Expectations.Assertions; namespace Mono.Linker.Tests.Cases.Generics { class MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase { @@ -14,7 +15,7 @@ namespace Mono.Linker.Tests.Cases.Generics { [KeptMember (".ctor()")] public abstract class Nested { [Kept] - public abstract TResult1 Method<TResult1> (System.Func<TSource, TResult1> arg); + public abstract TResult1 Method<TResult1> (IDictionary<TSource, TResult1> arg); } } @@ -22,9 +23,9 @@ namespace Mono.Linker.Tests.Cases.Generics { [KeptBaseType (typeof (Base<>.Nested), "TResult1")] public class Derived<TSource, TResult1> : Base<TResult1>.Nested { [Kept] - public override TResult2 Method<TResult2> (System.Func<TResult1, TResult2> arg) + public override TResult2 Method<TResult2> (IDictionary<TResult1, TResult2> arg) { - return arg (default (TResult1)); + return default (TResult2); } } } diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase2.cs b/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase2.cs index 888e4278d..f6e1370a3 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase2.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases/Generics/MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase2.cs @@ -1,4 +1,5 @@ -using Mono.Linker.Tests.Cases.Expectations.Assertions; +using System.Collections.Generic; +using Mono.Linker.Tests.Cases.Expectations.Assertions; namespace Mono.Linker.Tests.Cases.Generics { class MethodWithParameterWhichHasGenericParametersAndOverrideUsesADifferentNameForGenericParameterNestedCase2 { @@ -14,7 +15,7 @@ namespace Mono.Linker.Tests.Cases.Generics { [KeptMember (".ctor()")] public abstract class Nested<T1, T2, T3> { [Kept] - public abstract TResult1 Method<TResult1> (System.Func<TSource, TResult1> arg); + public abstract TResult1 Method<TResult1> (IDictionary<TSource, TResult1> arg); } } @@ -22,9 +23,9 @@ namespace Mono.Linker.Tests.Cases.Generics { [KeptBaseType (typeof (Base<>.Nested<,,>), "TResult1", typeof (int), typeof (int), typeof (string))] public class Derived<TSource, TResult1> : Base<TResult1>.Nested<int, int, string> { [Kept] - public override TResult2 Method<TResult2> (System.Func<TResult1, TResult2> arg) + public override TResult2 Method<TResult2> (IDictionary<TResult1, TResult2> arg) { - return arg (default (TResult1)); + return default (TResult2); } } } |