forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for deleting custom attributes using ApplyUpdate (dotne…
…t#56644) * Add test case for deleting custom attributes using ApplyUpdate Issue: dotnet#54284 * Fix mono failures
- Loading branch information
Showing
7 changed files
with
507 additions
and
374 deletions.
There are no files selected for viewing
716 changes: 372 additions & 344 deletions
716
src/libraries/System.Runtime.Loader/System.Runtime.Loader.sln
Large diffs are not rendered by default.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...ystem.Reflection.Metadata.ApplyUpdate.Test.CustomAttributeDelete/CustomAttributeDelete.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
|
||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
[AttributeUsage (AttributeTargets.Method, AllowMultiple=true)] | ||
public class MyDeleteAttribute : Attribute | ||
{ | ||
public MyDeleteAttribute (string stringValue) { StringValue = stringValue; } | ||
|
||
public MyDeleteAttribute (Type typeValue) { TypeValue = typeValue; } | ||
|
||
public MyDeleteAttribute (int x) { IntValue = x; } | ||
|
||
public string StringValue { get; set; } | ||
public Type TypeValue {get; set; } | ||
public int IntValue {get; set; } | ||
} | ||
|
||
public class ClassWithCustomAttributeDelete | ||
{ | ||
[MyDeleteAttribute ("abcd")] | ||
public static string Method1 () => null; | ||
|
||
[MyDeleteAttribute (typeof(Exception))] | ||
public static string Method2 () => null; | ||
|
||
[MyDeleteAttribute (42, StringValue = "hijkl", TypeValue = typeof(Type))] | ||
[MyDeleteAttribute (17, StringValue = "", TypeValue = typeof(object))] | ||
public static string Method3 () => null; | ||
|
||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...em.Reflection.Metadata.ApplyUpdate.Test.CustomAttributeDelete/CustomAttributeDelete_v1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
|
||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
[AttributeUsage (AttributeTargets.Method, AllowMultiple=true)] | ||
public class MyDeleteAttribute : Attribute | ||
{ | ||
public MyDeleteAttribute (string stringValue) { StringValue = stringValue; } | ||
|
||
public MyDeleteAttribute (Type typeValue) { TypeValue = typeValue; } | ||
|
||
public MyDeleteAttribute (int x) { IntValue = x; } | ||
|
||
public string StringValue { get; set; } | ||
public Type TypeValue {get; set; } | ||
public int IntValue {get; set; } | ||
} | ||
|
||
public class ClassWithCustomAttributeDelete | ||
{ | ||
public static string Method1 () => null; | ||
|
||
public static string Method2 () => null; | ||
|
||
[MyDeleteAttribute (17, StringValue = "Not Deleted", TypeValue = typeof(object))] | ||
public static string Method3 () => null; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...mAttributeDelete/System.Reflection.Metadata.ApplyUpdate.Test.CustomAttributeDelete.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<RootNamespace>System.Runtime.Loader.Tests</RootNamespace> | ||
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks> | ||
<TestRuntime>true</TestRuntime> | ||
<DeltaScript>deltascript.json</DeltaScript> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="CustomAttributeDelete.cs" /> | ||
</ItemGroup> | ||
</Project> |
6 changes: 6 additions & 0 deletions
6
...Update/System.Reflection.Metadata.ApplyUpdate.Test.CustomAttributeDelete/deltascript.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"changes": [ | ||
{"document": "CustomAttributeDelete.cs", "update": "CustomAttributeDelete_v1.cs"}, | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters