Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly()

public static bool IsMetadataUpdateSupported => !IsNativeAot;

public static bool IsBoxedByRefLikeValuesSupported => !IsNativeAot;

// System.Security.Cryptography.Xml.XmlDsigXsltTransform.GetOutput() relies on XslCompiledTransform which relies
// heavily on Reflection.Emit
public static bool IsXmlDsigXsltTransformSupported => !PlatformDetection.IsInAppContainer && IsReflectionEmitSupported;
Expand Down
12 changes: 6 additions & 6 deletions src/libraries/System.Formats.Asn1/tests/Reader/ReadLength.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private delegate Asn1Tag ReadTagAndLengthDelegate(
typeof(AsnDecoder).GetMethod("ReadTagAndLength", BindingFlags.Static | BindingFlags.NonPublic)
.CreateDelegate(typeof(ReadTagAndLengthDelegate));

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBoxedByRefLikeValuesSupported))]
[InlineData(4, 0, "0400")]
[InlineData(1, 1, "0101")]
[InlineData(4, 127, "047F")]
Expand Down Expand Up @@ -53,7 +53,7 @@ public static void ReadWithUnknownRuleSet(int invalidRuleSetValue)
() => new AsnReader(data, (AsnEncodingRules)invalidRuleSetValue));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBoxedByRefLikeValuesSupported))]
[InlineData("")]
[InlineData("05")]
[InlineData("0481")]
Expand All @@ -68,7 +68,7 @@ public static void ReadWithInsufficientData(string inputHex)
() => ReadTagAndLength(inputData, AsnEncodingRules.DER, out _, out _));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBoxedByRefLikeValuesSupported))]
[InlineData("DER indefinite constructed", AsnEncodingRules.DER, "3080" + "0500" + "0000")]
[InlineData("0xFF-BER", AsnEncodingRules.BER, "04FF")]
[InlineData("0xFF-CER", AsnEncodingRules.CER, "04FF")]
Expand Down Expand Up @@ -108,7 +108,7 @@ public static void InvalidLengths(
() => ReadTagAndLength(inputData, rules, out _, out _));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBoxedByRefLikeValuesSupported))]
[InlineData(AsnEncodingRules.BER)]
[InlineData(AsnEncodingRules.CER)]
public static void IndefiniteLength(AsnEncodingRules ruleSet)
Expand All @@ -131,7 +131,7 @@ public static void IndefiniteLength(AsnEncodingRules ruleSet)
Assert.True(tag.IsConstructed, "tag.IsConstructed");
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBoxedByRefLikeValuesSupported))]
[InlineData(0, "0483000000")]
[InlineData(1, "048A00000000000000000001")]
[InlineData(128, "049000000000000000000000000000000080")]
Expand All @@ -152,7 +152,7 @@ public static void BerNonMinimalLength(int expectedLength, string inputHex)
Assert.True(reader.HasData, "reader.HasData");
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBoxedByRefLikeValuesSupported))]
[InlineData(AsnEncodingRules.BER, 4, 0, 5, "0483000000" + "0500")]
[InlineData(AsnEncodingRules.DER, 1, 1, 2, "0101" + "FF")]
[InlineData(AsnEncodingRules.CER, 0x10, null, 2, "3080" + "0500" + "0000")]
Expand Down
1 change: 0 additions & 1 deletion src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.DirectoryServices.Protocols\tests\System.DirectoryServices.Protocols.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Drawing.Primitives\tests\System.Drawing.Primitives.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Dynamic.Runtime\tests\System.Dynamic.Runtime.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Formats.Asn1\tests\System.Formats.Asn1.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Formats.Cbor\tests\System.Formats.Cbor.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\System.Globalization.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\NlsTests\System.Globalization.Nls.Tests.csproj" />
Expand Down