From bff5d8b55adb71afd0f132b9e15646787b07b879 Mon Sep 17 00:00:00 2001 From: Mateo Torres-Ruiz Date: Tue, 1 Jun 2021 09:20:35 -0700 Subject: Add support for UnrecognizedReflectionAccessPattern in analyzer test infra (#2048) * Refactor TestCaseUtils * Whitespace --- test/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs | 2 +- test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs | 4 ++-- .../Mono.Linker.Tests.Cases/DataFlow/MethodReturnParameterDataFlow.cs | 2 +- test/Mono.Linker.Tests.Cases/DataFlow/MethodThisDataFlow.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test/Mono.Linker.Tests.Cases/DataFlow') diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs index 380b72a70..8b9fc965c 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs @@ -143,7 +143,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow TypeStore._staticTypeWithPublicParameterlessConstructor = GetUnkownType (); } - [UnrecognizedReflectionAccessPattern (typeof (TypeStore), nameof (TypeStore._staticTypeWithPublicParameterlessConstructor), messageCode: "IL2064", message: nameof (TypeStore._staticTypeWithPublicParameterlessConstructor))] + [UnrecognizedReflectionAccessPattern (typeof (TypeStore), nameof (TypeStore._staticTypeWithPublicParameterlessConstructor), messageCode: "IL2064", message: new string[] { nameof (TypeStore._staticTypeWithPublicParameterlessConstructor) })] private void WriteUnknownValue () { var array = new object[1]; diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs index 0791625ab..0e6dcf1c7 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/GetTypeDataFlow.cs @@ -121,9 +121,9 @@ namespace Mono.Linker.Tests.Cases.DataFlow } [UnrecognizedReflectionAccessPattern (typeof (GetTypeDataFlow), nameof (RequireNonPublicConstructors), new Type[] { typeof (Type) }, - messageCode: "IL2072", message: "GetType")] + messageCode: "IL2072", message: new string[] { "GetType" })] [UnrecognizedReflectionAccessPattern (typeof (Type), nameof (Type.GetType), new Type[] { typeof (string) }, - messageCode: "IL2057", message: "System.Type.GetType(String)")] + messageCode: "IL2057", message: new string[] { "System.Type.GetType(String)" })] static void TestMultipleMixedValues () { string typeName = null; diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/MethodReturnParameterDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/MethodReturnParameterDataFlow.cs index 61f92971a..c46e9ab54 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/MethodReturnParameterDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/MethodReturnParameterDataFlow.cs @@ -127,7 +127,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow [UnrecognizedReflectionAccessPattern (typeof (MethodReturnParameterDataFlow), nameof (ReturnUnknownValue), new Type[] { }, returnType: typeof (Type), - messageCode: "IL2063", message: nameof (ReturnUnknownValue))] + messageCode: "IL2063", message: new string[] { nameof (ReturnUnknownValue) })] [return: DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors)] Type ReturnUnknownValue () { diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/MethodThisDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/MethodThisDataFlow.cs index a8bfbed1f..e1eb09b05 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/MethodThisDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/MethodThisDataFlow.cs @@ -95,7 +95,7 @@ namespace Mono.Linker.Tests.Cases.DataFlow } [UnrecognizedReflectionAccessPattern (typeof (MethodThisDataFlowTypeTest), nameof (MethodThisDataFlowTypeTest.RequireThisNonPublicMethods), new Type[] { }, - messageCode: "IL2065", message: nameof (MethodThisDataFlowTypeTest.RequireThisNonPublicMethods))] + messageCode: "IL2065", message: new string[] { nameof (MethodThisDataFlowTypeTest.RequireThisNonPublicMethods) })] static void TestUnknownThis () { var array = new object[1]; -- cgit v1.2.3