Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic attributes handling in CustomAttributeDecoder #72561

Merged
merged 10 commits into from
Aug 9, 2022
Prev Previous commit
Add back [ConditionalFact(typeof(PlatformDetection), nameof(PlatformD…
…etection.HasAssemblyFiles))]
  • Loading branch information
buyaa-n committed Aug 9, 2022
commit 613d6b37c0ee9ab47804035b5fafa6861c70b9bb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace System.Reflection.Metadata.Decoding.Tests
{
public class CustomAttributeDecoderTests
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles), nameof(PlatformDetection.IsMonoRuntime))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void TestCustomAttributeDecoder()
{
Expand Down Expand Up @@ -84,7 +84,7 @@ public void TestCustomAttributeDecoder()
}
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73593", TestRuntimes.Mono)]
public void TestCustomAttributeDecoderUsingReflection()
{
Expand Down Expand Up @@ -197,7 +197,8 @@ public void TestCustomAttributeDecoderUsingReflection()
}
}

[Fact]
#if NETCOREAPP // Generic attribute is not supported on .NET Framework.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void TestCustomAttributeDecoderGenericUsingReflection()
buyaa-n marked this conversation as resolved.
Show resolved Hide resolved
{
Expand Down Expand Up @@ -245,7 +246,7 @@ public void TestCustomAttributeDecoderGenericUsingReflection()
}
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60579", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void TestCustomAttributeDecoderGenericArray()
{
Expand Down Expand Up @@ -340,6 +341,7 @@ public GenericAttribute2(K key, V value) { }
public V Value { get; set; }
public K[] ArrayProperty { get; set; }
}
#endif

// no arguments
[Test]
Expand Down Expand Up @@ -592,7 +594,7 @@ public TestAttribute(UInt64Enum[] value) { }
private string TypeToString(Type type)
{
if (type == typeof(Type))
return "[System.Runtime]System.Type";
return $"[{MetadataReaderTestHelpers.RuntimeAssemblyName}]System.Type";

if (type.IsArray)
{
Expand Down