diff options
author | Jeremi Kurdek <59935235+jkurdek@users.noreply.github.com> | 2022-07-07 15:57:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 15:57:29 +0300 |
commit | 2898ebae5673bfbbd14428ba67c4eece9b995617 (patch) | |
tree | d9ce5eb1c1729d7ba500cf1681ba8cd247c20e31 | |
parent | ef2d0f25b72469b55925251a79f12bcbf98644bf (diff) |
Fixed AddSuppresionsBeforeAttributeRemoval test (#2882)
The test generated warnings which were not checked. The XML file was pointing to the wrong assembly and the linker raised IL2072 warning. Instead, the test verified the suppression of warning IL2067, which was not raised by the linker in the first place.
Co-authored-by: Jeremi Kurdek <t-jkurdek@microsoft.com>
2 files changed, 5 insertions, 7 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.cs b/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.cs index 0b8fe2311..dc0d349c3 100644 --- a/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.cs +++ b/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.cs @@ -6,20 +6,18 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { -#if !NETCOREAPP - [Reference ("System.Core.dll")] -#endif - [SkipKeptItemsValidation] [SetupLinkAttributesFile ("AddSuppressionsBeforeAttributeRemoval.xml")] - [LogDoesNotContain ("IL2067: Mono.Linker.Tests.Cases.Warnings.WarningSuppression.AddSuppressionsBeforeAttributeRemoval.Main()")] + + [ExpectedNoWarnings] public class AddSuppressionsBeforeAttributeRemoval { + [Kept] public static Type TriggerUnrecognizedPattern () { return typeof (AddedPseudoAttributeAttribute); } - [UnconditionalSuppressMessage ("ILLinker", "IL2067")] + [UnconditionalSuppressMessage ("ILLinker", "IL2072")] public static void Main () { Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); diff --git a/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.xml b/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.xml index 61f620556..e9817e454 100644 --- a/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.xml +++ b/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/AddSuppressionsBeforeAttributeRemoval.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <linker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../src/ILLink.Shared/ILLink.LinkAttributes.xsd"> - <assembly fullname="test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> + <assembly fullname="*"> <type fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute"> <attribute internal="RemoveAttributeInstances" /> </type> |