Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitek Karas <10670590+vitek-karas@users.noreply.github.com>2022-09-21 16:18:55 +0300
committerGitHub <noreply@github.com>2022-09-21 16:18:55 +0300
commit3443678a7cc9654bbbe5102821301450ba9f05ea (patch)
tree6ecf987e51e4964c45b438ff166f39ba3f219bc8 /test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs
parentfda9d062dea827a19f1eae5cb2a0adbc63cba483 (diff)
Cleanup tests for cases which use different warnings codes that the test mentions (#3044)
We were lacking validation for some of the warnings, and so change in behavior of the product wasn't reflected in the tests. This cleans up tests for IL2053 and IL2054 (which are not produced anymore).
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs')
-rw-r--r--test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs b/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs
index 382e847bc..2475dd4f4 100644
--- a/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs
+++ b/test/Mono.Linker.Tests.Cases/LinkAttributes/LinkerAttributeRemoval.cs
@@ -54,13 +54,14 @@ namespace Mono.Linker.Tests.Cases.LinkAttributes
// [RemovedAttributeInAssembly ("LinkerAttributeRemovalEmbeddedAndLazyLoad.dll", typeof (EmbeddedAttributeToBeRemoved), typeof (TypeWithEmbeddedAttributeToBeRemoved))]
[KeptAttributeInAssembly ("LinkerAttributeRemovalEmbeddedAndLazyLoad", typeof (EmbeddedAttributeToBeRemoved), typeof (TypeWithEmbeddedAttributeToBeRemoved))]
- [LogContains ("IL2045: Mono.Linker.Tests.Cases.LinkAttributes.LinkerAttributeRemoval.TestType(): Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute'")]
[LogContains ("IL2045: Mono.Linker.Tests.Cases.LinkAttributes.Dependencies.TypeOnCopyAssemblyWithAttributeUsage.TypeOnCopyAssemblyWithAttributeUsage(): Attribute 'Mono.Linker.Tests.Cases.LinkAttributes.Dependencies.TestAttributeReferencedAsTypeFromCopyAssemblyAttribute'")]
-
[LogDoesNotContain ("IL2045")] // No other 2045 messages should be logged
+ [ExpectedWarning ("IL2049", "'InvalidInternal'", FileName = "LinkerAttributeRemoval.xml")]
[ExpectedWarning ("IL2048", "RemoveAttributeInstances", FileName = "LinkerAttributeRemoval.xml")]
+ [ExpectedNoWarnings]
+
[KeptMember (".ctor()")]
class LinkerAttributeRemoval
{
@@ -68,7 +69,7 @@ namespace Mono.Linker.Tests.Cases.LinkAttributes
{
var instance = new LinkerAttributeRemoval ();
instance._fieldWithCustomAttribute = null;
- string value = instance.methodWithCustomAttribute ("parameter");
+ string value = instance.methodWithCustomAttribute (null);
TestType ();
_ = new TypeOnCopyAssemblyWithAttributeUsage ();
@@ -94,9 +95,10 @@ namespace Mono.Linker.Tests.Cases.LinkAttributes
[return: DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors)]
private string methodWithCustomAttribute ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors)] string parameterWithCustomAttribute)
{
- return "this is a return value";
+ return null;
}
+ [ExpectedWarning ("IL2045", "Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute'")]
[Kept]
public static void TestType ()
{