From 1ed1337163b4239d9782e05997d563ee03bde661 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 25 Sep 2020 09:35:43 +0200 Subject: Enable some code analyzers and make the build pass (#1505) --- .../Assertions/ExpectedExceptionHandlerSequenceAttribute.cs | 2 +- .../Assertions/ExpectedInstructionSequenceAttribute.cs | 2 +- .../Assertions/ExpectedLocalsSequenceAttribute.cs | 4 ++-- .../Assertions/KeptInitializerData.cs | 2 +- .../Assertions/NoLinkedOutputAttribute.cs | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) (limited to 'test/Mono.Linker.Tests.Cases.Expectations/Assertions') diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedExceptionHandlerSequenceAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedExceptionHandlerSequenceAttribute.cs index a90456dc6..0c9f10e4a 100644 --- a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedExceptionHandlerSequenceAttribute.cs +++ b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedExceptionHandlerSequenceAttribute.cs @@ -8,7 +8,7 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions public ExpectedExceptionHandlerSequenceAttribute (string[] types) { if (types == null) - throw new ArgumentNullException (); + throw new ArgumentNullException (nameof (types)); } } } \ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs index 5254351f5..7afdbb3b5 100644 --- a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs +++ b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs @@ -8,7 +8,7 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions public ExpectedInstructionSequenceAttribute (string[] opCodes) { if (opCodes == null) - throw new ArgumentNullException (); + throw new ArgumentNullException (nameof (opCodes)); } } } \ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs index 6eea5b561..17f9cae1c 100644 --- a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs +++ b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs @@ -8,13 +8,13 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions public ExpectedLocalsSequenceAttribute (string[] types) { if (types == null) - throw new ArgumentNullException (); + throw new ArgumentNullException (nameof (types)); } public ExpectedLocalsSequenceAttribute (Type[] types) { if (types == null) - throw new ArgumentNullException (); + throw new ArgumentNullException (nameof (types)); } } } \ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs index b2c5647f0..6c448617c 100644 --- a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs +++ b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs @@ -13,7 +13,7 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions public KeptInitializerData (int occurrenceIndexInBody) { if (occurrenceIndexInBody < 0) - throw new ArgumentException (); + throw new ArgumentOutOfRangeException (nameof (occurrenceIndexInBody)); } } } \ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/NoLinkedOutputAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/NoLinkedOutputAttribute.cs index 0537a62e1..77574cad6 100644 --- a/test/Mono.Linker.Tests.Cases.Expectations/Assertions/NoLinkedOutputAttribute.cs +++ b/test/Mono.Linker.Tests.Cases.Expectations/Assertions/NoLinkedOutputAttribute.cs @@ -2,6 +2,7 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions { + [AttributeUsage (AttributeTargets.Class)] public class NoLinkedOutputAttribute : Attribute { public NoLinkedOutputAttribute () { } -- cgit v1.2.3