diff options
author | Atsushi Kanamori <atsushik@microsoft.com> | 2017-05-12 02:15:15 +0300 |
---|---|---|
committer | Atsushi Kanamori <atsushik@microsoft.com> | 2017-05-12 02:15:15 +0300 |
commit | a994f658fe5a750261da7f9493646b071e9379b3 (patch) | |
tree | 4baad29ea99ebee32fc88e26b62cb6c6bc941051 /src/System.Security.Cryptography.Encoding/tests | |
parent | 064e0d84b7208a6caf6d1d9240391c4f5fe53bad (diff) |
Fix all failures in Security.Cryptography.Encoding.Tests on ILC
Diffstat (limited to 'src/System.Security.Cryptography.Encoding/tests')
3 files changed, 12 insertions, 6 deletions
diff --git a/src/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs b/src/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs index 332707334a..e09d8a3b23 100644 --- a/src/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs +++ b/src/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs @@ -124,10 +124,13 @@ namespace System.Security.Cryptography.Encoding.Tests Assert.Throws<ArgumentOutOfRangeException>(() => c.CopyTo(a, 3)); Assert.Throws<ArgumentException>(() => c.CopyTo(a, 1)); - // Array has non-zero lower bound - ICollection ic = c; - Array array = Array.CreateInstance(typeof(object), new int[] { 10 }, new int[] { 10 }); - Assert.Throws<IndexOutOfRangeException>(() => ic.CopyTo(array, 0)); + if (PlatformDetection.IsNonZeroLowerBoundArraySupported) + { + // Array has non-zero lower bound + ICollection ic = c; + Array array = Array.CreateInstance(typeof(object), new int[] { 10 }, new int[] { 10 }); + Assert.Throws<IndexOutOfRangeException>(() => ic.CopyTo(array, 0)); + } } diff --git a/src/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs b/src/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs index c2a71a330c..3d499a9816 100644 --- a/src/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs +++ b/src/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs @@ -127,7 +127,7 @@ namespace System.Security.Cryptography.Encoding.Tests additionalValidation?.Invoke(c); } - [Fact] + [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] public void CopyTo_NonZeroLowerBound_ThrowsIndexOutOfRangeException() { Oid item = new Oid(Sha1Oid, Sha1Name); diff --git a/src/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj b/src/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj index 186fd923b6..0d8ba0c6d0 100644 --- a/src/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj +++ b/src/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj @@ -26,9 +26,12 @@ <Compile Include="$(CommonTestPath)\System\AssertExtensions.cs"> <Link>Common\System\AssertExtensions.cs</Link> </Compile> + <Compile Include="$(CommonTestPath)\System\PlatformDetection.cs"> + <Link>Common\System\PlatformDetection.cs</Link> + </Compile> <Compile Include="$(CommonTestPath)\System\Security\Cryptography\ByteUtils.cs"> <Link>CommonTest\System\Security\Cryptography\ByteUtils.cs</Link> </Compile> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> -</Project>
\ No newline at end of file +</Project> |