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

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>2018-02-21 22:48:51 +0300
committerGitHub <noreply@github.com>2018-02-21 22:48:51 +0300
commit3538128fa1fb2b77a81026934d61cd370a0fd7f5 (patch)
tree07d05afa35b7a285597d384544ae48088b12c2c3 /src/System.Security.Cryptography.Encoding/tests
parenta87573a29f10a2402fc5c9f98c4a1a4c946720b4 (diff)
Rename string-slicing extension methods (#27328)
* Rename string-slicing extension methods As part of https://github.com/dotnet/corefx/issues/26894 the api folks have approved renaming AsROSpan and AsROMemory on string instances to AsSpan and AsMemory (as the "readonly" is obvious given the read-only nature of the input.) This puts the renaming in effect. Basically a big search-replace commit. * Fix OpenSSL build break * I see this is going to be a treadmill
Diffstat (limited to 'src/System.Security.Cryptography.Encoding/tests')
-rw-r--r--src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs36
-rw-r--r--src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteObjectIdentifier.cs12
2 files changed, 24 insertions, 24 deletions
diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs
index b158615e23..67584074d7 100644
--- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs
+++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs
@@ -107,7 +107,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
- WriteSpan(writer, input.AsReadOnlySpan());
+ WriteSpan(writer, input.AsSpan());
Verify(writer, Stringify(StandardTag) + expectedPayloadHex);
}
@@ -118,7 +118,7 @@ namespace System.Security.Cryptography.Tests.Asn1
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
Asn1Tag tag = new Asn1Tag(TagClass.Private, int.MaxValue >> 1);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(tag) + expectedPayloadHex);
}
@@ -128,7 +128,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
- WriteSpan(writer, input.AsReadOnlySpan());
+ WriteSpan(writer, input.AsSpan());
Verify(writer, Stringify(StandardTag) + expectedPayloadHex);
}
@@ -139,7 +139,7 @@ namespace System.Security.Cryptography.Tests.Asn1
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
Asn1Tag tag = new Asn1Tag(TagClass.Application, 30);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(tag) + expectedPayloadHex);
}
@@ -149,7 +149,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
- WriteSpan(writer, input.AsReadOnlySpan());
+ WriteSpan(writer, input.AsSpan());
Verify(writer, Stringify(StandardTag) + expectedPayloadHex);
}
@@ -160,7 +160,7 @@ namespace System.Security.Cryptography.Tests.Asn1
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
Asn1Tag tag = new Asn1Tag(TagClass.ContextSpecific, 31);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(tag) + expectedPayloadHex);
}
@@ -196,7 +196,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
Asn1Tag standard = StandardTag;
Asn1Tag tag = new Asn1Tag(standard.TagClass, standard.TagValue, isConstructed: true);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(standard) + expectedPayloadHex);
}
@@ -208,7 +208,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
Asn1Tag tag = new Asn1Tag(TagClass.Private, 24601, isConstructed: true);
Asn1Tag expected = new Asn1Tag(tag.TagClass, tag.TagValue);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(expected) + expectedPayloadHex);
}
@@ -244,7 +244,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
Asn1Tag standard = StandardTag;
Asn1Tag tag = new Asn1Tag(standard.TagClass, standard.TagValue, isConstructed: true);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(standard) + expectedPayloadHex);
}
@@ -256,7 +256,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
Asn1Tag tag = new Asn1Tag(TagClass.Application, 11, isConstructed: true);
Asn1Tag expected = new Asn1Tag(tag.TagClass, tag.TagValue);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(expected) + expectedPayloadHex);
}
@@ -292,7 +292,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
Asn1Tag standard = StandardTag;
Asn1Tag tag = new Asn1Tag(standard.TagClass, standard.TagValue, isConstructed: true);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(standard) + expectedPayloadHex);
}
@@ -304,7 +304,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
Asn1Tag tag = new Asn1Tag(TagClass.Private, 24601, isConstructed: true);
Asn1Tag expected = new Asn1Tag(tag.TagClass, tag.TagValue);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
Verify(writer, Stringify(expected) + expectedPayloadHex);
}
@@ -346,7 +346,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
AssertExtensions.Throws<ArgumentException>(
"tag",
- () => WriteSpan(writer, Asn1Tag.EndOfContents, "hi".AsReadOnlySpan()));
+ () => WriteSpan(writer, Asn1Tag.EndOfContents, "hi".AsSpan()));
}
}
@@ -436,7 +436,7 @@ namespace System.Security.Cryptography.Tests.Asn1
Asn1Tag tag = new Asn1Tag(standard.TagClass, standard.TagValue, true);
string tagHex = Stringify(tag);
- WriteSpan(writer, input.AsReadOnlySpan());
+ WriteSpan(writer, input.AsSpan());
VerifyWrite_CERSegmented(writer, tagHex, contentByteCount);
}
}
@@ -448,7 +448,7 @@ namespace System.Security.Cryptography.Tests.Asn1
Asn1Tag tag = new Asn1Tag(TagClass.Private, 7, true);
string tagHex = Stringify(tag);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
VerifyWrite_CERSegmented(writer, tagHex, contentByteCount);
}
}
@@ -461,7 +461,7 @@ namespace System.Security.Cryptography.Tests.Asn1
Asn1Tag tag = new Asn1Tag(standard.TagClass, standard.TagValue, true);
string tagHex = Stringify(tag);
- WriteSpan(writer, tag, input.AsReadOnlySpan());
+ WriteSpan(writer, tag, input.AsSpan());
VerifyWrite_CERSegmented(writer, tagHex, contentByteCount);
}
}
@@ -474,7 +474,7 @@ namespace System.Security.Cryptography.Tests.Asn1
Asn1Tag constr = new Asn1Tag(prim.TagClass, prim.TagValue, true);
string tagHex = Stringify(constr);
- WriteSpan(writer, prim, input.AsReadOnlySpan());
+ WriteSpan(writer, prim, input.AsSpan());
VerifyWrite_CERSegmented(writer, tagHex, contentByteCount);
}
}
@@ -491,7 +491,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
using (AsnWriter writer = new AsnWriter(AsnEncodingRules.BER))
{
- Assert.Throws<EncoderFallbackException>(() => WriteSpan(writer, input.AsReadOnlySpan()));
+ Assert.Throws<EncoderFallbackException>(() => WriteSpan(writer, input.AsSpan()));
}
}
}
diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteObjectIdentifier.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteObjectIdentifier.cs
index 5d480a0082..6b5722f090 100644
--- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteObjectIdentifier.cs
+++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteObjectIdentifier.cs
@@ -34,7 +34,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
using (AsnWriter writer = new AsnWriter((AsnEncodingRules)ruleSet))
{
- writer.WriteObjectIdentifier(oidValue.AsReadOnlySpan());
+ writer.WriteObjectIdentifier(oidValue.AsSpan());
Verify(writer, expectedHex);
}
@@ -81,7 +81,7 @@ namespace System.Security.Cryptography.Tests.Asn1
using (AsnWriter writer = new AsnWriter((AsnEncodingRules)ruleSet))
{
Assert.Throws<CryptographicException>(
- () => writer.WriteObjectIdentifier(nonOidValue.AsReadOnlySpan()));
+ () => writer.WriteObjectIdentifier(nonOidValue.AsSpan()));
}
}
@@ -123,7 +123,7 @@ namespace System.Security.Cryptography.Tests.Asn1
{
using (AsnWriter writer = new AsnWriter((AsnEncodingRules)ruleSet))
{
- writer.WriteObjectIdentifier(new Asn1Tag(TagClass.Application, 2), "1.3.14.3.2.26".AsReadOnlySpan());
+ writer.WriteObjectIdentifier(new Asn1Tag(TagClass.Application, 2), "1.3.14.3.2.26".AsSpan());
Verify(writer, "42052B0E03021A");
}
@@ -206,7 +206,7 @@ namespace System.Security.Cryptography.Tests.Asn1
AssertExtensions.Throws<ArgumentException>(
"tag",
- () => writer.WriteObjectIdentifier(Asn1Tag.EndOfContents, "1.1".AsReadOnlySpan()));
+ () => writer.WriteObjectIdentifier(Asn1Tag.EndOfContents, "1.1".AsSpan()));
AssertExtensions.Throws<ArgumentException>(
"tag",
@@ -228,8 +228,8 @@ namespace System.Security.Cryptography.Tests.Asn1
writer.WriteObjectIdentifier(constructedOid, OidValue);
writer.WriteObjectIdentifier(constructedContext0, OidValue);
- writer.WriteObjectIdentifier(constructedOid, OidValue.AsReadOnlySpan());
- writer.WriteObjectIdentifier(constructedContext0, OidValue.AsReadOnlySpan());
+ writer.WriteObjectIdentifier(constructedOid, OidValue.AsSpan());
+ writer.WriteObjectIdentifier(constructedContext0, OidValue.AsSpan());
writer.WriteObjectIdentifier(constructedOid, new Oid(OidValue, OidValue));
writer.WriteObjectIdentifier(constructedContext0, new Oid(OidValue, OidValue));